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

106 lines
3.2 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 ICSINVReceiptDetailBLL
  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. returndt.Columns.Add("存货名称", typeof(string));
  20. returndt.Columns.Add("规格型号", typeof(string));
  21. List<FormICSINVENTORYUIModel> returndal = ICSINVReceiptDetailDAL.SearchItemInfoList(dsconn);
  22. foreach (FormICSINVENTORYUIModel returntype in returndal)
  23. {
  24. DataRow dr = returndt.NewRow();
  25. dr["guid"] = returntype.ID;
  26. dr["存货编码"] = returntype.INVCODE;
  27. dr["存货名称"] = returntype.INVNAME;
  28. dr["规格型号"] = returntype.INVDESC;
  29. returndt.Rows.Add(dr);
  30. }
  31. return returndt;
  32. }
  33. catch (Exception ex)
  34. {
  35. throw ex;
  36. }
  37. }
  38. #region 新增和修改
  39. public static void Add(FormICSINVReceiptDetailUIModel Info, string dsconn)
  40. {
  41. try
  42. {
  43. if (string.IsNullOrWhiteSpace(dsconn))
  44. {
  45. throw new Exception("数据库连接字符串错误");
  46. }
  47. List<FormICSINVReceiptDetailUIModel> InfoList = new List<FormICSINVReceiptDetailUIModel>() { Info };
  48. ICSINVReceiptDetailDAL.Add(InfoList, dsconn);
  49. }
  50. catch (Exception ex)
  51. {
  52. throw ex;
  53. }
  54. }
  55. #endregion
  56. #region 通过id查询
  57. public static FormICSINVReceiptDetailUIModel SearchInfoByID(string dID, string dsconn)
  58. {
  59. try
  60. {
  61. List<FormICSINVReceiptDetailUIModel> returnlist = ICSINVReceiptDetailDAL.SearchInfoByID(dID, dsconn);
  62. return returnlist[0];
  63. }
  64. catch (Exception ex)
  65. {
  66. throw ex;
  67. }
  68. }
  69. #endregion
  70. #region 删除
  71. public static void deleteInfo(List<string> detailIDList, string dsconn)
  72. {
  73. try
  74. {
  75. ICSINVReceiptDetailDAL.deleteInfo(detailIDList, dsconn);
  76. }
  77. catch (Exception ex)
  78. {
  79. throw ex;
  80. }
  81. }
  82. #endregion
  83. #region 产品明细代码是否存在
  84. public static bool IsIncluding(string Rid, int Rline,string workpoint, string dsconn)
  85. {
  86. try
  87. {
  88. return ICSINVReceiptDetailDAL.IsIncluding(Rid, Rline,workpoint, dsconn);
  89. }
  90. catch (Exception ex)
  91. {
  92. throw ex;
  93. }
  94. }
  95. #endregion
  96. }
  97. }