From 1cbc6c9bee7048d3546adebe87d96715630e7d59 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 16 八月 2022 18:21:40 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WorkM/流转卡管理/MES_StationOutBillList_Bad.cs |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 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 1912471..5effe0d 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"
@@ -47,6 +47,7 @@
             string sSql = "";
             string sWhere = "";
 
+            bzd.Enabled = true;
             if (frmCondition.SqlStr.Trim().Length == 0)
             {
                 sSql = "Select top 5000 * from " + ViewName + " Where 1=1 " + sWhere + sDlgWhere + " order by hmainid desc ";
@@ -496,7 +497,7 @@
             //LOT鍙�
             if (txtHBillNo.Text.Trim() != "")
             {
-                sFastSQL = sFastSQL + " and 娴佽浆鍗″彿 like '%" + txtHBillNo.Text + "%'";
+                sFastSQL = sFastSQL + " and 宸ュ簭娴佽浆鍗″彿 like '%" + txtHBillNo.Text + "%'";
             }
             //宸ヤ綔涓績
             if (txtHCenterID.Text.Trim() != "")
@@ -614,6 +615,8 @@
 
         private void bzd_Click(object sender, EventArgs e)
         {
+            //鐐瑰嚮鍚庡叆搴撴寜閽彉鐏�
+            bzd.Enabled = false;
             //鏍规嵁閫変腑鐨勬暟鎹敓鎴愬寘瑁呭崟
             int MainIDCol =  Fun_GetCol("hmainid");
             int SubIDCol = Fun_GetCol("hsubid");
@@ -622,12 +625,14 @@
             int HKeepCol = Fun_GetCol("K3淇濈");
             int HSecManagerCol = Fun_GetCol("K3楠屾敹");
             int HDeptCol = Fun_GetCol("K3閮ㄩ棬");
-            DAL.ClsKf_ProductInBill oClsKf_ProductInBill ;
+            DAL.ClsKf_ProductInBill oClsKf_ProductInBill;
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
             //鑾峰彇绯荤粺鍙傛暟
             Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
             if (oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo) == false)
             {
                 MessageBox.Show("鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + DBUtility.ClsPub.sExeReturnInfo);
+                bzd.Enabled = true;
                 return;
             }
             //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
@@ -637,8 +642,40 @@
             if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Today, ref sYear, ref sPeriod, ref s) == false)
             {
                 MessageBox.Show("浼氳鏈熼棿鏈夐敊璇紒 " + DBUtility.ClsPub.sExeReturnInfo);
+                bzd.Enabled = true;
                 return;
             }
+            string sHInterID = "";
+            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
+            {
+                sHInterID = sHInterID + "," + DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
+            }
+            if (sHInterID=="")
+            {
+                MessageBox.Show("娌℃湁閫変腑鐨勫崟鎹槑缁嗚锛岃鍏堥�夋嫨瑕佸叆搴撶殑鍗曟嵁锛�", "鎻愮ず");
+                bzd.Enabled = true;
+                return;
+            }
+            else
+            {
+                DataSet DS = oCn.RunProcReturn("exec h_p_MES_StationOutBillList_Bad_PreProductIn '" + sHInterID + "'", "h_p_MES_StationOutBillList_Bad_PreProductIn", ref DBUtility.ClsPub.sExeReturnInfo);
+                if (DS == null || DS.Tables[0].Rows.Count == 0)
+                {
+                    MessageBox.Show("鍏ュ簱鍓嶅垽鏂け璐ワ紒", "鎻愮ず");
+                    bzd.Enabled = true;
+                    return;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                    {
+                        MessageBox.Show(DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]));
+                        bzd.Enabled = true;
+                        return;
+                    }
+                }
+            }
+
             Int64 n = 0;
             //寰幆 閫変腑琛�
             for (int i = 0; i < grdMain.SelectedRows.Count; i++)
@@ -678,6 +715,7 @@
                 System.Threading.Thread.Sleep(2000);
                 //
             }
+            bzd.Enabled = true;
             //
             if (n > 0)
             {

--
Gitblit v1.9.1