From cee055eb7cdecf5d995cc65d379494e471bde9c8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 02 四月 2025 10:06:03 +0800
Subject: [PATCH] 合并

---
 DBUtility/业务单据/ClsXt_BaseBill.cs |  219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 218 insertions(+), 1 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 2b14493..b805e7c 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"
@@ -112,6 +112,68 @@
                 throw (e);
             }
         }
+
+        //鍙嶄綔搴�(鍖呭惈浣滃簾鍚庢帶鍒躲�佸啓鍏ユ棩蹇�)    2025-03-10
+        public bool AbandonCancelltion(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+        {
+            string sql = "";
+
+            if (isUse(lngBillKey, ref sReturn))
+            {
+                return false;
+            }
+            try
+            {
+                //寮�鍚簨鍔�
+                oCn.BeginTran();
+                DataSet ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
+                if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+                {
+                    oCn.RunProc(" Update " + MvarItemKey + " set HDeleteMan='',HDeleteDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+                }
+                else if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+                {
+                    oCn.RunProc(" Update " + MvarItemKey + " set HDeleteMan='',HDeleteDate=null,HBillStatus=2 Where HInterID=" + lngBillKey.ToString());
+                }
+                else
+                {
+                    oCn.RunProc(" Update " + MvarItemKey + " set HDeleteMan='',HDeleteDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+                }
+
+
+                //鍙嶄綔搴熷悗鎺у埗
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, 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;
+                }
+                //鍐欏叆鏃ュ織
+                string WorkList = "鍙嶄綔搴熷崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
+                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)
+            {
+                oCn.RollBack();
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
         //鍙嶅叧闂�
         public bool CancelClose(Int64 lngBillKey, ref string sReturn)
         {
@@ -140,6 +202,7 @@
                 throw (e);
             }
         }
+
         //鍙嶅叧闂崟鎹�(鍖呭惈鍐欏叆鏃ュ織)    2024-01-31
         public bool CancelClose(Int64 lngBillKey, string HBillNo, string sUser, ref string sReturn)
         {
@@ -158,6 +221,62 @@
                 else
                 {
                     oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
+                }
+
+                //鍐欏叆鏃ュ織
+                string WorkList = "鍙嶅叧闂崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
+                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)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //鍙嶅叧闂崟鎹�(鍖呭惈鍙嶅叧闂悗鎺у埗 鍐欏叆鏃ュ織)    2025-03-18
+        public bool CancelClose(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+        {
+            try
+            {
+                string sql = "";
+                oCn.BeginTran();
+                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,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,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
+                }
+                else
+                {
+                    oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='',HCloseDate=null,HBillStatus=1,HCloseType = 0 Where HInterID=" + lngBillKey.ToString());
+                }
+
+                //鍙嶅叧闂悗鎺у埗
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, 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;
                 }
 
                 //鍐欏叆鏃ュ織
@@ -578,7 +697,7 @@
                 if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                 {
                     string HBillType = ds.Tables[0].Rows[0]["HBillType"].ToString();
-                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239")
+                    if (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1247" || HBillType == "1244" || HBillType == "1251" || HBillType == "1210" || HBillType == "1205" || HBillType == "1250" || HBillType == "1206" || HBillType == "1245" || HBillType == "1239"|| HBillType == "1256")
                     {
                         //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 澧炲姞搴撳瓨 1201 1202 1203 1247 1244 1251 1210
                         //鍙嶅鏍告洿鏂� 鍙婃椂搴撳瓨琛� 鍑忓皯搴撳瓨 1205 1250 1206 1245 1239 
@@ -853,6 +972,53 @@
             }
         }
 
+        //鍏抽棴鍗曟嵁(鍖呭惈鍏抽棴鍚庢帶鍒� 鍐欏叆鏃ュ織)    2025-03-18
+        public bool CloseBill(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+        {
+            try
+            {
+                string sql = "";
+                DataSet ds;
+                oCn.BeginTran();
+                string HCloseMan = sUser;
+                string HCloseDate = ClsPub.GetServerDate(-1);
+                oCn.RunProc(" Update " + MvarItemKey + " set HCloseMan='" + HCloseMan + "',HCloseDate='" + HCloseDate + "',HBillStatus=3,HCloseType = 1 Where HInterID=" + lngBillKey.ToString());
+
+                //鍏抽棴鍚庢帶鍒�
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, 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;
+                }
+
+                //鍐欏叆鏃ュ織
+                string WorkList = "鍏抽棴鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+                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)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
         //琛屽叧闂崟鎹紙琛屽叧闂悗鎺у埗锛�(鍖呭惈鍐欏叆鏃ュ織)    2024-01-31
         public bool CloseRow(Int64 lngBillKey, Int64 HEntryID, string HBillNo, string sUser, string procName, ref string sReturn)
         {
@@ -1005,6 +1171,57 @@
                 throw (e);
             }
         }
+        //浣滃簾(鍖呭惈浣滃簾鍚庢帶鍒躲�佸啓鍏ユ棩蹇�)    2025-03-10
+        public bool Cancelltion(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+        {
+            string sql = "";
+            DataSet ds;
+
+            if (isUse(lngBillKey, ref sReturn))
+            {
+                return false;
+            }
+            try
+            {
+                //寮�鍚簨鍔�
+                oCn.BeginTran();
+                string HDeleteMan = sUser;
+                string HDeleteDate = ClsPub.GetServerDate(-1);
+                oCn.RunProc(" Update " + MvarItemKey + " set HDeleteMan='" + HDeleteMan + "',HDeleteDate='" + HDeleteDate + "',HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+
+                //浣滃簾鍚庢帶鍒�
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, 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;
+                }
+                //鍐欏叆鏃ュ織
+                string WorkList = "浣滃簾鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+                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)
+            {
+                oCn.RollBack();
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
         //淇濆吇璁″垝鍒犻櫎瀛愯〃1
         public void DeleteBillSub(Int64 lngBillKey)
         {

--
Gitblit v1.9.1