瀏覽代碼

[海格森MES]彩盒打印等打印方法调整

caosy 6 月之前
父節點
當前提交
dfbbb180b7

+ 3 - 3
UAS_MES_HGS/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -829,11 +829,11 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
             this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
-            this.panel4.ResumeLayout(false);
+            this.panel4.ResumeLayout(true);
             this.panel4.PerformLayout();
             this.panel4.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
             this.groupBoxWithBorder2.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
             this.PerformLayout();
 
 
         }
         }

+ 5 - 4
UAS_MES_HGS/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -106,8 +106,9 @@ namespace UAS_MES_NEW.Make
         {
         {
             try
             try
             {
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
+                engine = new BarTender.Application();
             }
             }
             catch (Exception)
             catch (Exception)
             {
             {
@@ -337,7 +338,7 @@ namespace UAS_MES_NEW.Make
         //关闭窗口的时候停止进程读取串口数据
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
         {
-            BaseUtil.ClosePrint(lbl);
+            //BaseUtil.ClosePrint(lbl);
             StopWeight.PerformClick();
             StopWeight.PerformClick();
             InitPrint.Abort();
             InitPrint.Abort();
             if (serialPort1.IsOpen)
             if (serialPort1.IsOpen)
@@ -357,7 +358,7 @@ namespace UAS_MES_NEW.Make
             if (PrintLabel.Items.Count != 0)
             if (PrintLabel.Items.Count != 0)
             {
             {
                 string oErrorMessage;
                 string oErrorMessage;
-                if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
+                if (!Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out oErrorMessage))
                 {
                 {
                     OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                     OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                 }
                 }

+ 3 - 3
UAS_MES_HGS/FunctionCode/Make/Make_RePrintLabel.cs

@@ -76,8 +76,8 @@ namespace UAS_MES_NEW.Make
             try
             try
             {
             {
                 engine = new BarTender.Application();
                 engine = new BarTender.Application();
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
@@ -96,7 +96,7 @@ namespace UAS_MES_NEW.Make
             if (engine != null)
             if (engine != null)
                 engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
                 engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             //窗口关闭的时候
             //窗口关闭的时候
-            BaseUtil.ClosePrint(lbl);
+            //BaseUtil.ClosePrint(lbl);
             dh.Dispose();
             dh.Dispose();
 
 
         }
         }

+ 2 - 2
UAS_MES_HGS/PublicMethod/Print.cs

@@ -127,11 +127,11 @@ namespace UAS_MES_NEW.PublicMethod
             doc2.PrintSetup.NumberSerializedLabels = 1;
             doc2.PrintSetup.NumberSerializedLabels = 1;
             doc2.PrintSetup.Printer = PrinterName;
             doc2.PrintSetup.Printer = PrinterName;
             doc2.PrintOut(false, false);
             doc2.PrintOut(false, false);
-            doc2.Close(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            //doc2.Close(BarTender.BtSaveOptions.btDoNotSaveChanges);
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             //打印完毕 
             //打印完毕 
-            lbl.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            //lbl.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             return true;
             return true;
         }
         }
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)