ScmOeateRule.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using CoreFS.CA06;
  6. using System.Data;
  7. using System.Collections;
  8. using Core.Mes.Client.Common;
  9. using Core.LgMes.Client.lgDbMgt;
  10. namespace Core.LgMes.Client.lgServiceMgt.LgScmOpeateRule
  11. {
  12. public class ScmOeateRule: Core.LgMes.Client.lgServiceMgt.BaseService.LgBaseService
  13. {
  14. private string UPDATEScmOeateRuleContextType = " update scm_opeaterule a set a.doctype = '{0}' where ruleid = '{1}' and rownum = 1 ";
  15. private string SELECTScmOeateRuleByRuleId = " select ruleid, rulename, description, doc, deviceno,steelcode, recorder,inputtime, content, doctype, isvalid,isbegintime, isendtime,descriptionname, posittion from scm_opeaterule a where a.ruleid = '{0}' ";
  16. private string SELECTScmOeateRuleByRuleIdAll = " select ruleid, rulename, description, doc, deviceno,steelcode, recorder,inputtime, doctype, isvalid,isbegintime, isendtime,descriptionname, posittion from scm_opeaterule a where 1 = 1 {0}";
  17. /// <summary>
  18. /// 更新操作规程管理中的类型
  19. /// </summary>
  20. /// <param name="param1"></param>
  21. public void UpdateScmOperateRuleContextType(ClientParamWithSqlConditionAndOpenBase param1)
  22. {
  23. string sqlStr = string.Format(UPDATEScmOeateRuleContextType, param1.param[0].ToString(), param1.param[1].ToString());
  24. DbClientParam param = new DbClientParam(sqlStr, param1.ob);
  25. base.ReturnDbCommondByCommondType(DbCommandType.Ejgz).ExecuteNonQuery(param);
  26. }
  27. public DataSet GetScmOperateRuleDsByRuleId(ClientParamWithSqlConditionAndOpenBase param)
  28. {
  29. string sqlStr = string.Format(SELECTScmOeateRuleByRuleId, param.sqlCondition);
  30. try
  31. {
  32. return base.ReturnDbCommondByCommondType(DbCommandType.Ejgz).ExecuteReader(new DbClientParam(sqlStr, param.ob));
  33. }
  34. catch
  35. {
  36. return null;
  37. }
  38. }
  39. public DataSet GetScmOperateRuleDs(ClientParamWithSqlConditionAndOpenBase param)
  40. {
  41. string sqlStr = string.Format(SELECTScmOeateRuleByRuleIdAll, param.sqlCondition);
  42. try
  43. {
  44. return base.ReturnDbCommondByCommondType(DbCommandType.Ejgz).ExecuteReader(new DbClientParam(sqlStr, param.ob));
  45. }
  46. catch
  47. {
  48. return null;
  49. }
  50. }
  51. }
  52. }