From c30182c414fc64d770fb6128e0cf9c91cdcf8ad4 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 13 五月 2024 16:20:40 +0800
Subject: [PATCH] 菜单栏排序

---
 DBUtility/业务单据/ClsXt_BaseBill.cs |  140 ++++++++++++++++++++++++++++------------------
 1 files changed, 85 insertions(+), 55 deletions(-)

diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
index 13fee4b..39bffd9 100644
--- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
+++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
@@ -120,15 +120,15 @@
                 DataSet ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
                 if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
                 else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
                 else
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
 
                 sReturn = "";
@@ -149,15 +149,15 @@
                 DataSet ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
                 if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=4,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
                 else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=2,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
                 else
                 {
-                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
                 }
 
                 //鍐欏叆鏃ュ織
@@ -169,6 +169,43 @@
 
                 sReturn = "鍙嶅叧闂崟鎹垚鍔燂紒";
                 oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+        //琛屽弽鍏抽棴鍗曟嵁(鍖呭惈鍐欏叆鏃ュ織)    2024-01-31
+        public bool CancelRow(Int64 lngBillKey,Int64 HEntryID, string HBillNo, string sUser, ref string sReturn)
+        {
+            try
+            {
+                //oCn.BeginTran();
+                string sql = "select * from " + MvarItemKeySub + " where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+                DataSet ds = oCn.RunProcReturn(sql, MvarItemKeySub);
+                if(ds==null || ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "琛岃褰曚笉瀛樺湪锛�";
+                    return false;
+                }
+                else
+                {
+                    sql = " Update " + MvarItemKeySub + " set HCloseMan='',HEntryCloseDate='',HCloseType=0 Where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+                    oCn.RunProc(sql);
+                }
+
+                //鍐欏叆鏃ュ織
+                string WorkList = "琛屽弽鍏抽棴锛屽崟鎹彿锛�" + HBillNo + "锛涘瓙琛ㄥ唴鐮侊細" + HEntryID;
+                string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                    "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','琛屽弽鍏抽棴')"
+                    );
+
+                sReturn = "琛屽弽鍏抽棴鎴愬姛锛�";
+                //oCn.Commit();
                 return true;
             }
             catch (Exception e)
@@ -367,7 +404,7 @@
             {
                 string HCloseMan = ClsPub.CurUserName;
                 string HCloseDate = ClsPub.GetServerDate(-1); 
-                oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+                oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3,HCloseType = 1 Where HInterID=" + lngBillKey.ToString());
                 sReturn = "";
                 return true;
             }
@@ -385,7 +422,7 @@
                 oCn.BeginTran();
                 string HCloseMan = sUser;
                 string HCloseDate = ClsPub.GetServerDate(-1);
-                oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+                oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3,HCloseType = 1 Where HInterID=" + lngBillKey.ToString());
                 
                 //鍐欏叆鏃ュ織
                 string WorkList = "鍏抽棴鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
@@ -395,6 +432,46 @@
                     );
 
                 sReturn = "鍏抽棴鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+        //琛屽叧闂崟鎹�(鍖呭惈鍐欏叆鏃ュ織)    2024-01-31
+        public bool CloseRow(Int64 lngBillKey,Int64 HEntryID, string HBillNo, string sUser, ref string sReturn)
+        {
+            DataSet ds;
+            try
+            {
+                oCn.BeginTran();
+                string HCloseMan = sUser;
+                string HEntryCloseDate = ClsPub.GetServerDate(-1);
+                //鍙樻洿琛屽叧闂姸鎬�
+                string sql = " Update " + MvarItemKeySub + " set HCloseMan='" + HCloseMan + "',HEntryCloseDate='" + HEntryCloseDate + "',HCloseType=1 Where HInterID=" + lngBillKey.ToString() + " and HEntryID = " + HEntryID;
+                oCn.RunProc(sql);
+
+                //妫�鏌ュ崟鎹瓙琛ㄦ墍鏈夎鏄惁閮藉叧闂紝鑻ラ兘鍏抽棴鍒欒嚜鍔ㄥ叧闂崟鎹�
+                //sql = "select * from " + MvarItemKeySub + " where HInterID=" + lngBillKey + " and HCloseMan=''";
+                //ds = oCn.RunProcReturn(sql, MvarItemKeySub);
+                //if(ds!=null && ds.Tables[0].Rows.Count == 0)
+                //{
+                //    sql = " Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate=getdate(),HBillStatus=3,HCloseType = 0 Where HInterID=" + lngBillKey.ToString();
+                //    oCn.RunProc(sql);
+                //}
+
+                //鍐欏叆鏃ュ織
+                string WorkList = "琛屽叧闂紝鍗曟嵁鍙凤細" + HBillNo + "锛涘瓙琛ㄥ唴鐮侊細" + HEntryID;
+                string SystemName = "LMES-" + MvarReportTitle + "妯″潡";
+                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                    "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','琛屽叧闂�')"
+                    );
+
+                sReturn = "琛屽叧闂垚鍔燂紒";
                 oCn.Commit();
                 return true;
             }
@@ -550,53 +627,6 @@
                 oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                     "(getdate(),'" + sUser + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','鍒犻櫎')"
                     );
-
-                sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
-                oCn.Commit();
-                return true;
-            }
-            catch (Exception e)
-            {
-                sReturn = e.Message;
-                oCn.RollBack();
-                throw (e);
-            }
-        }
-
-        //鍒犻櫎鍗曟嵁
-        public virtual bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn)
-        {
-            try
-            {
-                oCn.BeginTran();
-                //鍒犻櫎鍏宠仈
-                DeleteRelation(ref sReturn, lngBillKey);
-                //鍒犻櫎鏄庣粏琛�
-                DeleteBillSub(lngBillKey);
-                DeleteBillSub2(lngBillKey);
-                DeleteBillSub3(lngBillKey);
-                DeleteBillSub4(lngBillKey);
-                //鍒犻櫎涓昏〃
-                DeleteBillMain(lngBillKey);
-
-
-                //鍒犻櫎鍚庢帶鍒�==================================================================================      
-                string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'";
-                DataSet 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();

--
Gitblit v1.9.1