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; using System.Collections.Generic; using System.Data; namespace Core.StlMes.Client.Qcm.BLL { /// /// 数据库表QCM_ZBS_TEMPLATE_R_MSC所对应的BLL类(生成工具:代码生成工具) /// 作者:tgcx-test 时间:2016-05-13 /// public class QcmZbsTemplateRMscBLL { private OpeBase _ob; public QcmZbsTemplateRMscBLL(OpeBase ob) { _ob = ob; } /// /// 查询 /// public List Query(string msc, string validflag) { List qcmZbsTemplateRMscEntity = EntityHelper.GetData( "com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.Query", new object[] { msc, validflag }, _ob); return qcmZbsTemplateRMscEntity; } /// /// 通过主键查询 /// public List QueryByPk(string Msc, string Tbh) { List qcmZbsTemplateRMscEntity = EntityHelper.GetData( "com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.QueryByPk", new object[] { Msc, Tbh }, _ob); return qcmZbsTemplateRMscEntity; } /// /// 新增 /// public void Insert(List qcmZbsTemplateRMscEntitys) { List jsons = new List(); foreach (var qcmZbsTemplateRMscEntity in qcmZbsTemplateRMscEntitys) { jsons.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.Insert", new object[] { jsons }, _ob); } /// /// 修改 /// public void Update(List qcmZbsTemplateRMscEntitys) { List jsons = new List(); foreach (var qcmZbsTemplateRMscEntity in qcmZbsTemplateRMscEntitys) { jsons.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.Update", new object[] { jsons }, _ob); } /// /// 保存 /// public void Save(List qcmZbsTemplateRMscEntitys, List qcmZbsTemplateRMscSpecEntitys) { List jsons = new List(); foreach (var qcmZbsTemplateRMscEntity in qcmZbsTemplateRMscEntitys) { jsons.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscEntity)); } List jsons2 = new List(); foreach (var qcmZbsTemplateRMscSpecEntity in qcmZbsTemplateRMscSpecEntitys) { jsons2.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscSpecEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.Save", new object[] { jsons, jsons2 }, _ob); } /// /// 修改作废标志 /// public void UpdateValidflag(List qcmZbsTemplateRMscEntitys, List qcmZbsTemplateRMscSpecEntitys, string validflag) { List jsons = new List(); foreach (var qcmZbsTemplateRMscEntity in qcmZbsTemplateRMscEntitys) { jsons.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscEntity)); } List jsons2 = new List(); foreach (var qcmZbsTemplateRMscSpecEntity in qcmZbsTemplateRMscSpecEntitys) { jsons2.Add(JsonConvert.SerializeObject(qcmZbsTemplateRMscSpecEntity)); } ServerHelper.SetData("com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.UpdateValidflag", new object[] { jsons, jsons2, validflag }, _ob); } public int GetZbsRMscCnt(string msc, string tbh) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.DAL.QcmZbsTemplateRMscDAL.GetZbsRMscCnt", new object[] { msc, tbh }, _ob); return Convert.ToInt32(dt.Rows[0][0]); } } }