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

316 lines
8.5 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using ICSSoft.Frame.Data.Entity;
  7. using ICSSoft.Frame.Data.DAL;
  8. namespace ICSSoft.Frame.Data.BLL
  9. {
  10. public class ICSSOPriceSheetBLL
  11. {
  12. public static DataTable SearchStorageInfoList(string dsconn)
  13. {
  14. try
  15. {
  16. DataTable returndt = new DataTable();
  17. returndt.Columns.Add("Serial", typeof(string));
  18. returndt.Columns.Add("库别代码", typeof(string));
  19. returndt.Columns.Add("库别名称", typeof(string));
  20. List<FormICSStorageUIModel> returndal = ICSSOPriceSheetDAL.SearchStorageInfoList(dsconn);
  21. foreach (FormICSStorageUIModel returns in returndal)
  22. {
  23. DataRow dr = returndt.NewRow();
  24. dr["Serial"] = returns.Serial;
  25. dr["库别代码"] = returns.StorageCode;
  26. dr["库别名称"] = returns.StorageName;
  27. returndt.Rows.Add(dr);
  28. }
  29. return returndt;
  30. }
  31. catch (Exception ex)
  32. {
  33. throw ex;
  34. }
  35. }
  36. public static DataTable SearchVendorInfoList(string dsconn)
  37. {
  38. try
  39. {
  40. DataTable returndt = new DataTable();
  41. returndt.Columns.Add("ID", typeof(string));
  42. returndt.Columns.Add("厂商代码", typeof(string));
  43. returndt.Columns.Add("厂商名称", typeof(string));
  44. List<FormICSVendorUIModel> returndal = ICSSOPriceSheetDAL.SearchVendorInfoList(dsconn);
  45. foreach (FormICSVendorUIModel returnv in returndal)
  46. {
  47. DataRow dr = returndt.NewRow();
  48. dr["ID"] = returnv.ID;
  49. dr["厂商代码"] = returnv.VendorCode;
  50. dr["厂商名称"] = returnv.VendorName;
  51. returndt.Rows.Add(dr);
  52. }
  53. return returndt;
  54. }
  55. catch (Exception ex)
  56. {
  57. throw ex;
  58. }
  59. }
  60. #region 新增和修改
  61. public static void Add(List<XS001_0001_E001_2020> SoMainList, List<XS001_0001_E002_2020> SoDetailLIist, string dsconn)
  62. {
  63. try
  64. {
  65. if (string.IsNullOrWhiteSpace(dsconn))
  66. {
  67. throw new Exception("数据库连接字符串错误");
  68. }
  69. ICSSOPriceSheetDAL.Add(SoMainList,SoDetailLIist, dsconn);
  70. }
  71. catch (Exception ex)
  72. {
  73. throw ex;
  74. }
  75. }
  76. /// <summary>
  77. /// 新增入库单明细
  78. /// </summary>
  79. /// <param name="Picking"></param>
  80. /// <param name="dsconn"></param>
  81. /// <returns></returns>
  82. public static string AddAndEditDetail(FormICSPickingModel Picking, string dsconn)
  83. {
  84. try
  85. {
  86. if (string.IsNullOrWhiteSpace(dsconn))
  87. {
  88. throw new Exception("数据库连接字符串错误");
  89. }
  90. return ICSSOPriceSheetDAL.AddAndEditDetail(Picking, dsconn);
  91. }
  92. catch (Exception ex)
  93. {
  94. throw ex;
  95. }
  96. }
  97. public static string GetOutInNo(string dsconn)
  98. {
  99. try
  100. {
  101. if (string.IsNullOrWhiteSpace(dsconn))
  102. {
  103. throw new Exception("数据库连接字符串错误");
  104. }
  105. return ICSSOPriceSheetDAL.GetOutInNo(dsconn);
  106. }
  107. catch (Exception ex)
  108. {
  109. throw ex;
  110. }
  111. }
  112. public static string GetPickingRowNo(string pickingId, string dsconn)
  113. {
  114. try
  115. {
  116. if (string.IsNullOrWhiteSpace(dsconn))
  117. {
  118. throw new Exception("数据库连接字符串错误");
  119. }
  120. return ICSSOPriceSheetDAL.GetPickingRowNo(pickingId, dsconn);
  121. }
  122. catch (Exception ex)
  123. {
  124. throw ex;
  125. }
  126. }
  127. #endregion
  128. #region 通过入库guid查询
  129. public static FormICSPickingModel SearchInfoByID(string Rguid, string dsconn)
  130. {
  131. try
  132. {
  133. List<FormICSPickingModel> returnlist = ICSSOPriceSheetDAL.SearchInfoByID(Rguid, dsconn);
  134. return returnlist[0];
  135. }
  136. catch (Exception ex)
  137. {
  138. throw ex;
  139. }
  140. }
  141. #endregion
  142. #region 删除
  143. public static void deleteInfo(string code, string dsconn)
  144. {
  145. try
  146. {
  147. ICSSOPriceSheetDAL.deleteInfo(code, dsconn);
  148. }
  149. catch (Exception ex)
  150. {
  151. throw ex;
  152. }
  153. }
  154. public static void deleteDetailInfo(string code,string row, string dsconn)
  155. {
  156. try
  157. {
  158. ICSSOPriceSheetDAL.deleteDetailInfo(code,row, dsconn);
  159. }
  160. catch (Exception ex)
  161. {
  162. throw ex;
  163. }
  164. }
  165. #endregion
  166. #region 入库代码是否存在
  167. public static bool IsIncluding(string noCODE, string workpoint, string dsconn)
  168. {
  169. try
  170. {
  171. return ICSSOPriceSheetDAL.IsIncluding(noCODE, workpoint, dsconn);
  172. }
  173. catch (Exception ex)
  174. {
  175. throw ex;
  176. }
  177. }
  178. #endregion
  179. public static bool IsIncludingDetail(List<string> RIDList, string dsconn)
  180. {
  181. try
  182. {
  183. return ICSSOPriceSheetDAL.IsIncludingDetail(RIDList, dsconn);
  184. }
  185. catch (Exception ex)
  186. {
  187. throw ex;
  188. }
  189. }
  190. #region 子件资料信息
  191. public static DataTable GetDetail(string Sql)
  192. {
  193. try
  194. {
  195. return ICSSOPriceSheetDAL.GetDetail(Sql);
  196. }
  197. catch (Exception ex)
  198. {
  199. throw ex;
  200. }
  201. }
  202. public static DataTable GetDetailList(string VouchCode,string dsconn)
  203. {
  204. try
  205. {
  206. if (string.IsNullOrWhiteSpace(dsconn))
  207. {
  208. throw new Exception("数据库连接字符串错误");
  209. }
  210. return ICSSOPriceSheetDAL.GetDetailList(VouchCode, dsconn);
  211. }
  212. catch (Exception ex)
  213. {
  214. throw ex;
  215. }
  216. }
  217. public static DataTable GetDetailInfo(string code, string row, string dsconn)
  218. {
  219. try
  220. {
  221. if (string.IsNullOrWhiteSpace(dsconn))
  222. {
  223. throw new Exception("数据库连接字符串错误");
  224. }
  225. return ICSSOPriceSheetDAL.GetDetailInfo(code, row, dsconn);
  226. }
  227. catch (Exception ex)
  228. {
  229. throw ex;
  230. }
  231. }
  232. #endregion
  233. #region 部门审核
  234. public static void Check(string id, string dsconn)
  235. {
  236. try
  237. {
  238. ICSSOPriceSheetDAL.Check(id, dsconn);
  239. }
  240. catch (Exception ex)
  241. {
  242. throw ex;
  243. }
  244. }
  245. #endregion
  246. #region 弃审
  247. public static void DiscardedTrialCheck(string id, string dsconn)
  248. {
  249. try
  250. {
  251. ICSSOPriceSheetDAL.DiscardedTrialCheck(id, dsconn);
  252. }
  253. catch (Exception ex)
  254. {
  255. throw ex;
  256. }
  257. }
  258. #endregion
  259. #region 弃审
  260. public static void RefuseCheck(string id, string dsconn)
  261. {
  262. try
  263. {
  264. ICSSOPriceSheetDAL.RefuseCheck(id, dsconn);
  265. }
  266. catch (Exception ex)
  267. {
  268. throw ex;
  269. }
  270. }
  271. #endregion
  272. #region 通过ID查询
  273. public static DataTable searchInfoByID(string ID, string dsconn)
  274. {
  275. try
  276. {
  277. return ICSSOPriceSheetDAL.searchInfoByID(ID, dsconn);
  278. }
  279. catch (Exception ex)
  280. {
  281. throw ex;
  282. }
  283. }
  284. #endregion
  285. }
  286. }