using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Qcm.model; using CoreFS.CA06; using Newtonsoft.Json; using System.Collections.Generic; using System.Data; namespace Core.StlMes.Client.Qcm.BLL { /// /// 数据库表COM_BASE_INFO所对应的BLL类(生成工具:代码生成工具) /// 作者:tgcx-test 时间:2016-06-04 /// public class ComBaseInfoBLL { private OpeBase _ob; public ComBaseInfoBLL(OpeBase ob) { _ob = ob; } /// /// 查询 /// public List Query(string sortCode, string baseName, string validflag) { List comBaseInfoEntity = EntityHelper.GetData( "com.steering.pss.qcm.DAL.ComBaseInfoDAL.Query", new object[] { sortCode, baseName, validflag }, _ob); return comBaseInfoEntity; } /// /// 通过主键查询 /// public List QueryByPk(string Basecode) { List comBaseInfoEntity = EntityHelper.GetData( "com.steering.pss.qcm.DAL.ComBaseInfoDAL.QueryByPk", new object[] { Basecode }, _ob); return comBaseInfoEntity; } /// /// 新增 /// public void Insert(List comBaseInfoEntitys) { List jsons = new List(); foreach (var comBaseInfoEntity in comBaseInfoEntitys) { jsons.Add(JsonConvert.SerializeObject(comBaseInfoEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseInfoDAL.Insert", new object[] { jsons }, _ob); } /// /// 修改 /// public void Update(List comBaseInfoEntitys) { List jsons = new List(); foreach (var comBaseInfoEntity in comBaseInfoEntitys) { jsons.Add(JsonConvert.SerializeObject(comBaseInfoEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseInfoDAL.Update", new object[] { jsons }, _ob); } /// /// 保存 /// public void Save(List comBaseInfoEntitys) { List jsons = new List(); foreach (var comBaseInfoEntity in comBaseInfoEntitys) { jsons.Add(JsonConvert.SerializeObject(comBaseInfoEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseInfoDAL.Save", new object[] { jsons }, _ob); } /// /// 修改作废标志 /// public void UpdateValidflag(List comBaseInfoEntitys, string validflag) { List jsons = new List(); foreach (var comBaseInfoEntity in comBaseInfoEntitys) { jsons.Add(JsonConvert.SerializeObject(comBaseInfoEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseInfoDAL.UpdateValidflag", new object[] { jsons, validflag }, _ob); } public int QueryBaseNameCnt(string sortCode, string baseName, string baseCode) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.DAL.ComBaseInfoDAL.QueryBaseNameCnt", new object[] { sortCode, baseName, baseCode }, _ob); return int.Parse(dt.Rows[0][0].ToString()); } } }