From e7bcbcfc148c4cbf190a655fc056da83cd0e3759 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 23 九月 2024 19:35:17 +0800
Subject: [PATCH] 条码自动生成:设置单选,控制条码生成时是否打印

---
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs          |   50 ++++++++++++++-----------
 WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs |   42 +++++++++++++++++++++
 2 files changed, 70 insertions(+), 22 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
index e9bd5a0..4e94d9e 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.cs"
@@ -426,19 +426,22 @@
             this.Sub_SaveBill();
             Display();
 
-            //璁剧疆鎵撳嵃妯℃澘锛屾墦鍗�
-            grdList.Rows[0].Cells[0].Value = "*";
-            Report = new GridppReport();
-            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf");  //here .
-            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
-            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
-            Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
-            if (comboBox_PrinterParams.Text != "")
+            if (radioButton_IsPrint_Yes.Checked == true)
             {
-                Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
+                //璁剧疆鎵撳嵃妯℃澘锛屾墦鍗�
+                grdList.Rows[0].Cells[0].Value = "*";
+                Report = new GridppReport();
+                Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf");  //here .
+                Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
+                Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
+                Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
+                if (comboBox_PrinterParams.Text != "")
+                {
+                    Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
+                }
+                Report.Print(false);
             }
-            Report.Print(false);
-
+            
             Display4();
         }
         //淇濆瓨鍗曟嵁
@@ -1205,7 +1208,7 @@
                 if (!clearPrinterTask(ref msg))
                 {
                     MessageBox.Show(msg);
-                    return;
+                    produceQty = 0;
                 }
             }
 
@@ -1217,18 +1220,21 @@
                 //鑾峰彇闇�瑕佹墦鍗扮殑鏁版嵁
                 Display();
 
-                //璁剧疆鎵撳嵃妯℃澘锛屾墦鍗�
-                grdList.Rows[0].Cells[0].Value = "*";
-                Report = new GridppReport();
-                Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf");  //here .
-                Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
-                Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
-                Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
-                if (comboBox_PrinterParams.Text != "")
+                if (radioButton_IsPrint_Yes.Checked == true)
                 {
-                    Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
+                    //璁剧疆鎵撳嵃妯℃澘锛屾墦鍗�
+                    grdList.Rows[0].Cells[0].Value = "*";
+                    Report = new GridppReport();
+                    Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf");  //here .
+                    Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
+                    Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
+                    Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
+                    if (comboBox_PrinterParams.Text != "")
+                    {
+                        Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(榛樿)", "");
+                    }
+                    Report.Print(false);
                 }
-                Report.Print(false);
 
                 if (i == produceQty - 1)
                 {
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
index 6cf2200..70981a6 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs"
@@ -148,6 +148,9 @@
             this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
             this.timer2 = new System.Windows.Forms.Timer(this.components);
             this.timer3 = new System.Windows.Forms.Timer(this.components);
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.radioButton_IsPrint_Yes = new System.Windows.Forms.RadioButton();
+            this.radioButton_IsPrint_No = new System.Windows.Forms.RadioButton();
             this.Tool.SuspendLayout();
             this.P1.SuspendLayout();
             this.tabControl_MainInfo.SuspendLayout();
@@ -168,6 +171,7 @@
             this.tabControl1.SuspendLayout();
             this.tabPage4.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdBillBarCodeList)).BeginInit();
+            this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
             // Tool
@@ -556,6 +560,7 @@
             // gbUp
             // 
             this.gbUp.BackColor = System.Drawing.Color.Transparent;
+            this.gbUp.Controls.Add(this.groupBox1);
             this.gbUp.Controls.Add(this.cmdSourceBillNo);
             this.gbUp.Controls.Add(this.cmbHWorksNumber);
             this.gbUp.Controls.Add(this.label4);
@@ -1503,6 +1508,38 @@
             this.timer3.Interval = 5000;
             this.timer3.Tick += new System.EventHandler(this.timer3_Tick);
             // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.radioButton_IsPrint_No);
+            this.groupBox1.Controls.Add(this.radioButton_IsPrint_Yes);
+            this.groupBox1.Location = new System.Drawing.Point(24, 162);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(200, 100);
+            this.groupBox1.TabIndex = 45;
+            this.groupBox1.TabStop = false;
+            // 
+            // radioButton_IsPrint_Yes
+            // 
+            this.radioButton_IsPrint_Yes.AutoSize = true;
+            this.radioButton_IsPrint_Yes.Checked = true;
+            this.radioButton_IsPrint_Yes.Location = new System.Drawing.Point(7, 13);
+            this.radioButton_IsPrint_Yes.Name = "radioButton_IsPrint_Yes";
+            this.radioButton_IsPrint_Yes.Size = new System.Drawing.Size(69, 22);
+            this.radioButton_IsPrint_Yes.TabIndex = 0;
+            this.radioButton_IsPrint_Yes.TabStop = true;
+            this.radioButton_IsPrint_Yes.Text = "鎵撳嵃";
+            this.radioButton_IsPrint_Yes.UseVisualStyleBackColor = true;
+            // 
+            // radioButton_IsPrint_No
+            // 
+            this.radioButton_IsPrint_No.AutoSize = true;
+            this.radioButton_IsPrint_No.Location = new System.Drawing.Point(6, 68);
+            this.radioButton_IsPrint_No.Name = "radioButton_IsPrint_No";
+            this.radioButton_IsPrint_No.Size = new System.Drawing.Size(87, 22);
+            this.radioButton_IsPrint_No.TabIndex = 1;
+            this.radioButton_IsPrint_No.Text = "涓嶆墦鍗�";
+            this.radioButton_IsPrint_No.UseVisualStyleBackColor = true;
+            // 
             // Gy_BarCodeBill_automaticallyByPLC_New
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -1552,6 +1589,8 @@
             this.tabControl1.ResumeLayout(false);
             this.tabPage4.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.grdBillBarCodeList)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
             this.ResumeLayout(false);
 
         }
@@ -1676,5 +1715,8 @@
         private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
         private System.Windows.Forms.Timer timer2;
         private System.Windows.Forms.Timer timer3;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.RadioButton radioButton_IsPrint_No;
+        private System.Windows.Forms.RadioButton radioButton_IsPrint_Yes;
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1