You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.8 KiB
59 lines
1.8 KiB
4 years ago
|
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 MesB9DAL : BaseDAL
|
||
|
{
|
||
|
|
||
|
public List<MesB9Entity> GetList()
|
||
|
{
|
||
|
List<DataParameter> parameters = new List<DataParameter>();
|
||
|
string sql = "SELECT * FROM Mes_B9 WHERE ReadFlag=0";
|
||
|
if (BaseSession != null)
|
||
|
{
|
||
|
return BaseSession.GetList<MesB9Entity>(sql, parameters.ToArray()).ToList();
|
||
|
}
|
||
|
using (IDataSession session = AppDataFactory.CreateSession("maindbSelect"))
|
||
|
{
|
||
|
return session.GetList<MesB9Entity>(sql, parameters.ToArray()).ToList();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
public int Update(MesB9Entity model)
|
||
|
{
|
||
|
if (BaseSession != null)
|
||
|
{
|
||
|
//同步插入本地数据库
|
||
|
List<DataParameter> parameters = new List<DataParameter>();
|
||
|
var sql =
|
||
|
"insert into [ADIENT_QD_MES].[dbo].[Mes_B9]([seq],[kin],[vin],[m100dtm],[ProdNo],[assemblyline],[sysdtm],[ReadFlag]) values('" + model.seq + "','" + model.kin + "','" + model.vin + "','" + model.m100dtm + "','" + 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);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|