From 26f8b83cda74150d83dc09ab0b92b10b6f1286b1 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期五, 10 九月 2021 09:42:41 +0800
Subject: [PATCH] 上料防错单列表 编辑,审核,反审核

---
 DAL/MES/ClsSc_MESMaterToSourceBill .cs |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/DAL/MES/ClsSc_MESMaterToSourceBill .cs b/DAL/MES/ClsSc_MESMaterToSourceBill .cs
index 83efea5..d13ee07 100644
--- a/DAL/MES/ClsSc_MESMaterToSourceBill .cs
+++ b/DAL/MES/ClsSc_MESMaterToSourceBill .cs
@@ -58,7 +58,7 @@
                 ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() +
                 ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() +
                 ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() +
-                ",HMainSourceBillNo=" + omodel.HMainSourceBillNo.ToString() +
+                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo.ToString() +"'"+
                 ",HSourceID=" + omodel.HSourceID.ToString() +
                 ",HProcID=" + omodel.HProcID.ToString() +
                 ",HMaterID=" + omodel.HMaterID.ToString() +
@@ -88,7 +88,7 @@
                       ",'" + oSub.HBarCode + "','" + oSub.HBarCode_Pack + "','" + oSub.HBillNo_bak + "'" +
                       ") ");
                 }
-                sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+                sReturn = omodel.HInterID.ToString();
                 oCn.Commit();
                 return true;
             }
@@ -265,6 +265,45 @@
             }
         }
 
+        //鍒犻櫎鍗曟嵁
+        public override bool DeleteBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                oCn.BeginTran();
+                //鍒ゆ柇鏄惁鍏佽鍒犻櫎
+                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_DelCtrl @HInterId=" + lngBillKey + "", "h_p_Sc_MaterToSourceBill_DelCtrl");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    sReturn = "鏃犻獙璇佹暟鎹紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+
+                //鍒犻櫎鍏宠仈鍏崇郴
+                oCn.RunProc("exec h_p_Sc_MaterToSourceBill_DelRelation @HInterId=" + lngBillKey + "");
+
+                //鍒犻櫎鏄庣粏琛�
+                oCn.RunProc("Delete From " + MvarItemKeySub + "  where HInterID=" + lngBillKey.ToString());
+                //鍒犻櫎涓昏〃
+                oCn.RunProc("Delete From " + MvarItemKey + "  where HInterID=" + lngBillKey.ToString());
+
+                sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
         //瀹℃牳
         public bool CheckBill(Int64 lngBillKey, ref string sReturn)
         {

--
Gitblit v1.9.1