华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
3.7 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ICSSoft.Frame.Data.Entity;
  6. using ICSSoft.Frame.Data.DAL;
  7. using System.Data;
  8. namespace ICSSoft.Frame.Data.BLL
  9. {
  10. public class ICSOPBLL
  11. {
  12. #region 新增和修改
  13. public static void Add(FormICSOPUIModel tbInfo, string dsconn)
  14. {
  15. try
  16. {
  17. if (string.IsNullOrWhiteSpace(dsconn))
  18. {
  19. throw new Exception("数据库连接字符串错误");
  20. }
  21. List<FormICSOPUIModel> tbInfoList = new List<FormICSOPUIModel>() { tbInfo };
  22. ICSOPDAL.Add(tbInfoList, dsconn);
  23. }
  24. catch (Exception ex)
  25. {
  26. throw ex;
  27. }
  28. }
  29. #endregion
  30. #region 工序代码是否存在
  31. public static bool IsIncluding(string opCODE, string dsconn)
  32. {
  33. try
  34. {
  35. return ICSOPDAL.IsIncluding(opCODE, dsconn);
  36. }
  37. catch (Exception ex)
  38. {
  39. throw ex;
  40. }
  41. }
  42. #endregion
  43. #region 查询工序信息
  44. public static FormICSOPUIModel SearchOPInfo(string opcode, string dsconn)
  45. {
  46. try
  47. {
  48. List<FormICSOPUIModel> returnlist = ICSOPDAL.SearchOPInfo(opcode, dsconn);
  49. return returnlist[0];
  50. }
  51. catch (Exception ex)
  52. {
  53. throw ex;
  54. }
  55. }
  56. #endregion
  57. #region 删除
  58. public static void deleteInfo(List<string> codeList, string dsconn)
  59. {
  60. try
  61. {
  62. ICSOPDAL.deleteInfo(codeList, dsconn);
  63. }
  64. catch (Exception ex)
  65. {
  66. throw ex;
  67. }
  68. }
  69. #endregion
  70. #region 判断是否在工序和资源的关系中
  71. public static bool Including2RES(List<string> idList, string dsconn)
  72. {
  73. try
  74. {
  75. return ICSOPDAL.Including2RES(idList, dsconn);
  76. }
  77. catch (Exception ex)
  78. {
  79. throw ex;
  80. }
  81. }
  82. #endregion
  83. #region 判断是否在途程和工序的关系中
  84. public static bool IncludingROUTE2OP(List<string> idList, string dsconn)
  85. {
  86. try
  87. {
  88. return ICSOPDAL.IncludingROUTE2OP(idList, dsconn);
  89. }
  90. catch (Exception ex)
  91. {
  92. throw ex;
  93. }
  94. }
  95. #endregion
  96. #region 新增和修改List
  97. public static void AddList(List<FormICSOPUIModel> tbInfoList, string dsconn)
  98. {
  99. try
  100. {
  101. if (string.IsNullOrWhiteSpace(dsconn))
  102. {
  103. throw new Exception("数据库连接字符串错误");
  104. }
  105. ICSOPDAL.Add(tbInfoList, dsconn);
  106. }
  107. catch (Exception ex)
  108. {
  109. throw ex;
  110. }
  111. }
  112. #endregion
  113. #region 获取成本中心
  114. public static DataTable SearchData(string dsconn)
  115. {
  116. try
  117. {
  118. return ICSOPDAL.SearchData(dsconn);
  119. }
  120. catch (Exception ex)
  121. {
  122. throw ex;
  123. }
  124. }
  125. public static DataTable SearchData(string EnumText, string dsconn)
  126. {
  127. try
  128. {
  129. return ICSOPDAL.SearchData(EnumText, dsconn);
  130. }
  131. catch (Exception ex)
  132. {
  133. throw ex;
  134. }
  135. }
  136. #endregion
  137. }
  138. }