From ddf9b07946b294ab02b326bd46c0834ec5b4e8ba Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期日, 18 二月 2024 08:30:13 +0800
Subject: [PATCH] 设备保养记录单, 设备点检记录单,设备故障登记单,设备维修记录单,首件检验单, 巡检单,工序检验单,发货通知单,退货通知单   增加 调用 删除前控制 和删除后控制

---
 WebAPI/DLL/ClsSc_MESBeginWorkBill.cs |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
index 565ed59..1b7e945 100644
--- a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
+++ b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -419,7 +419,7 @@
         }
 
         //鍒犻櫎鍗曟嵁
-        public override bool DeleteBill(Int64 lngBillKey, ref string sReturn) 
+        public  bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) 
         {
             try
             {
@@ -445,6 +445,24 @@
                 //鍒犻櫎涓昏〃
                 oCn.RunProc("Delete From " + MvarItemKey + "  where HInterID=" + lngBillKey.ToString());
 
+                //鍒犻櫎鍚庢帶鍒�==================================================================================      
+                string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'";
+                ds = oCn.RunProcReturn(sql2, procName);
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+
+                    sReturn = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    sReturn = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
+                    oCn.RollBack();
+                    return false;
+                }
+                //==============================================================================================
+
                 sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;

--
Gitblit v1.9.1