From 0a34481ece298f7dbefd4f51c4bf8fc785d0c716 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 29 一月 2024 13:59:15 +0800
Subject: [PATCH] 收款单、应收退款单:编辑保存增加保存前/保存后控制

---
 DAL/应收管理/ClsYS_ReceiveBill.cs     |   33 ++++++++++++++++
 DAL/应收管理/ClsYS_ReceiveBackBill.cs |   32 ++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)

diff --git "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBackBill.cs" "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBackBill.cs"
index 769b15d..28acb8e 100644
--- "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBackBill.cs"
+++ "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBackBill.cs"
@@ -38,6 +38,21 @@
         {
             try
             {
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_YS_ReceiveBackBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_YS_ReceiveBackBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //
                 oCn.BeginTran();
                 //鏇存柊涓昏〃
@@ -104,6 +119,23 @@
                       "," + oSub.HPOContractInterID.ToString() + "," + oSub.HPOContractEntryID.ToString() + ",'" + oSub.HPOContractBillNo + "'," + oSub.HSeContractInterID.ToString() + "," + oSub.HSeContractEntryID.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       ") ");
                 }
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("h_p_YS_ReceiveBackBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_YS_ReceiveBackBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 //
                 //foreach (Model.ClsYS_ReceiveBackBillSub oSub in DetailColl)
                 //{
diff --git "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs" "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
index 8dc9d9f..0b35be6 100644
--- "a/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
+++ "b/DAL/\345\272\224\346\224\266\347\256\241\347\220\206/ClsYS_ReceiveBill.cs"
@@ -38,6 +38,21 @@
         {
             try
             {
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_YS_ReceiveBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_YS_ReceiveBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //
                 oCn.BeginTran();
                 //鏇存柊涓昏〃
@@ -105,6 +120,24 @@
                       "," + oSub.HPOContractInterID.ToString() + "," + oSub.HPOContractEntryID.ToString() + ",'" + oSub.HPOContractBillNo + "'," + oSub.HSeContractInterID.ToString() + "," + oSub.HSeContractEntryID.ToString() + ",'" + oSub.HSeContractBillNo + "'" +
                       ") ");
                 }
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("h_p_YS_ReceiveBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_YS_ReceiveBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
+
                 //
                 //foreach (Model.ClsYS_ReceiveBillSub oSub in DetailColl)
                 //{

--
Gitblit v1.9.1