From 1aef885a3aa69ddeaceb9260ab3cca86cbbbc23d Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期六, 05 十月 2024 18:45:13 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 DBUtility/基础资料/ClsGy_Base_Ctl.cs |  284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 283 insertions(+), 1 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 a58b22a..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"
@@ -128,6 +128,105 @@
             }
         }
 
+        //鍏抽棴
+        public bool CloseByID(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                string HCloseEmp = ClsPub.CurUserName;
+                oCn.RunProc("Update " + MvarItemKey + "   set HCloseEmp = '" + HCloseEmp + "',HCloseDate=getdate()  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅叧闂�
+        public bool DeCloseByID(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                oCn.RunProc("Update " + MvarItemKey + "   set HCloseEmp = '', HCloseDate=null  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //瀹℃牳2 HCheckTime
+        public bool AuditByID2(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                string HCheckEmp = ClsPub.CurUserName;
+                oCn.RunProc("Update " + MvarItemKey + "   set HCheckEmp = '" + HCheckEmp + "',HCheckTime=getdate()  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅鏍�2 HCheckTime
+        public bool DeAuditByID2(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                oCn.RunProc("Update " + MvarItemKey + "   set HCheckEmp = '', HCheckTime=null  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍏抽棴2 HCloseTime
+        public bool CloseByID2(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                string HCloseEmp = ClsPub.CurUserName;
+                oCn.RunProc("Update " + MvarItemKey + "   set HCloseEmp = '" + HCloseEmp + "',HCloseTime=getdate()  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅叧闂�2 HCloseTime
+        public bool DeCloseByID2(Int64 sItemID, ref string sReturn)
+        {
+            try
+            {
+                oCn.RunProc("Update " + MvarItemKey + "   set HCloseEmp = '', HCloseTime=null  where HItemID='" + sItemID + "'", ref Pub_Class.ClsPub.sExeReturnInfo);
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
         //鍒犻櫎
         public bool DeleteByID(Int64 sItemID)
         {
@@ -155,7 +254,190 @@
             {
                 throw (e);
             }
-        } 
+        }
+
+
+        /// <summary>
+        /// 瀹℃牳
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        public bool CheckByHItemID(Int64 HItemID, string HMaker, ref string sReturn)
+        {
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("select * from " + MvarItemKey + " where HItemID='" + HItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鏈煡璇㈠埌浠讳綍鏁版嵁锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+                    return false;
+                }
+                else
+                {
+                    if (DS.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+                    {
+                        sReturn = "鍗曟嵁宸插鏍革紝涓嶅厑璁搁噸澶嶅鏍革紒";
+                        return false;
+                    }
+                    //瀹℃牳
+                    oCn.BeginTran();
+                    oCn.RunProc("Update " + MvarItemKey + " set HCheckEmp = '" + HMaker + "',HCheckTime=getdate() where HItemID=" + HItemID, ref Pub_Class.ClsPub.sExeReturnInfo);
+                    //鍐欏叆鏃ュ織
+                    DBUtility.ClsPub.Add_Log("", MvarReportTitle+ "瀹℃牳锛屼唬鐮侊細" + DS.Tables[0].Rows[0]["HNumber"].ToString() + ",鍚嶇О锛�" + DS.Tables[0].Rows[0]["HName"].ToString(), HMaker);
+                    sReturn = "";
+                    oCn.Commit();
+                    return true;
+                }
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        /// <summary>
+        /// 鍙嶅鏍�
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        public bool AbandonCheckByHItemID(Int64 HItemID, string HMaker, ref string sReturn)
+        {
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("select * from " + MvarItemKey + " where HItemID='" + HItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鏈煡璇㈠埌浠讳綍鏁版嵁锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+                    return false;
+                }
+                else
+                {
+                    if (DS.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+                    {
+                        sReturn = "鍗曟嵁鏈鏍革紝涓嶅厑璁稿弽瀹℃牳锛�";
+                        return false;
+                    }
+                    //鍙嶅鏍�
+                    oCn.BeginTran();
+                    oCn.RunProc("Update " + MvarItemKey + " set HCheckEmp = '',HCheckTime=null where HItemID=" + HItemID, ref Pub_Class.ClsPub.sExeReturnInfo);
+                    //鍐欏叆鏃ュ織
+                    DBUtility.ClsPub.Add_Log("", MvarReportTitle + "鍙嶅鏍革紝浠g爜锛�" + DS.Tables[0].Rows[0]["HNumber"].ToString() + ",鍚嶇О锛�" + DS.Tables[0].Rows[0]["HName"].ToString(), HMaker);
+                    sReturn = "";
+                    oCn.Commit();
+                    return true;
+                }
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        /// <summary>
+        /// 绂佺敤
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        public bool StopByHItemID(Int64 HItemID, string HMaker, ref string sReturn)
+        {
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("select * from " + MvarItemKey + " where HItemID='" + HItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鏈煡璇㈠埌浠讳綍鏁版嵁锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+                    return false;
+                }
+                else
+                {
+                    if (DS.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                    {
+                        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);
+                    //鍐欏叆鏃ュ織
+                    DBUtility.ClsPub.Add_Log("", MvarReportTitle + "绂佺敤锛屼唬鐮侊細" + DS.Tables[0].Rows[0]["HNumber"].ToString() + ",鍚嶇О锛�" + DS.Tables[0].Rows[0]["HName"].ToString(), HMaker);
+                    sReturn = "";
+                    oCn.Commit();
+                    return true;
+                }
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        /// <summary>
+        /// 鍙嶇鐢�
+        /// </summary>
+        /// <param name="HItemID">鍐呯爜</param>
+        /// <param name="HMaker">鎿嶄綔浜�</param>
+        /// <returns></returns>
+        public bool AbandonStopByHItemID(Int64 HItemID, string HMaker, ref string sReturn)
+        {
+            try
+            {
+                DataSet DS = oCn.RunProcReturn("select * from " + MvarItemKey + " where HItemID='" + HItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鏈煡璇㈠埌浠讳綍鏁版嵁锛岃鍒锋柊鏁版嵁鍚庨噸鏂伴�夋嫨锛�";
+                    return false;
+                }
+                else
+                {
+                    if (DS.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+                    {
+                        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);
+                    //鍐欏叆鏃ュ織
+                    DBUtility.ClsPub.Add_Log("", MvarReportTitle + "鍙嶇鐢紝浠g爜锛�" + DS.Tables[0].Rows[0]["HNumber"].ToString() + ",鍚嶇О锛�" + DS.Tables[0].Rows[0]["HName"].ToString(), HMaker);
+                    sReturn = "";
+                    oCn.Commit();
+                    return true;
+                }
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+
         #endregion
     }
 }

--
Gitblit v1.9.1