From eaebfc75ebda8ec68bd5fd693f9e9325e23efdec Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 06 十二月 2022 17:02:42 +0800
Subject: [PATCH] 金蝶同步 税率表 收款条件表 付款条件表 库存状态表

---
 DAL/生产管理/模具管理/ClsSc_MouldMaintainBill.cs |   86 ++++++++++++++++++++++++++++++++----------
 1 files changed, 65 insertions(+), 21 deletions(-)

diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
index 7759aee..c4a8d5e 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldMaintainBill.cs"
@@ -8,12 +8,13 @@
     public  class ClsSc_MouldMaintainBill:DBUtility.ClsXt_BaseBill
     {
         public Model.ClsSc_MouldMaintainBillMain omodel = new Model.ClsSc_MouldMaintainBillMain();
+        public List<Model.ClsSc_MouldMaintainRuleBillSub_Item> DetailCol = new List<Model.ClsSc_MouldMaintainRuleBillSub_Item>();
         public List<Model.ClsSc_MouldMaintainBillSub> DetailColl = new List<Model.ClsSc_MouldMaintainBillSub>();
 
         public ClsSc_MouldMaintainBill()
         {
-            base.MvarItemKeySub = "Sc_MouldMaintainBillSub";
-            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub = "Sc_MouldMaintainBillSub_Item";
+            base.MvarItemKeySub2 = "Sc_MouldMaintainBillSub";
             base.MvarItemKeySub3 = "";
             base.MvarItemKeySub4 = "";
             base.MvarItemKey="Sc_MouldMaintainBillMain";
@@ -56,7 +57,7 @@
                 ",HEndDate='" + omodel.HEndDate + "'" +
                 ",HExplanation='" + omodel.HExplanation + "'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
-
+                ",HMouldMaintainRuleInterID="+omodel.HMouldMaintainRuleInterID.ToString()+
                 //",HDeptID=" + omodel.HDeptID.ToString() +
                 //",HDeptNumber='" + omodel.HDeptNumber +"'"+
                 //",HEmpID=" + omodel.HEmpID.ToString() +
@@ -70,10 +71,29 @@
                 DeleteRelation(ref sReturn, lngBillKey);
                 //鍒犻櫎瀛愯〃
                 DeleteBillSub(lngBillKey);
-                //鎻掑叆瀛愯〃
+                DeleteBillSub2(lngBillKey);
                 omodel.HInterID = lngBillKey;
+                //鎻掑叆淇濆吇椤瑰瓙琛�
+                foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item Item in DetailCol)
+                {
+                    oCn.RunProc("Insert into Sc_MouldMaintainBillSub_Item" +
+                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
+                          ",HMaintainPart,HClaim" +
+                          ",HManagerID" +
+                          ",HCloseMan,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ") values("
+                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.ToString() + "'" +
+                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
+                          "," + Item.HManagerID.ToString() +
+                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
+                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString() +
+                          ") ");
+                }
+                //鎻掑叆閰嶄欢椤瑰瓙琛�
                 foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
                 {
+                    
                     oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
                       " (HInterID,HEntryID,HMaterID" +
                       ",HQty,HUnitID" +
@@ -126,30 +146,54 @@
                 ",HYear,HPeriod,HRemark" +
                 ",HPlanNo,HPlanInterID,HMouldID,HBeginDate"+
                 ",HEndDate"+
-                ",HInnerBillNo,HExplanation" +
+                ",HInnerBillNo,HExplanation,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                 ",'" + omodel.HPlanNo + "'," + omodel.HPlanInterID.ToString() + "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" +
                 ",'" + omodel.HEndDate + "'"+
-                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" +
+                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," +omodel.HMouldMaintainRuleInterID.ToString()+
                 ") ");
-                //鎻掑叆瀛愯〃
-                foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
+
+                if (DetailCol.Count > 0)
                 {
-                    oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
-                      " (HInterID,HEntryID,HMaterID" +
-                      ",HQty,HUnitID" +
-                      ",HQtyMust,HManagerID" +
-                      ",HCloseMan,HCloseType,HRemark" +
-                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                      ") values("
-                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
-                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() +
-                      "," + oSub.HQtyMust.ToString() + "," + oSub.HManagerID.ToString() +
-                      ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                      ") ");
+                    //鎻掑叆淇濆吇椤瑰瓙琛�
+                    foreach (Model.ClsSc_MouldMaintainRuleBillSub_Item Item in DetailCol)
+                    {
+                        oCn.RunProc("Insert into Sc_MouldMaintainBillSub_Item" +
+                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
+                          ",HMaintainPart,HClaim" +
+                          ",HManagerID" +
+                          ",HCloseMan,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ") values("
+                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.ToString() + "'" +
+                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
+                          "," + Item.HManagerID.ToString() +
+                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
+                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString() +
+                          ") ");
+                    }
+                }
+                if (DetailColl.Count > 0)
+                {
+                    //鎻掑叆閰嶄欢椤瑰瓙琛�
+                    foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)
+                    {
+                        oCn.RunProc("Insert into Sc_MouldMaintainBillSub " +
+                          " (HInterID,HEntryID,HMaterID" +
+                          ",HQty,HUnitID" +
+                          ",HQtyMust,HManagerID" +
+                          ",HCloseMan,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ") values("
+                          + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
+                          "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() +
+                          "," + oSub.HQtyMust.ToString() + "," + oSub.HManagerID.ToString() +
+                          ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+                          "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                          ") ");
+                    }
                 }
                 //
                 //foreach (Model.ClsSc_MouldMaintainBillSub oSub in DetailColl)

--
Gitblit v1.9.1