华恒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.

159 lines
4.6 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 ICSSoft.Base.Config.AppConfig;
  8. using System.Data;
  9. namespace ICSSoft.Frame.Data.BLL
  10. {
  11. public class ICSSEGBLL
  12. {
  13. //public static DataTable SearchShifTypeInfoList(string dsconn)
  14. //{
  15. // try
  16. // {
  17. // DataTable returndt = new DataTable();
  18. // returndt.Columns.Add("guid",typeof(string));
  19. // returndt.Columns.Add("班制代码", typeof(string));
  20. // returndt.Columns.Add("班制描述", typeof(string));
  21. // List<FormICSShifTypeUIModel> returndal = ICSSEGDAL.SearchShifTypeInfoList(dsconn);
  22. // foreach (FormICSShifTypeUIModel returntype in returndal)
  23. // {
  24. // DataRow dr = returndt.NewRow();
  25. // dr["guid"] = returntype.ID;
  26. // dr["班制代码"] = returntype.SHIFTTYPECODE;
  27. // dr["班制描述"] = returntype.SHIFTTYPEDESC;
  28. // returndt.Rows.Add(dr);
  29. // }
  30. // return returndt;
  31. // }
  32. // catch (Exception ex)
  33. // {
  34. // throw ex;
  35. // }
  36. //}
  37. public static DataTable SearchFacInfoList(string dsconn)
  38. {
  39. try
  40. {
  41. DataTable returndt = new DataTable();
  42. returndt.Columns.Add("guid", typeof(string));
  43. returndt.Columns.Add("工厂代码", typeof(string));
  44. returndt.Columns.Add("工厂描述", typeof(string));
  45. List<FormICSFactoryUIModel> returndal = ICSSEGDAL.SearchFacInfoList(dsconn);
  46. foreach (FormICSFactoryUIModel returntype in returndal)
  47. {
  48. DataRow dr = returndt.NewRow();
  49. dr["guid"] = returntype.ID;
  50. dr["工厂代码"] = returntype.FACCODE;
  51. dr["工厂描述"] = returntype.FACDESC;
  52. returndt.Rows.Add(dr);
  53. }
  54. return returndt;
  55. }
  56. catch (Exception ex)
  57. {
  58. throw ex;
  59. }
  60. }
  61. #region 新增和修改
  62. public static void Add(FormICSSEGUIModel segInfo, string dsconn)
  63. {
  64. try
  65. {
  66. if (string.IsNullOrWhiteSpace(dsconn))
  67. {
  68. throw new Exception("数据库连接字符串错误");
  69. }
  70. List<FormICSSEGUIModel> SEGInfoList = new List<FormICSSEGUIModel>() { segInfo };
  71. ICSSEGDAL.Add(SEGInfoList, dsconn);
  72. }
  73. catch (Exception ex)
  74. {
  75. throw ex;
  76. }
  77. }
  78. #endregion
  79. #region 通过工厂代码查询
  80. public static FormICSSEGUIModel SearchSEGInfoByCode(string segCODE, string dsconn)
  81. {
  82. try
  83. {
  84. List<FormICSSEGUIModel> returnlist = ICSSEGDAL.SearchSEGInfoByCode(segCODE, dsconn);
  85. return returnlist[0];
  86. }
  87. catch (Exception ex)
  88. {
  89. throw ex;
  90. }
  91. }
  92. #endregion
  93. #region 判断是否在产线中
  94. public static bool IncludingSS(List<string> idList, string dsconn)
  95. {
  96. try
  97. {
  98. return ICSSEGDAL.IncludingSS(idList, dsconn);
  99. }
  100. catch (Exception ex)
  101. {
  102. throw ex;
  103. }
  104. }
  105. #endregion
  106. #region 删除
  107. public static void deleteInfo(List<string> codeList, string dsconn)
  108. {
  109. try
  110. {
  111. ICSSEGDAL.deleteInfo(codeList, dsconn);
  112. }
  113. catch (Exception ex)
  114. {
  115. throw ex;
  116. }
  117. }
  118. #endregion
  119. #region 车间代码是否存在
  120. public static bool IsIncluding(string segCODE, string dsconn)
  121. {
  122. try
  123. {
  124. return ICSSEGDAL.IsIncluding(segCODE, dsconn);
  125. }
  126. catch (Exception ex)
  127. {
  128. throw ex;
  129. }
  130. }
  131. #endregion
  132. #region 判断是否和工作中心关联
  133. public static bool IncludingEquipment(List<string> idList, string dsconn)
  134. {
  135. try
  136. {
  137. return ICSSEGDAL.IncludingEquipment(idList, dsconn);
  138. }
  139. catch (Exception ex)
  140. {
  141. throw ex;
  142. }
  143. }
  144. #endregion
  145. }
  146. }