using System; using System.Collections.Generic; using System.Linq; using QMAPP.DAL; using QMAPP.FJC.Entity.MesB9; using QMAPP.FJC.Entity.QdFis; using QMFrameWork.Data; namespace QMAPP.FJC.DAL.QdFis { public class ybbM100DAL : BaseDAL { public List GetList100() { List parameters = new List(); string sql = "SELECT * FROM T_PM_FISORDER WHERE ReadFlag=0"; if (BaseSession != null) { return BaseSession.GetList(sql, parameters.ToArray()).ToList(); } using (IDataSession session = AppDataFactory.CreateMainSession()) { return session.GetList(sql, parameters.ToArray()).ToList(); } } public List GetList110() { List parameters = new List(); string sql = "SELECT * FROM T_PM_FISORDER WHERE ReadFlag=0 "; if (BaseSession != null) { return BaseSession.GetList(sql, parameters.ToArray()).ToList(); } using (IDataSession session = AppDataFactory.CreateMainSession()) { return session.GetList(sql, parameters.ToArray()).ToList(); } } public int Update100(ybbM100 model) { //同步插入本地数据库 List parameters = new List(); //var sql ="insert into T_FISORDER_M100 ([seq],[kin],[vin],[m100dtm],[ProdNo1],[ProdNo2],[ProdNo3],[ProdNo4],[assemblyline],[sysdtm],[ReadFlag]) values('" + model.seq + "','" + model.kin + "','" + model.vin + "','" + model.m100dtm + "','" + model.ProdNo1 + "','" + model.ProdNo2 + "','" + model.ProdNo3 + "','" + model.ProdNo4 + "','" + model.assemblyline + "','" + DateTime.Now + "'," + model.ReadFlag + ")"; string sql = "update T_PM_FISORDER set ReadFlag=1 WHERE KIN='" + model.KIN + "'"; if (BaseSession != null) { return BaseSession.ExecuteSql(sql, parameters.ToArray()); } using (IDataSession session = AppDataFactory.CreateMainSession()) { return session.ExecuteSql(sql, parameters.ToArray()); } } public int Update110(ybbM110 model) { //同步插入本地数据库 List parameters = new List(); //var sql ="insert into T_FISORDER_M100 ([seq],[kin],[vin],[m100dtm],[ProdNo1],[ProdNo2],[ProdNo3],[ProdNo4],[assemblyline],[sysdtm],[ReadFlag]) values('" + model.seq + "','" + model.kin + "','" + model.vin + "','" + model.m100dtm + "','" + model.ProdNo1 + "','" + model.ProdNo2 + "','" + model.ProdNo3 + "','" + model.ProdNo4 + "','" + model.assemblyline + "','" + DateTime.Now + "'," + model.ReadFlag + ")"; string sql = "update T_PM_FISORDER set ReadFlag=1 WHERE KIN='" + model.KIN + "'"; if (BaseSession != null) { return BaseSession.ExecuteSql(sql, parameters.ToArray()); } using (IDataSession session = AppDataFactory.CreateMainSession()) { return session.ExecuteSql(sql, parameters.ToArray()); } } } }