using Models.Models; using SamplePre.DAL; using SamplePre.DAL.DBContext; using SamplePre.Models.Ext; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SamplePre.ProcessBll.BLL { public class SysParamBll { public int DelSysParm(string id) { int val = DBFactory.Instance.Deleteable().Where(p => p.id == id).ExecuteCommand(); return val; } /// /// 判断该参数是否被使用,已使用不能删除 /// /// /// /// public bool IsExtisActionParam(string parmId) { //动作参数 List data = DBFactory.Instance.Queryable() .Where(p=>p.parm_id == parmId).ToList(); if(data.Count > 0) return true; //标准动作参数配置表 List data2 = DBFactory.Instance.Queryable() .Where(p => p.parm_id == parmId).ToList(); if (data2.Count > 0) return true; return false; } /// /// 判断plc编码是否存在 /// /// /// public bool IsExtisPlCcode(string plcCode) { List data2 = DBFactory.Instance.Queryable() .Where(p => p.plc_type == plcCode).ToList(); if (data2.Count > 0) return true; return false; } public List QuerySysParm() { List data = DBFactory.Instance.Queryable().ToList(); return data; } public int SaveSysParm(sys_parm parm) { int val = DBFactory.Instance.Insertable(parm).ExecuteCommand(); return val; } /// /// 更新参数数据 /// /// /// public int UpdateSysParm(sys_parm parm) { int val = DBFactory.Instance.Updateable(parm).ExecuteCommand(); return val; } } }