using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using QMAPP.DAL; using QMAPP.FJC.Entity.Common.Constants; using QMAPP.FJC.Entity.CompleteStatistics; using QMAPP.FJC.Entity.MesB9; using QMFrameWork.Data; namespace QMAPP.FJC.DAL.MesB9 { public class MesB9M110DAL : BaseDAL { public List GetList() { List parameters = new List(); string sql = "SELECT * FROM Mes_B9_M110 WHERE ReadFlag=0"; if (BaseSession != null) { return BaseSession.GetList(sql, parameters.ToArray()).ToList(); } using (IDataSession session = AppDataFactory.CreateSession("maindbSelect")) { return session.GetList(sql, parameters.ToArray()).ToList(); } } public int Update(MesB9M110Entity model) { if (BaseSession != null) { //同步插入本地数据库 List parameters = new List(); var sql = "insert into [ADIENT_QD_MES].[dbo].[Mes_B9_M110]([seq],[kin],[vin],[m110dtm],[ProdNo],[assemblyline],[sysdtm],[ReadFlag]) values('" + model.seq + "','" + model.kin + "','" + model.vin + "','" + model.m110dtm + "','" + model.ProdNo + "','" + model.assemblyline + "','" + DateTime.Now + "'," + model.ReadFlag + ")"; BaseSession.ExecuteSql(sql, parameters.ToArray()); //插入基本信息 return BaseSession.Update(model); } using (IDataSession session = AppDataFactory.CreateSession("maindbSelect")) { return session.Update(model); } } } }