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.
75 lines
3.3 KiB
75 lines
3.3 KiB
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<ybbM100> GetList100()
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
string sql = "SELECT * FROM T_PM_FISORDER WHERE ReadFlag=0";
|
|
if (BaseSession != null)
|
|
{
|
|
return BaseSession.GetList<ybbM100>(sql, parameters.ToArray()).ToList();
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
return session.GetList<ybbM100>(sql, parameters.ToArray()).ToList();
|
|
}
|
|
}
|
|
|
|
public List<ybbM110> GetList110()
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
string sql = "SELECT * FROM T_PM_FISORDER WHERE ReadFlag=0 ";
|
|
if (BaseSession != null)
|
|
{
|
|
return BaseSession.GetList<ybbM110>(sql, parameters.ToArray()).ToList();
|
|
}
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
return session.GetList<ybbM110>(sql, parameters.ToArray()).ToList();
|
|
}
|
|
}
|
|
|
|
public int Update100(ybbM100 model)
|
|
{
|
|
//同步插入本地数据库
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
//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<DataParameter> parameters = new List<DataParameter>();
|
|
//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());
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|