From 3b5467766eb37ebca6caab3af207e0ed276d4cef Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期四, 26 二月 2026 08:46:53 +0800
Subject: [PATCH] 1

---
 WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
index 266bf41..6fa4673 100644
--- a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
@@ -207,9 +207,10 @@
                  omodel.HMainSourceBillType+"',"+ omodel.HMainSourceInterID.ToString()+","+ omodel.HMainSourceEntryID.ToString() +
                 ",'"+ omodel.HRepairCategory + "','" + omodel.HUrgenLevel + "','" + omodel.HRepairer + "','" + omodel.HIsCapacityImpact + "') ");
                 //鎻掑叆瀛愯〃
-
+                
                 foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl)
                 {
+                    
                     string sql1 = string.Format(@"Insert into Sb_EquipRepairWorkBillSub " +
                        " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
@@ -217,9 +218,8 @@
                        ") values("
                        + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                        "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                      "," + oSub.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
+                      "," + oSub.HRepairID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
                        ")");
-
                     //oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " +
                     //   " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                     //   ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
@@ -230,14 +230,15 @@
                     //  "," + oSub.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
                     //   ") ");
                     oCn.RunProc(sql1);
+
                 }
-                
-                
-                
+
+
+
                 foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater)
                 {
-
-                    oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " +
+                
+                    string sql = String.Format(@"Insert into Sb_EquipRepairWorkBillSub_Mater " +
                       " (HInterID,HEntryID," +
                       "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
@@ -248,8 +249,12 @@
                       "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                       "," + oSub.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
                       "," + oSub.HManagerID.ToString() + ")");
-                }
+                    oCn.RunProc(sql);
+                 
                 
+                
+                }
+
                 //
                 //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl)
                 //{
@@ -265,7 +270,7 @@
                 //
 
                 //=========================淇濆瓨鍚庢帶鍒�  
-                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + $"',{omodel.HMainSourceBillType}", "h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl");
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + $"',1", "h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl");
                 if (ds2 == null)
                 {
                     sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";

--
Gitblit v1.9.1