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

160 lines
4.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 ICSINVReceiptBLL
  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 = ICSINVReceiptDAL.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 = ICSINVReceiptDAL.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(FormICSINVReceiptUIModel Info, string dsconn)
  62. {
  63. try
  64. {
  65. if (string.IsNullOrWhiteSpace(dsconn))
  66. {
  67. throw new Exception("数据库连接字符串错误");
  68. }
  69. List<FormICSINVReceiptUIModel> InfoList = new List<FormICSINVReceiptUIModel>() { Info };
  70. ICSINVReceiptDAL.Add(InfoList, dsconn);
  71. }
  72. catch (Exception ex)
  73. {
  74. throw ex;
  75. }
  76. }
  77. #endregion
  78. #region 通过入库guid查询
  79. public static FormICSINVReceiptUIModel SearchInfoByID(string Rguid, string dsconn)
  80. {
  81. try
  82. {
  83. List<FormICSINVReceiptUIModel> returnlist = ICSINVReceiptDAL.SearchInfoByID(Rguid, dsconn);
  84. return returnlist[0];
  85. }
  86. catch (Exception ex)
  87. {
  88. throw ex;
  89. }
  90. }
  91. #endregion
  92. #region 删除
  93. public static void deleteInfo(List<string> RIDList, string dsconn)
  94. {
  95. try
  96. {
  97. ICSINVReceiptDAL.deleteInfo(RIDList, dsconn);
  98. }
  99. catch (Exception ex)
  100. {
  101. throw ex;
  102. }
  103. }
  104. #endregion
  105. #region 入库代码是否存在
  106. public static bool IsIncluding(string noCODE,string workpoint, string dsconn)
  107. {
  108. try
  109. {
  110. return ICSINVReceiptDAL.IsIncluding(noCODE,workpoint, dsconn);
  111. }
  112. catch (Exception ex)
  113. {
  114. throw ex;
  115. }
  116. }
  117. #endregion
  118. public static bool IsIncludingDetail(List<string> RIDList, string dsconn)
  119. {
  120. try
  121. {
  122. return ICSINVReceiptDAL.IsIncludingDetail(RIDList, dsconn);
  123. }
  124. catch (Exception ex)
  125. {
  126. throw ex;
  127. }
  128. }
  129. #region 子件资料信息
  130. public static DataTable GetDetail(string Sql)
  131. {
  132. try
  133. {
  134. return ICSINVReceiptDAL.GetDetail(Sql);
  135. }
  136. catch (Exception ex)
  137. {
  138. throw ex;
  139. }
  140. }
  141. #endregion
  142. }
  143. }