From fdad63daa1e1e5983c0d6912989f88cde7b3fd38 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 20 六月 2022 08:56:21 +0800
Subject: [PATCH] 要料计划报表

---
 WarM/条码打印/Sc_ICMOToBarCode.cs |  127 ++++++++++++++++++++----------------------
 1 files changed, 60 insertions(+), 67 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
index 759a957..07f7c53 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
@@ -228,7 +228,7 @@
 
             DataSet DSet;
 
-            DSet = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
+            DSet = oCn.RunProcReturn("Select HEmpID from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
             
             if (DSet == null)
             //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
@@ -244,7 +244,7 @@
                 {
 
 
-                    txtHEmpID.Tag = DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["HEmpID"]);
+                    txtHEmpID.Tag = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HEmpID"]);
                 }
                 else
                 {
@@ -748,62 +748,6 @@
             }
         }
 
-        private void zf_Click(object sender, EventArgs e)
-        {
-            //Sub_AbandonCheck();
-            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
-            {
-                return;
-            }
-            if (grdMain.CurrentRow == null)
-                return;
-            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
-            if (MessageBox.Show("纭畾瑕佷綔搴熸墍閫夋潯鐮侊紵", "鎻愮ず", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
-            {
-                return;
-            }
-            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
-            {
-                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
-                {
-                    if (!oBar.Cancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("鏉$爜缂栧彿")].Value)))
-                    {
-                        MessageBox.Show("浣滃簾澶辫触锛�", "鎻愮ず");
-                        return;
-                    }
-                }
-            }
-            MessageBox.Show("浣滃簾鎴愬姛锛�", "鎻愮ず");
-        }
-
-        private void fzf_Click(object sender, EventArgs e)
-        {
-            //this.Sub_CheckBill();
-            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
-            {
-                return;
-            }
-            if (grdMain.CurrentRow == null)
-                return;
-            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
-            if (MessageBox.Show("纭畾瑕佸弽浣滃簾鎵�閫夋潯鐮侊紵", "鎻愮ず", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
-            {
-                return;
-            }
-            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
-            {
-                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
-                {
-                    if (!oBar.UnCancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("鏉$爜缂栧彿")].Value)))
-                    {
-                        MessageBox.Show("鍙嶄綔搴熷け璐ワ紒", "鎻愮ず");
-                        return;
-                    }
-                }
-            }
-            MessageBox.Show("鍙嶄綔搴熸垚鍔燂紒", "鎻愮ず");
-        }
-
         private void cmdHSaveBill_Click(object sender, EventArgs e)
         {
 
@@ -1078,18 +1022,19 @@
                 {
                     if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value))
                     {
-                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
-                        return;
+                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+
+                        //MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
+                        //return;
                     }
                     else
                     {
-                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
+                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
                         //
 
-                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
                     }
                 }
                 else
@@ -1756,14 +1701,17 @@
         private void cmdHSourceID_Click(object sender, EventArgs e)
         {
             Int64 HEmpID = 0;
-            HEmpID = ClsPub.isLong(txtHEmpID.Tag);
+            HEmpID = Convert.ToInt64(txtHEmpID.Tag);
+
+           
+            //MessageBox.Show(ClsPub.isStrNull(HEmpID));
             //string HEmpName = "";
             //HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
 
             DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
             if (HEmpID != 0)
             {
-                if (oSource.GetInfoByID(HEmpID))
+                if (oSource.GetInfoByID_AoBang(HEmpID))
                 {
                     this.txtHSourceID.Text = oSource.oModel.HName;
                     this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
@@ -1981,6 +1929,7 @@
             grdList.DataSource = null;
             grdSub.DataSource = null;
             grdMain.DataSource = null;
+            txtHEmpID.Tag = 0;
         }
 
         private void button2_Click(object sender, EventArgs e)
@@ -2094,5 +2043,49 @@
             Sub_SaveBarCode();
             //
         }
+
+        private void cmdESOP_Click(object sender, EventArgs e)
+        { 
+            Sc_MESNowWorkBill_Fast oSc_MESNowWorkBill_Fast = new Sc_MESNowWorkBill_Fast();
+            oSc_MESNowWorkBill_Fast.txtHICMOBillNo.Text = "";
+            oSc_MESNowWorkBill_Fast.txtHMaterID.Text =txtHMaterID.Text;
+            oSc_MESNowWorkBill_Fast.txtHName.Text = ClsPub.isStrNull(grdMain.Rows[0].Cells[Fun_GetCol("鐗╂枡鍚嶇О")].Value);
+            oSc_MESNowWorkBill_Fast.txtHModel.Text = ClsPub.isStrNull(grdMain.Rows[0].Cells[Fun_GetCol("瑙勬牸鍨嬪彿")].Value);
+            oSc_MESNowWorkBill_Fast.Show();
+
+        }
+
+        private void txtHBarCode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if(e.KeyCode==Keys.Enter)
+            {
+                //
+                //鑾峰彇绗竴琛屾潯褰㈢爜杩涜鎵撳嵃
+                DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_CS Where  鏉$爜缂栧彿='"+ txtHBarCode.Text +"' and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜'", "h_v_IF_BarCodeBillList_CS", ref DBUtility.ClsPub.sExeReturnInfo);
+                //鐢熸垚棣栬鏍囬
+                if (DSet == null)
+                {
+                    MessageBox.Show("娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜涓嶅瓨鍦紒" + DBUtility.ClsPub.sExeReturnInfo);
+                    return;
+                }
+                //
+                grdList.DataSource = DSet.Tables[0].DefaultView; 
+                //鍐荤粨
+                int FrCol = 0;
+                string s = "鏄�";
+                DBUtility.Xt_BaseBillFun.DisplayGrid(grdList, this.Name + "grdList", s, FrCol);
+                //
+                //鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
+                if (DBUtility.ClsPub.isStrNull(grdList.Rows[0].Cells[Fun_GetColList("鏉$爜缂栧彿")].Value) == "")
+                {
+                    MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀棰勮锛�");
+                    return;
+                }
+                //閫夋嫨鎵撳嵃妯℃澘 
+                Sub_SetReport("娉ㄥ鐗╂枡鏍囩");
+                Report.Print(false);
+                Thread.Sleep(1000); 
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1