From 09cabedaff68030a639a53b99c3869ffbaa195e6 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 23 八月 2024 10:36:22 +0800
Subject: [PATCH] 关联数量相关

---
 DAL/应付管理/ClsYF_PayMentBill.cs |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git "a/DAL/\345\272\224\344\273\230\347\256\241\347\220\206/ClsYF_PayMentBill.cs" "b/DAL/\345\272\224\344\273\230\347\256\241\347\220\206/ClsYF_PayMentBill.cs"
index 39ea7a2..c13f622 100644
--- "a/DAL/\345\272\224\344\273\230\347\256\241\347\220\206/ClsYF_PayMentBill.cs"
+++ "b/DAL/\345\272\224\344\273\230\347\256\241\347\220\206/ClsYF_PayMentBill.cs"
@@ -31,8 +31,48 @@
         {
             DetailColl = null;
         }
-       
+
         #endregion   鑷畾涔夋柟娉�
+
+        //鍒犻櫎鍏宠仈
+        public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
+        {
+            //搴旀敹鍗� 鍏宠仈鏁伴噺
+            try
+            {
+                if (DetailColl[0].HSourceBillType == "1114")                    //搴斾粯鍗�
+                {
+                    oCn.RunProc("exec h_p_Cg_UpDateRelation_PayableToPayMent_Del " + lngBillKey.ToString());
+                }
+                else
+                {
+                }
+            }
+            catch (Exception e)
+            {
+                throw (e);
+            }
+        }
+        //鏂板鍏宠仈
+        public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
+        {
+            //搴旀敹鍗� 鍏宠仈鏁伴噺
+            try
+            {
+                if (DetailColl[0].HSourceBillType == "1114")                    //搴斾粯鍗�
+                {
+                    oCn.RunProc("exec h_p_Cg_UpDateRelation_PayableToPayMent_Add " + lngBillKey.ToString());
+                }
+                else
+                {
+
+                }
+            }
+            catch (Exception e)
+            {
+                throw (e);
+            }
+        }
         //淇敼鍗曟嵁
         public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
         {
@@ -82,8 +122,11 @@
                 ",HMainSourceBillNo='" + omodel.HMainSourceBillNo.ToString() +
                 "',HMainSourceBillType='" + omodel.HMainSourceBillType.ToString() +
                 "' where HInterID=" + lngBillKey.ToString());
-                //鍒犻櫎鍏宠仈
-                DeleteRelation(ref sReturn, lngBillKey);
+                if (DetailColl.Count != 0)
+                {
+                    //鍒犻櫎鍏宠仈
+                    DeleteRelation(ref sReturn, lngBillKey);
+                }
                 //鍒犻櫎瀛愯〃
                 DeleteBillSub(lngBillKey);
                 //鎻掑叆瀛愯〃
@@ -120,6 +163,11 @@
                 //        return false;
                 //    }
                 //}
+                if (DetailColl.Count != 0)
+                {
+                    //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+                    AddNewRelation(ref sReturn, omodel.HInterID);
+                }
                 sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
@@ -178,6 +226,11 @@
                       "," + oSub.HPOContractInterID.ToString() + "," + oSub.HPOContractEntryID.ToString() + ",'" + oSub.HPOContractBillNo + "'," + oSub.HSeContractInterID.ToString() + "," + oSub.HSeContractEntryID.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       ") ");
                 }
+                if (DetailColl.Count != 0)
+                {
+                    //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+                    AddNewRelation(ref sReturn, omodel.HInterID);
+                }
                 //
                 //foreach (Model.ClsYF_PayMentBillSub oSub in DetailColl)
                 //{

--
Gitblit v1.9.1