Program.cs 1.22 KB
using HHECS.Dal;
using HHECS.Dal.Repository;
using HHECS.Model.Entities;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace HHECS.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            DALHelper.Constr = "server=172.16.29.15;user id=root;password=HHsoft123.;persistsecurityinfo=True;database=huahengwcs4_cshhdoublefork;SslMode=none;Charset=utf8mb4;Allow User Variables=True";
            //DALHelper.SyncTable();
            var equipmentTypePropTemplateRepository = new EquipmentTypePropTemplateRepository();
            List<int> ids = new List<int>() { 15 };
            var equipmentTypePropTemplates = equipmentTypePropTemplateRepository.Where(t => ids.Contains(t.EquipmentTypeId)).ToList();
            var freeSql = DALHelper.GetFreeSql("server=172.16.29.15;user id=root;password=HHsoft123.;persistsecurityinfo=True;database=huahengecs4_ems;SslMode=none;Charset=utf8mb4;Allow User Variables=True");
            equipmentTypePropTemplates.ForEach(t => t.EquipmentTypeId = 4);
            var count = freeSql.Insert<EquipmentTypePropTemplate>(equipmentTypePropTemplates).ExecuteAffrows();
            Console.WriteLine("ok");
            Console.Read();
        }
    }
}