From 077dd1267cbe547ca584cb7befc99c238c68b08f Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期三, 06 十月 2021 09:20:22 +0800
Subject: [PATCH] 控制不良品入库单

---
 WorkM/流转卡管理/MES_StationOutBillList_Bad.cs |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
index 1ed6549..1912471 100644
--- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
+++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBillList_Bad.cs"
@@ -618,6 +618,10 @@
             int MainIDCol =  Fun_GetCol("hmainid");
             int SubIDCol = Fun_GetCol("hsubid");
             int BillNoCol = Fun_GetCol("鍗曟嵁鍙�");
+            int HUserK3Col = Fun_GetCol("K3鐢ㄦ埛");
+            int HKeepCol = Fun_GetCol("K3淇濈");
+            int HSecManagerCol = Fun_GetCol("K3楠屾敹");
+            int HDeptCol = Fun_GetCol("K3閮ㄩ棬");
             DAL.ClsKf_ProductInBill oClsKf_ProductInBill ;
             //鑾峰彇绯荤粺鍙傛暟
             Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
@@ -645,15 +649,23 @@
                 oClsKf_ProductInBill.omodel.HInterID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                 oClsKf_ProductInBill.omodel.HDate = DateTime.Today;
                 oClsKf_ProductInBill.omodel.HBillNo = ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
-                oClsKf_ProductInBill.omodel.HDeptID = 0;
-                oClsKf_ProductInBill.omodel.HEmpID = 0;
-                oClsKf_ProductInBill.omodel.HSecManagerID = 0;
-                oClsKf_ProductInBill.omodel.HKeeperID = 0;
+                oClsKf_ProductInBill.omodel.HDeptID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HDeptCol].Value);
+                oClsKf_ProductInBill.omodel.HEmpID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
+                oClsKf_ProductInBill.omodel.HSecManagerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HSecManagerCol].Value);
+                oClsKf_ProductInBill.omodel.HKeeperID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
+                oClsKf_ProductInBill.omodel.HBillerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HUserK3Col].Value);
                 oClsKf_ProductInBill.omodel.HRemark = "涓嶈壇鍝佸悓姝�";
                 oClsKf_ProductInBill.omodel.HMaker =  DBUtility.ClsPub.CurUserName;
                 oClsKf_ProductInBill.omodel.HWHID = 0;
                 oClsKf_ProductInBill.omodel.HSupID = 0;
                 oClsKf_ProductInBill.omodel.HExplanation = ""; 
+                if(oClsKf_ProductInBill.omodel.HBillerID==0 || oClsKf_ProductInBill.omodel.HKeeperID==0 
+                    || oClsKf_ProductInBill.omodel.HEmpID==0 || oClsKf_ProductInBill.omodel.HDeptID==0
+                    || oClsKf_ProductInBill.omodel.HSecManagerID ==0 )
+                {
+                    MessageBox.Show("娌℃湁璁剧疆閲戣澏鐢ㄦ埛銆侀儴闂ㄣ�佷繚绠°�侀獙鏀跺憳锛� " + DBUtility.ClsPub.sExeReturnInfo);
+                    continue;
+                }
                 if(oClsKf_ProductInBill.AddBill_StationOut_Bad("3710", oSystemParameter.omodel, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
                     n++;
@@ -663,13 +675,15 @@
                     MessageBox.Show("鍚屾鍗曟嵁澶辫触锛�"+ DBUtility.ClsPub.sExeReturnInfo);
                 }
                 //浼戠湢5绉�
-                System.Threading.Thread.Sleep(5000);
+                System.Threading.Thread.Sleep(2000);
                 //
             }
             //
             if (n > 0)
             {
                 MessageBox.Show("鍚屾鍗曟嵁瀹屾瘯锛佷竴鍏辨湁" + n.ToString() + "寮犲叆搴撳崟锛�");
+                initGrid();
+                Display();
             }
         }
 

--
Gitblit v1.9.1