From c98b250c6e150f0eda22d0447ae35b95cec0ec66 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期一, 01 十一月 2021 09:49:55 +0800
Subject: [PATCH] 条码生成模块增加批次按钮,工艺路线模块修改后保存报错修改

---
 DAL/计划管理/ClsGy_RoutingBill.cs        |    4 +-
 WarM/条码打印/Gy_BarCodeBill.designer.cs |   67 +++++++++++++++++++++++----------
 WarM/条码打印/Gy_BarCodeBill.resx        |   10 +++++
 WarM/条码打印/Gy_BarCodeBill.cs          |   31 +++++++++++++++
 4 files changed, 89 insertions(+), 23 deletions(-)

diff --git "a/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs" "b/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
index cdf3d91..b095354 100644
--- "a/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
+++ "b/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
@@ -38,8 +38,8 @@
                 oCn.BeginTran();
                 //鏇存柊涓昏〃
                 oCn.RunProc("UpDate Gy_RoutingBillMain set  " +
-                ",HPRDORGID=" + omodel.HPRDORGID.ToString() +
-                " HName='" + omodel.HName + "'" +
+                " HPRDORGID=" + omodel.HPRDORGID.ToString() +
+                ",HName='" + omodel.HName + "'" +
                 ",HBillNo='" + omodel.HBillNo + "'" +
                 ",HMaterTypeID=" + omodel.HMaterTypeID.ToString() +
                 ",HMaterID=" + omodel.HMaterID.ToString() +
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
index 580f92b..d453cfa 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
@@ -2471,7 +2471,38 @@
             }
         }
 
+        //鎵规鎸夐挳
+        private void BatchNo_Click(object sender, EventArgs e)
+        {
+            bool b = false;
+            for (int i = 0; i < grdMain.RowCount; i++)
+            {
+                long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value);          // 鐗╂枡鍐呯爜
+                string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HBatchNoCol].Value);     // 鎵瑰彿
 
+                if (HMaterID != 0)
+                {
+                    DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + dtpHDate.Value.ToShortDateString() + "','" + CampanyName + "'", "h_p_Gy_BarCodeBill_GetBatchNo");
+                    //
+                    if (oDs == null && oDs.Tables[0].Rows.Count == 0)
+                    {
+                        MessageBox.Show("鐢熸垚鎵规澶辫触锛�");
+                        return;
+                    }
+                    else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
+                    {
+                        grdMain.Rows[i].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
+                        b = true;
+                    }
+                }
+            }
+            //鏄庣粏琛ㄦ槸鍚︿负闆惰
+            if (b == false)
+            {
+                MessageBox.Show("娌℃湁闇�瑕佺敓鎴愭壒娆$殑鏄庣粏琛岋紒", "鎻愮ず");
+                return;
+            }
+        }
 
 
     }
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
index 6df46ff..c63493e 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
@@ -49,6 +49,8 @@
             this.bclk = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
             this.tb = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+            this.gl = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.tc = new System.Windows.Forms.ToolStripButton();
             this.lblCaption = new System.Windows.Forms.Label();
@@ -100,10 +102,10 @@
             this.tabPage1 = new System.Windows.Forms.TabPage();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.grdSub = new System.Windows.Forms.DataGridView();
-            this.gl = new System.Windows.Forms.ToolStripButton();
-            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
             this.tabPage3 = new System.Windows.Forms.TabPage();
             this.grdList = new System.Windows.Forms.DataGridView();
+            this.BatchNo = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
             this.Tool.SuspendLayout();
             this.P1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
@@ -147,6 +149,8 @@
             this.tb,
             this.toolStripSeparator6,
             this.gl,
+            this.toolStripSeparator7,
+            this.BatchNo,
             this.toolStripSeparator3,
             this.tc});
             this.Tool.Location = new System.Drawing.Point(0, 0);
@@ -350,6 +354,25 @@
             this.tb.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
             this.tb.ToolTipText = "鍚屾鍩虹璧勬枡";
             this.tb.Click += new System.EventHandler(this.tb_Click);
+            // 
+            // toolStripSeparator6
+            // 
+            this.toolStripSeparator6.Name = "toolStripSeparator6";
+            this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50);
+            // 
+            // gl
+            // 
+            this.gl.AutoSize = false;
+            this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image")));
+            this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.gl.ImageTransparentColor = System.Drawing.Color.White;
+            this.gl.Name = "gl";
+            this.gl.Size = new System.Drawing.Size(35, 47);
+            this.gl.Text = "鍏宠仈";
+            this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.gl.Click += new System.EventHandler(this.gl_Click);
             // 
             // toolStripSeparator3
             // 
@@ -915,25 +938,6 @@
             this.grdSub.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellContentClick);
             this.grdSub.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellEndEdit);
             // 
-            // gl
-            // 
-            this.gl.AutoSize = false;
-            this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image")));
-            this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
-            this.gl.ImageTransparentColor = System.Drawing.Color.White;
-            this.gl.Name = "gl";
-            this.gl.Size = new System.Drawing.Size(35, 47);
-            this.gl.Text = "鍏宠仈";
-            this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
-            this.gl.Click += new System.EventHandler(this.gl_Click);
-            // 
-            // toolStripSeparator6
-            // 
-            this.toolStripSeparator6.Name = "toolStripSeparator6";
-            this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50);
-            // 
             // tabPage3
             // 
             this.tabPage3.Controls.Add(this.grdList);
@@ -960,6 +964,25 @@
             this.grdList.RowTemplate.Height = 23;
             this.grdList.Size = new System.Drawing.Size(929, 288);
             this.grdList.TabIndex = 46;
+            // 
+            // BatchNo
+            // 
+            this.BatchNo.AutoSize = false;
+            this.BatchNo.Image = ((System.Drawing.Image)(resources.GetObject("BatchNo.Image")));
+            this.BatchNo.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.BatchNo.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.BatchNo.ImageTransparentColor = System.Drawing.Color.White;
+            this.BatchNo.Name = "BatchNo";
+            this.BatchNo.Size = new System.Drawing.Size(36, 47);
+            this.BatchNo.Text = "鎵规";
+            this.BatchNo.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.BatchNo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.BatchNo.Click += new System.EventHandler(this.BatchNo_Click);
+            // 
+            // toolStripSeparator7
+            // 
+            this.toolStripSeparator7.Name = "toolStripSeparator7";
+            this.toolStripSeparator7.Size = new System.Drawing.Size(6, 50);
             // 
             // Gy_BarCodeBill
             // 
@@ -1082,5 +1105,7 @@
         private System.Windows.Forms.ToolStripButton gl;
         private System.Windows.Forms.TabPage tabPage3;
         private System.Windows.Forms.DataGridView grdList;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+        private System.Windows.Forms.ToolStripButton BatchNo;
     }
 }
\ No newline at end of file
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
index 2368149..c42cb23 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
@@ -506,6 +506,16 @@
         TkSuQmCC
 </value>
   </data>
+  <data name="BatchNo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD3SURBVDhPnZC9FYIwFEaZiQFkAB1ADzULZACGoJLKSio7
+        BqCzorNiABgABnjme+GFBPlR3znfSUJy7yMJdorG0S2KY1r6/lE0PBMcdA8z3NZEd9VtSmiolU7iSjwY
+        CcNyUUL0UhzMIcK4An8IPFjGr2F0s3CTmrFOLbgN67vK79LQsOCqQhaIxIE9AfXVxT4Wwzp1NsGYQ4b9
+        tjhSe4smiVKma19NL+4KBEQA85hH1OQH+T6T6MgagaArThys0V3g8ZwpgbryzBuIXAfB3iosZSUP3VEH
+        cx82d1+EpURiHmu8817neYkEHQH+BEtZSfYHLCWSdTgI3vBtcjUXOHiVAAAAAElFTkSuQmCC
+</value>
+  </data>
   <data name="tc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8

--
Gitblit v1.9.1