Browse Source

修改位BarTender打印

callm 5 years ago
parent
commit
d2cbe70dfb

+ 10 - 6
UAS_MES_MAXMADE/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -9,6 +9,7 @@ using UAS_MES_MAXMADE.Entity;
 using LabelManager2;
 using System.Threading;
 using UAS_MES_MAXMADE.PublicForm;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Make
 {
@@ -35,6 +36,8 @@ namespace UAS_MES_MAXMADE.Make
 
         DataTable Dbfind;
 
+        Engine engine;
+
         public Make_ColorBoxLabelPrint()
         {
             InitializeComponent();
@@ -87,12 +90,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception )
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -135,7 +139,7 @@ namespace UAS_MES_MAXMADE.Make
                 if (CheckTSN.Checked == true && ms_id != null)
                 {
                     sql.Clear();
-                    sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '"+sncode.Text+"'");
+                    sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "' and ms_sncode = '" + sncode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                     {
@@ -223,7 +227,7 @@ namespace UAS_MES_MAXMADE.Make
                                     if (ErrorMessage.Contains("AFTERSUCCESS"))
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n");
                                     // doc = lbl.Documents.Open(PrintLabel.Text);
-                                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
                                     {
                                         //提示用户打印成功
                                         OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);

+ 6 - 8
UAS_MES_MAXMADE/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -10,6 +10,7 @@ using LabelManager2;
 using System.Threading;
 using UAS_MES_MAXMADE.PublicForm;
 using System.Collections.Generic;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Make
 {
@@ -34,13 +35,11 @@ namespace UAS_MES_MAXMADE.Make
 
         string ErrorMessage = "";
 
-        System.DateTime[] indate;
-
         string ms_firstsn = "";
 
         ApplicationClass lbl;
 
-        Document doc;
+        Engine engine;
 
         Thread InitPrint;
 
@@ -92,12 +91,11 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -315,7 +313,7 @@ namespace UAS_MES_MAXMADE.Make
                             }
                             else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
                             // doc = lbl.Documents.Open(PrintLabel.Text);
-                            if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                            if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "彩盒标", "0", out ErrorMessage))
                             {
                                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                             }

+ 50 - 49
UAS_MES_MAXMADE/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -13,6 +13,7 @@ using UAS_MES_MAXMADE.PublicMethod;
 using System.Drawing;
 using LabelManager2;
 using UAS_MES_MAXMADE.PublicForm;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Make
 {
@@ -20,7 +21,6 @@ namespace UAS_MES_MAXMADE.Make
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
         ApplicationClass lbl;
-        Document doc;
         DataHelper dh;
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
@@ -36,17 +36,17 @@ namespace UAS_MES_MAXMADE.Make
         //是否通过串口获取数据
         bool GetData = true;
         string LastSncode;
-        bool WeightChange = false;
 
         DataTable Dbfind;
 
+        Engine engine;
+
         Regex re = new Regex("\\d+.\\d+\\w+");
 
         string ErrorMessage;
 
         Thread InitPrint;
 
-        System.DateTime[] indate;
         private bool AutoCut;
 
         public Make_ColorBoxWeigh()
@@ -103,12 +103,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -118,48 +119,48 @@ namespace UAS_MES_MAXMADE.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                   string oMakeCode = "";
-                   string oMsID = "";
-                   if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
-                   {
-                      //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
-                      //if (nextstepcode != User.CurrentStepCode)
-                      //{
-                      //    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
-                      //    return;
-                      //}
-                    sql.Clear();
-                    sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,pr_spec,pr_colorboxunit,pr_code,pr_colorboxgw,");
-                    sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
-                    sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
-                    sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    string oMakeCode = "";
+                    string oMsID = "";
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
-                        //重量的临时变量
-                        pr_code.Text = dt.Rows[0]["pr_code"].ToString();
-                        string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
-                        string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
-                        string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
-                        string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
-                        string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
-                        string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
-                        //赋值重量单位
-                        Weight = double.Parse(_weight == "" ? "0" : _weight);
-                        MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
-                        MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                        if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
+                        //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
+                        //if (nextstepcode != User.CurrentStepCode)
+                        //{
+                        //    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
+                        //    return;
+                        //}
+                        sql.Clear();
+                        sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,pr_spec,pr_colorboxunit,pr_code,pr_colorboxgw,");
+                        sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
+                        sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
+                        sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
                         {
-                            OperateResult.AppendText(">>序列号" + sncode.Text + "所属订单号" + ma_salecode_text + "与界面订单号" + ma_salecode.Text + "不同,无法采集\n", Color.Red, sncode);
-                            return;
-                        }
-                        ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
-                        BaseUtil.SetFormValue(this.Controls, dt);
-                        if (Weight - MinWeight == MaxWeight - Weight)
-                            pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
-                        else
-                            pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
-                    
+                            //重量的临时变量
+                            pr_code.Text = dt.Rows[0]["pr_code"].ToString();
+                            string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
+                            string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
+                            string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
+                            string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
+                            string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
+                            string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
+                            //赋值重量单位
+                            Weight = double.Parse(_weight == "" ? "0" : _weight);
+                            MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                            MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                            if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
+                            {
+                                OperateResult.AppendText(">>序列号" + sncode.Text + "所属订单号" + ma_salecode_text + "与界面订单号" + ma_salecode.Text + "不同,无法采集\n", Color.Red, sncode);
+                                return;
+                            }
+                            ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            if (Weight - MinWeight == MaxWeight - Weight)
+                                pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                            else
+                                pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
+
                             //如果未打开串口设置为0
                             //if (pr_colorboxunit.Text == "kg" && !WeightChange)
                             //{
@@ -226,7 +227,7 @@ namespace UAS_MES_MAXMADE.Make
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
-                    else OperateResult.AppendText(">>"+ErrorMessage+"\n", Color.Red, sncode);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
             }
@@ -301,7 +302,7 @@ namespace UAS_MES_MAXMADE.Make
             {
                 //doc = lbl.Documents.Open(PrintLabel.Text);
                 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.BarTender(Tag.ToString(), ref 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(oErrorMessage + "\n", Color.Red);
                 }

+ 1 - 1
UAS_MES_MAXMADE/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -74,7 +74,7 @@ namespace UAS_MES_MAXMADE.Make
             }
             catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 

+ 8 - 9
UAS_MES_MAXMADE/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -10,6 +10,7 @@ using LabelManager2;
 using System.IO;
 using System.Threading;
 using UAS_MES_MAXMADE.PublicForm;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Make
 {
@@ -18,7 +19,6 @@ namespace UAS_MES_MAXMADE.Make
         DataHelper dh;
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
-        Document doc;
         AutoSizeFormClass asc = new AutoSizeFormClass();
         //保存StepProduct查询出来的数据
         //        DataTable ListA = new DataTable();
@@ -39,7 +39,7 @@ namespace UAS_MES_MAXMADE.Make
 
         bool pr_change = false;
 
-        ftpOperater ftp;
+        Engine engine;
         public Make_FuselageLabelPrint()
         {
             InitializeComponent();
@@ -66,12 +66,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -88,8 +89,6 @@ namespace UAS_MES_MAXMADE.Make
                 }
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out oErrorMessage))
                 {
-                    //定义临时变量
-                    string oStatus = "";
                     //调用公共方法CheckStepSNAndMacode判断工序是否正确
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
                     {
@@ -149,7 +148,7 @@ namespace UAS_MES_MAXMADE.Make
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
                             //按照打印张数打印
                             //doc = lbl.Documents.Open(PrintLabel.Text);
-                            if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
+                            if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, ma_prodcode.Text, "机身标", "0", out oErrorMessage))
                             {
                                 //提示用户打印成功
                                 OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);

+ 8 - 8
UAS_MES_MAXMADE/FunctionCode/Make/Make_GetReMakeSN.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -30,9 +31,7 @@ namespace UAS_MES_MAXMADE.Make
 
         DataTable dt;
 
-        Document doc;
-
-        private System.DateTime[] indate;
+        Engine engine;
 
         string ErrMessage;
 
@@ -45,12 +44,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -330,7 +330,7 @@ namespace UAS_MES_MAXMADE.Make
                                     {
                                         OperateResult.AppendText(">>打印序列号" + sn_code.Text + "\n", Color.Black);
                                         //doc = lbl.Documents.Open(PrintLabel.Text);
-                                        if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sn_code.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "SN标签", "0", out ErrMessage))
+                                        if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sn_code.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "SN标签", "0", out ErrMessage))
                                         {
                                             OperateResult.AppendText(ErrMessage + "\n", Color.Red);
                                             return;

+ 11 - 11
UAS_MES_MAXMADE/FunctionCode/Make/Make_RePrintLabel.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -25,21 +26,17 @@ namespace UAS_MES_MAXMADE.Make
 
         ApplicationClass lbl;
 
-        Document doc;
-
         Thread InitPrint;//实例化打印进程
 
         DataTable dt;
 
-        ftpOperater ftp;
-
         DataTable listA;
 
         string getlabel = "";
 
         DataTable mapB;
 
-        String TSN = "";//记录第一次输入的SN
+        string TSN = "";//记录第一次输入的SN
 
         DataTable infoc;
 
@@ -47,6 +44,8 @@ namespace UAS_MES_MAXMADE.Make
 
         string ms_id = "";
 
+        Engine engine;
+
         DataTable formValue;//界面赋值
 
         string type = "";
@@ -73,12 +72,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -222,7 +222,7 @@ namespace UAS_MES_MAXMADE.Make
                 }
                 //判定通过进行打印 
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
+                if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
                 {
                     //按照打印张数打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -254,7 +254,7 @@ namespace UAS_MES_MAXMADE.Make
                     return;
                 }
                 //doc = lbl.Documents.Open(PrintLabel.Text);
-                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
+                if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
                 {
                     //判断通过,打印
                     OperateResult.AppendText("<<打印成功\n", Color.Green);

+ 7 - 4
UAS_MES_MAXMADE/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -13,6 +13,7 @@ using System.IO.Ports;
 using System.IO;
 using System.Text.RegularExpressions;
 using System.Collections.Generic;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Make
 {
@@ -42,6 +43,7 @@ namespace UAS_MES_MAXMADE.Make
         decimal StandardQTY = 0;
         string LastSncode;
         string oOutBoxCode = "";
+        Engine engine;
 
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
@@ -59,12 +61,13 @@ namespace UAS_MES_MAXMADE.Make
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -191,7 +194,7 @@ namespace UAS_MES_MAXMADE.Make
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                     }

+ 8 - 4
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_BigBoxCollection.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -24,6 +25,8 @@ namespace UAS_MES_MAXMADE.Packing
 
         Document doc;
 
+        Engine engine;
+
         Packing_NewBigBox NewBigBox;
 
         string pa_id;
@@ -46,12 +49,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -432,7 +436,7 @@ namespace UAS_MES_MAXMADE.Packing
             {
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
-                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }

+ 8 - 5
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_BigBoxWeight.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -22,7 +23,8 @@ namespace UAS_MES_MAXMADE.Packing
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
         DataHelper dh;
-        Document doc;
+
+        Engine engine;
         //true的时候表示从串口读取数据
         bool GetData = true;
 
@@ -85,12 +87,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -140,7 +143,7 @@ namespace UAS_MES_MAXMADE.Packing
                         {
                             //doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                             string ErrorMessage = "";
-                            if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
+                            if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
                             {
                                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                             }

+ 8 - 6
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_CartonBoxSNWeigh.cs

@@ -1,5 +1,6 @@
 using LabelManager2;
 using Microsoft.Win32;
+using Seagull.BarTender.Print;
 using System;
 using System.Data;
 using System.Drawing;
@@ -30,8 +31,6 @@ namespace UAS_MES_MAXMADE.Packing
 
         string outboxcode = "";
 
-        Document doc;
-
         Thread thread;
 
         bool LockSn = false;
@@ -54,6 +53,8 @@ namespace UAS_MES_MAXMADE.Packing
         Double MinWeight;
         DataTable ListC = new DataTable();
 
+        Engine engine;
+
         Thread InitPrint;
 
         public Packing_CartonBoxSNWeigh()
@@ -101,12 +102,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -255,7 +257,7 @@ namespace UAS_MES_MAXMADE.Packing
         {
             //doc = lbl.Documents.Open(PrintLabel.Text);
             string ErrorMessage = "";
-            if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+            if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
             {
                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
             }

+ 8 - 4
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_CartonBoxWeigh.cs

@@ -1,5 +1,6 @@
 using LabelManager2;
 using Microsoft.Win32;
+using Seagull.BarTender.Print;
 using System;
 using System.Data;
 using System.Drawing;
@@ -30,6 +31,8 @@ namespace UAS_MES_MAXMADE.Packing
 
         Document doc;
 
+        Engine engine;
+
         Regex re = new Regex("\\d+.\\d+\\w+");
 
         Thread thread;
@@ -89,12 +92,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -232,7 +236,7 @@ namespace UAS_MES_MAXMADE.Packing
         {
             //doc = lbl.Documents.Open(PrintLabel.Text);
             string ErrorMessage = "";
-            if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+            if (!Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
             {
                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
             }

+ 7 - 6
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -10,6 +10,7 @@ using System.Threading;
 using UAS_MES_MAXMADE.PublicForm;
 using System.Collections.Generic;
 using System.Diagnostics;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Packing
 {
@@ -21,7 +22,7 @@ namespace UAS_MES_MAXMADE.Packing
         AutoSizeFormClass asc = new AutoSizeFormClass();
         ApplicationClass lbl;
         Thread thread;
-        DataTable Dbfind;
+        Engine engine;
         string ErrorMessage = "";
         string oMakeCode = "";
         string oMsID = "";
@@ -45,17 +46,18 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
             }
             catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n" + ex.Message, Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n" + ex.Message, Color.Red);
             }
         }
 
         private void PackCollection_Load(object sender, EventArgs e)
         {
-           // 杀死之前全部未关闭的进程
+            // 杀死之前全部未关闭的进程
             Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
             Process[] processes1 = System.Diagnostics.Process.GetProcessesByName("bartend");
             for (int i = 0; i < processes1.Length; i++)
@@ -154,8 +156,7 @@ namespace UAS_MES_MAXMADE.Packing
                 if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
-                    //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(),ref  lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }

+ 8 - 9
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -13,6 +13,7 @@ using System.IO.Ports;
 using System.IO;
 using System.Text.RegularExpressions;
 using System.Collections.Generic;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Packing
 {
@@ -22,10 +23,9 @@ namespace UAS_MES_MAXMADE.Packing
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
-        Document doc;
         ApplicationClass lbl;
         Thread thread;
-        DataTable Dbfind;
+        Engine engine;
         string ErrorMessage = "";
         string oMakeCode = "";
         string oMsID = "";
@@ -64,12 +64,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine =new  Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -159,12 +160,10 @@ namespace UAS_MES_MAXMADE.Packing
         private void LoadData()
         {
             //加载表单数据
-            string Err = "";
             sql.Clear();
             sql.Append("select pa_prodcode,pr_cartonmaxw,pa_salecode,pa_remark,pa_makecode,pr_cartonunit,pr_code,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
             sql.Append("pa_status,pr_packrule,pr_detail,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pa_currentqty from package left join ");
             sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
-            Err = "箱号";
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -216,7 +215,7 @@ namespace UAS_MES_MAXMADE.Packing
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }

+ 8 - 4
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -33,6 +34,8 @@ namespace UAS_MES_MAXMADE.Packing
         //Package表的主键
         string pa_id;
 
+        Engine engine;
+
         ApplicationClass lbl;
 
         Document doc;
@@ -51,12 +54,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -423,7 +427,7 @@ namespace UAS_MES_MAXMADE.Packing
                         outboxcode.SelectAll();
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
                     }

+ 8 - 6
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_PalletWeigh.cs

@@ -1,4 +1,5 @@
 using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Data;
 using System.Drawing;
@@ -21,8 +22,6 @@ namespace UAS_MES_MAXMADE.Packing
 
         ApplicationClass lbl;
 
-        Document doc;
-
         Thread InitPrint;
 
         Thread thread;
@@ -35,6 +34,8 @@ namespace UAS_MES_MAXMADE.Packing
 
         DataTable info;
 
+        Engine engine;
+
         //创建串口实例
         SerialPort serialPort1 = new SerialPort();
         //true的时候表示从串口读取数据
@@ -74,12 +75,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
+                engine = new Engine();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -167,7 +169,7 @@ namespace UAS_MES_MAXMADE.Packing
                                 }
                                 //doc = lbl.Documents.Open(PrintLabel.Text);
                                 string ErrorMessage = "";
-                                if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, palletcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                                if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, palletcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                                 {
                                     //打印成功,请输入栈板号
                                     OperateResult.AppendText("<<打印成功\n", Color.Green);
@@ -177,7 +179,7 @@ namespace UAS_MES_MAXMADE.Packing
                                     OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                                 }
                             }
-                            catch (Exception ex)
+                            catch (Exception)
                             {
                                 OperateResult.AppendText("<<打印失败\n", Color.Red);
                                 OperateResult.AppendText(">>请输入栈板号\n", Color.Black, palletcode);

+ 9 - 9
UAS_MES_MAXMADE/FunctionCode/Packing/Packing_PalletWightCollection.cs

@@ -12,6 +12,7 @@ using UAS_MES_MAXMADE.Entity;
 using UAS_MES_MAXMADE.PublicForm;
 using UAS_MES_MAXMADE.PublicMethod;
 using UAS_MES_MAXMADE.Packing;
+using Seagull.BarTender.Print;
 
 namespace UAS_MES_MAXMADE.Packing
 {
@@ -32,14 +33,14 @@ namespace UAS_MES_MAXMADE.Packing
         //最大重量
         Double MaxWeight;
         //最小重量
-        Double MinWeight;
+        double MinWeight;
 
         //true的时候表示从串口读取数据
         bool GetData = true;
 
         string pa_nextstep = "";
-        //箱类型
-        string pa_type;
+
+        Engine engine;
 
         //Package表的主键
         string pa_id;
@@ -48,8 +49,6 @@ namespace UAS_MES_MAXMADE.Packing
 
         ApplicationClass lbl;
 
-        Document doc;
-
         Thread InitPrint;
 
         Thread thread;
@@ -69,12 +68,13 @@ namespace UAS_MES_MAXMADE.Packing
         {
             try
             {
-                lbl = new ApplicationClass();
-                BaseUtil.WriteLbl();
+                engine = new Engine();
+                //lbl = new ApplicationClass();
+                //BaseUtil.WriteLbl();
             }
             catch
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装BarTender软件\n", Color.Red);
             }
         }
 
@@ -490,7 +490,7 @@ namespace UAS_MES_MAXMADE.Packing
                         pa_outboxcode.SelectAll();
                     }
                     //doc = lbl.Documents.Open(PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                    if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
                     }

+ 14 - 14
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.Designer.cs

@@ -34,7 +34,7 @@
             this.pr_spec_label = new System.Windows.Forms.Label();
             this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
-            this.CodeSoft = new System.Windows.Forms.RadioButton();
+            this.BarTender = new System.Windows.Forms.RadioButton();
             this.labelSoft_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.la_name = new System.Windows.Forms.TextBox();
@@ -115,18 +115,18 @@
             // 
             this.openFileDialog1.FileName = "openFileDialog1";
             // 
-            // CodeSoft
+            // BarTender
             // 
-            this.CodeSoft.AutoSize = true;
-            this.CodeSoft.Checked = true;
-            this.CodeSoft.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CodeSoft.Location = new System.Drawing.Point(968, 12);
-            this.CodeSoft.Name = "CodeSoft";
-            this.CodeSoft.Size = new System.Drawing.Size(99, 25);
-            this.CodeSoft.TabIndex = 161;
-            this.CodeSoft.TabStop = true;
-            this.CodeSoft.Text = "CodeSoft";
-            this.CodeSoft.UseVisualStyleBackColor = true;
+            this.BarTender.AutoSize = true;
+            this.BarTender.Checked = true;
+            this.BarTender.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.BarTender.Location = new System.Drawing.Point(968, 12);
+            this.BarTender.Name = "BarTender";
+            this.BarTender.Size = new System.Drawing.Size(99, 25);
+            this.BarTender.TabIndex = 161;
+            this.BarTender.TabStop = true;
+            this.BarTender.Text = "BarTender";
+            this.BarTender.UseVisualStyleBackColor = true;
             // 
             // labelSoft_label
             // 
@@ -642,7 +642,7 @@
             this.Controls.Add(this.LabelDataGridView);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.labelSoft_label);
-            this.Controls.Add(this.CodeSoft);
+            this.Controls.Add(this.BarTender);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.UpdateGrid);
             this.Controls.Add(this.Screen);
@@ -677,7 +677,7 @@
         private System.Windows.Forms.OpenFileDialog openFileDialog1;
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
         private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
-        private System.Windows.Forms.RadioButton CodeSoft;
+        private System.Windows.Forms.RadioButton BarTender;
         private System.Windows.Forms.Label labelSoft_label;
         private System.Windows.Forms.Label label1;
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum LabelDataGridView;

+ 7 - 7
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -26,7 +26,7 @@ namespace UAS_MES_MAXMADE.SystemSetting
         //用于拼接条件查询
         StringBuilder condition = new StringBuilder();
         LogStringBuilder sql = new LogStringBuilder();
-        /*CodeSoft新建打印机引擎*/
+        /*BarTender新建打印机引擎*/
         ApplicationClass lbl;
         Document doc;
         /*BarTender新建打印机引擎*/
@@ -136,7 +136,7 @@ namespace UAS_MES_MAXMADE.SystemSetting
             }
             catch (Exception ex)
             {
-                MessageBox.Show("未正确安装codesoft");
+                MessageBox.Show("未正确安装BarTender");
             }
         }
         private void La_code_DbChange(object sender, EventArgs e)
@@ -162,7 +162,7 @@ namespace UAS_MES_MAXMADE.SystemSetting
                     LabelCode = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelcode"].Value.ToString();
                     pl_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
                     La_id1 = LabelDataGridView.Rows[e.RowIndex].Cells["la_id"].Value.ToString();
-                    if (CodeSoft.Checked)
+                    if (BarTender.Checked)
                     {
                         string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labelname"].Value.ToString();
                         doc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelPath, LabelName));
@@ -256,9 +256,9 @@ namespace UAS_MES_MAXMADE.SystemSetting
         {
             string LabelSoft = "";
             //需要处理新增的行和原有数据然后更新的行
-            if (CodeSoft.Checked)
+            if (BarTender.Checked)
             {
-                LabelSoft = "CodeSoft";
+                LabelSoft = "BarTender";
             }
             DataTable dt = (DataTable)LabelDataGridView.DataSource;
             //如果有改变的行才传递到后台
@@ -323,7 +323,7 @@ namespace UAS_MES_MAXMADE.SystemSetting
         private void OpenFolder_Click(object sender, EventArgs e)
         {
             //根据勾选的不同设置不同的文件后缀过滤
-            if (CodeSoft.Checked)
+            if (BarTender.Checked)
             {
                 openFileDialog1.Filter = "(*.lab)|*.lab";
             }
@@ -453,7 +453,7 @@ namespace UAS_MES_MAXMADE.SystemSetting
             {
                 if (FTPShare.Checked)
                 {
-                    string SoftWare = "CodeSoft";
+                    string SoftWare = "BarTender";
                   
                     ftp.UpLoadFile(FolderPath.Text, la_name.Text,SavePath.Text);
                     if (pl_id2 != "")

+ 1 - 1
UAS_MES_MAXMADE/PublicMethod/Print.cs

@@ -13,7 +13,7 @@ namespace UAS_MES_MAXMADE.PublicMethod
     class Print
     {
         static DataHelper dh = SystemInf.dh;
-        //CodeSoft打印的驱动和文件
+        //BarTender打印的驱动和文件
         static Document doc;
 
         static LabelFormatDocument format;