From a905b3df0d0c9ae045b51d1299fbb2f2dcbc2e2d Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期一, 21 二月 2022 10:14:00 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/DLL/ClsSc_ICMOReportBill.cs |   84 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 625565c..937b973 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -307,6 +307,90 @@
             }
         }
 
+        //瀹℃牳
+        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCn.BeginTran();
+                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+
+                sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅鏍�
+        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCn.BeginTran();
+                //杩樺師鍗曟嵁鐘舵�佷负鏈鏍哥姸鎬�
+                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
+                sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒";
+                oCn.Commit();
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍒犻櫎鍗曟嵁
+        public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                oCn.BeginTran();
+                //鏌ヨ鐢熶骇姹囨姤鍗曡〃鏁伴噺
+                DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID  from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
+                string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+                string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
+                string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
+                //
+                //鏇存柊浜ч噺姹囨姤涓存椂琛ㄦ槸鍚︽姤妫�鐢宠鐘舵��
+                string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'");
+                oCn.RunProc(sql1);
+
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎鏄庣粏琛�
+                DeleteBillSub(lngBillKey);
+                //鍒犻櫎涓昏〃
+                DeleteBillMain(lngBillKey);
+
+                sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+
+
         //鎵爜鐢熸垚浜ч噺姹囨姤鍗曪紙鏃犳潯鐮佸嚭鍏ュ簱璁板綍锛�
         public bool AddBill_PDA2(ref string sReturn)
         {

--
Gitblit v1.9.1