From ce0366bb8db4f9665e715b8647df6eb15fa07f68 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期四, 25 一月 2024 14:07:06 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DBUtility/基础资料/ClsGy_Base_Ctl.cs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git "a/DBUtility/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Base_Ctl.cs" "b/DBUtility/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Base_Ctl.cs"
index f5a0166..2f41816 100644
--- "a/DBUtility/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Base_Ctl.cs"
+++ "b/DBUtility/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Base_Ctl.cs"
@@ -362,6 +362,14 @@
                         sReturn = "鍗曟嵁宸茬鐢紝涓嶅厑璁搁噸澶嶇鐢紒";
                         return false;
                     }
+
+                    DataSet DsHavChildCodes = oCn.RunProcReturn("select HItemID from " + MvarItemKey + " where HStopflag=0 and HParentID='" + HItemID + "'", MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
+                    if (DsHavChildCodes.Tables[0].Rows.Count > 0)
+                    {
+                        sReturn = "鎵�閫夊崟鎹瓨鍦ㄦ湭绂佺敤鐨勫瓙椤圭洰,涓嶅厑璁哥鐢紒";
+                        return false;
+                    }
+
                     //绂佺敤
                     oCn.BeginTran();
                     oCn.RunProc("Update " + MvarItemKey + " set HStopflag=1,HStopEmp = '" + HMaker + "',HStopTime=getdate() where HItemID=" + HItemID, ref Pub_Class.ClsPub.sExeReturnInfo);
@@ -403,6 +411,14 @@
                         sReturn = "鍗曟嵁鏈鐢紝涓嶅厑璁稿弽绂佺敤锛�";
                         return false;
                     }
+
+                    DataSet DsHavChildCodes = oCn.RunProcReturn("select HItemID from " + MvarItemKey + " where HStopflag=1 and HItemID='" + DS.Tables[0].Rows[0]["HParentID"].ToString() + "'", MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
+                    if (DsHavChildCodes.Tables[0].Rows.Count > 0)
+                    {
+                        sReturn = "鎵�閫夊崟鎹笂绾ч」鐩凡绂佺敤,涓嶅厑璁稿弽绂佺敤锛�";
+                        return false;
+                    }
+
                     //绂佺敤
                     oCn.BeginTran();
                     oCn.RunProc("Update " + MvarItemKey + " set HStopflag=0,HStopEmp = '',HStopTime=null where HItemID=" + HItemID, ref Pub_Class.ClsPub.sExeReturnInfo);

--
Gitblit v1.9.1