锐腾搅拌上料功能
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.

265 lines
6.8 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 ICSPalletBLL
  11. {
  12. public static DataTable SearchItemInfoList(string dsconn)
  13. {
  14. try
  15. {
  16. DataTable returndt = new DataTable();
  17. returndt.Columns.Add("箱号guid", typeof(string));
  18. returndt.Columns.Add("箱号", typeof(string));
  19. List<FormICSPalletModel> returndal = ICSPalletDAL.SearchItemInfoList(dsconn);
  20. foreach (FormICSPalletModel returntype in returndal)
  21. {
  22. DataRow dr = returndt.NewRow();
  23. dr["guid"] = returntype.ID;
  24. dr["箱号"] = returntype.PalletCode;
  25. //dr["规格型号"] = returntype.INVDESC;
  26. returndt.Rows.Add(dr);
  27. }
  28. return returndt;
  29. }
  30. catch (Exception ex)
  31. {
  32. throw ex;
  33. }
  34. }
  35. #region 关联批次
  36. public static void AddandEdit(DataTable dt,string PalletCode, string Appconstr)
  37. {
  38. try
  39. {
  40. ICSPalletDAL.AddandEdit(dt,PalletCode, Appconstr);
  41. }
  42. catch (Exception ex)
  43. {
  44. throw ex;
  45. }
  46. }
  47. #endregion
  48. #region 新增和修改
  49. public static void Add(FormICSPalletModel Info, string dsconn)
  50. {
  51. try
  52. {
  53. if (string.IsNullOrWhiteSpace(dsconn))
  54. {
  55. throw new Exception("数据库连接字符串错误");
  56. }
  57. List<FormICSPalletModel> InfoList = new List<FormICSPalletModel>() { Info };
  58. ICSPalletDAL.Add(InfoList, dsconn);
  59. }
  60. catch (Exception ex)
  61. {
  62. throw ex;
  63. }
  64. }
  65. #endregion
  66. #region 代码是否存在
  67. public static bool IsIncluding(string PalletCode, string dsconn)
  68. {
  69. try
  70. {
  71. return ICSPalletDAL.IsIncluding(PalletCode, dsconn);
  72. }
  73. catch (Exception ex)
  74. {
  75. throw ex;
  76. }
  77. }
  78. #endregion
  79. #region 根据存货编码查找id
  80. public static string SearchIDbyItemcode(string PalletCode, string dsconn)
  81. {
  82. try
  83. {
  84. return ICSPalletDAL.SearchIDbyItemcode(PalletCode, dsconn);
  85. }
  86. catch (Exception ex)
  87. {
  88. throw ex;
  89. }
  90. }
  91. #endregion
  92. #region 删除
  93. public static void deleteInfo(List<ICSPallet> item2routeList, string dsconn)
  94. {
  95. try
  96. {
  97. ICSPalletDAL.deleteInfo(item2routeList, dsconn);
  98. }
  99. catch (Exception ex)
  100. {
  101. throw ex;
  102. }
  103. }
  104. #endregion
  105. #region 分批
  106. public static void Fenpi(FormICSWareHouseLotInfoUIModel lotInfo, decimal number, string newlotno, string dsconn)
  107. {
  108. try
  109. {
  110. if (string.IsNullOrWhiteSpace(dsconn))
  111. {
  112. throw new Exception("数据库连接字符串错误");
  113. }
  114. List<FormICSWareHouseLotInfoUIModel> lotInfoList = new List<FormICSWareHouseLotInfoUIModel>() { lotInfo };
  115. ICSPalletDAL.Fenpi(lotInfoList, number, newlotno, dsconn);
  116. }
  117. catch (Exception ex)
  118. {
  119. throw ex;
  120. }
  121. }
  122. #endregion
  123. #region 合批
  124. public static void Hepi(List<FormICSWareHouseLotInfoUIModel> lotInfolist, string molot, string dsconn)
  125. {
  126. try
  127. {
  128. if (string.IsNullOrWhiteSpace(dsconn))
  129. {
  130. throw new Exception("数据库连接字符串错误");
  131. }
  132. ICSPalletDAL.Hepi(lotInfolist, molot, dsconn);
  133. }
  134. catch (Exception ex)
  135. {
  136. throw ex;
  137. }
  138. }
  139. #endregion
  140. #region 批次删除
  141. public static void Lotdelete(List<String> LOTList)
  142. {
  143. try
  144. {
  145. ICSPalletDAL.Lotdelete(LOTList);
  146. }
  147. catch (Exception ex)
  148. {
  149. throw ex;
  150. }
  151. }
  152. #endregion
  153. #region 更新
  154. public static void UpItemLotInfo(List<String> LOToList, string dsconn)
  155. {
  156. try
  157. {
  158. ICSPalletDAL.UpItemLotInfo(LOToList, dsconn);
  159. }
  160. catch (Exception ex)
  161. {
  162. throw ex;
  163. }
  164. }
  165. #endregion
  166. #region 查询
  167. public static ICSWareHouseLotInfo select(String guid, string Appconstr)
  168. {
  169. try
  170. {
  171. return ICSPalletDAL.select(guid, Appconstr);
  172. }
  173. catch (Exception ex)
  174. {
  175. throw ex;
  176. }
  177. }
  178. public static ICSWareHouseLotInfo Wereselect(String LotNO,String INVCode, String WHCode, String BinCode, string Appconstr)
  179. {
  180. try
  181. {
  182. return ICSPalletDAL.Wereselect(LotNO, INVCode, WHCode, BinCode, Appconstr);
  183. }
  184. catch (Exception ex)
  185. {
  186. throw ex;
  187. }
  188. }
  189. #endregion
  190. public static void updatalot(string ID, Decimal sum, string dsconn)
  191. {
  192. try
  193. {
  194. ICSPalletDAL.updatalot(ID, sum,dsconn);
  195. }
  196. catch (Exception ex)
  197. {
  198. throw ex;
  199. }
  200. }
  201. public static void updatawerelot(Decimal lsum, string invcode, string whcode, string bincode, string dsconn)
  202. {
  203. try
  204. {
  205. ICSPalletDAL.updatawerelot(lsum, invcode, whcode, bincode, dsconn);
  206. }
  207. catch (Exception ex)
  208. {
  209. throw ex;
  210. }
  211. }
  212. #region 日志
  213. public static void BLOGAdd(ICSWareHouseLotInfoLog Info, Decimal lsum, string edit,string dsconn)
  214. {
  215. try
  216. {
  217. if (string.IsNullOrWhiteSpace(dsconn))
  218. {
  219. throw new Exception("数据库连接字符串错误");
  220. }
  221. List<ICSWareHouseLotInfoLog> InfoList = new List<ICSWareHouseLotInfoLog>() { Info };
  222. ICSPalletDAL.BLOGAdd(InfoList, lsum, edit,dsconn);
  223. }
  224. catch (Exception ex)
  225. {
  226. throw ex;
  227. }
  228. }
  229. #endregion
  230. }
  231. }