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_SUPP所对应的BLL类(生成工具:代码生成工具4.0 访问地址:http://172.16.2.128/tool/) /// 作者:tgcx-test 时间:2016-08-16 /// public class ComBaseSuppBLL { private OpeBase _ob; public ComBaseSuppBLL(OpeBase ob) { _ob = ob; } /// /// 查询 /// public DataTable Query(string suppCode, string suppName, string suppLinkMan, string validflag) { DataTable dt = ServerHelper.GetData( "com.steering.pss.qcm.DAL.ComBaseSuppDAL.Query", new object[] { suppCode, suppName, suppLinkMan, validflag }, _ob); return dt; } /// /// 通过主键查询 /// public ComBaseSuppEntity QueryByPk(string SuppCode) { List comBaseSuppEntity = EntityHelper.GetData( "com.steering.pss.qcm.DAL.ComBaseSuppDAL.QueryByPk", new object[] { SuppCode }, _ob); if (comBaseSuppEntity.Count > 0) { return comBaseSuppEntity[0]; } else { return null; } } /// /// 新增 /// public string Insert(ComBaseSuppEntity supp) { return ServerHelper.SetDataReturnObj("com.steering.pss.qcm.DAL.ComBaseSuppDAL.Insert", new object[] { JsonConvert.SerializeObject(supp) }, _ob).ToString(); } /// /// 修改 /// public void Update(ComBaseSuppEntity supp) { ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseSuppDAL.Update", new object[] { JsonConvert.SerializeObject(supp) }, _ob); } /// /// 修改作废标志 /// public void UpdateValidflag(ComBaseSuppEntity comBaseSuppEntity, string validflag) { ServerHelper.SetData("com.steering.pss.qcm.DAL.ComBaseSuppDAL.UpdateValidflag", new object[] { JsonConvert.SerializeObject(comBaseSuppEntity), validflag }, _ob); } public DataTable QueryRegion() { return ServerHelper.GetData("com.steering.pss.qcm.DAL.ComBaseSuppDAL.QueryRegion", new object[] { }, _ob); } public bool IsRepeat(string suppName, string suppCode) { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.DAL.ComBaseSuppDAL.IsRepeat", new object[] { suppName, suppCode }, _ob); return dt.Rows[0][0].ToString() == "0" ? false : true; } } }