Browse Source

添加BarTender打印方式

章政 6 years ago
parent
commit
f8b39a636d

+ 4 - 5
UAS-出货标签管理/CustomControl/PrinterCombox.Designer.cs

@@ -37,19 +37,18 @@
             this.PrinterList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrinterList.FormattingEnabled = true;
             this.PrinterList.Location = new System.Drawing.Point(0, 0);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(284, 26);
+            this.PrinterList.Size = new System.Drawing.Size(189, 20);
             this.PrinterList.TabIndex = 0;
+            this.PrinterList.SelectedIndexChanged += new System.EventHandler(this.PrinterList_SelectedIndexChanged);
             // 
             // PrinterCombox
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.PrinterList);
-            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.Name = "PrinterCombox";
-            this.Size = new System.Drawing.Size(284, 28);
+            this.Size = new System.Drawing.Size(189, 19);
             this.Load += new System.EventHandler(this.PrinterCombox_Load);
             this.ResumeLayout(false);
 

+ 13 - 2
UAS-出货标签管理/CustomControl/PrinterCombox.cs

@@ -16,12 +16,15 @@ namespace UAS_LabelMachine.CustomControl
         {
             InitializeComponent();
         }
+        public delegate void OnSelectIndexChange(object sender, EventArgs e);
+
+        public event OnSelectIndexChange UserOnSelectIndexChange;
 
         public override string Text
         {
             get
             {
-                return PrinterList.Text; 
+                return PrinterList.Text;
             }
 
             set
@@ -30,17 +33,25 @@ namespace UAS_LabelMachine.CustomControl
             }
         }
 
+        bool Loading = true;
+
         private void PrinterCombox_Load(object sender, EventArgs e)
         {
             PrintDocument print = new PrintDocument();
             string sDefault = print.PrinterSettings.PrinterName;//默认打印机名
-
             foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称
             {
                 PrinterList.Items.Add(sPrint);
                 if (sPrint == sDefault)
                     PrinterList.SelectedIndex = PrinterList.Items.IndexOf(sPrint);
             }
+            Loading = false;
+        }
+
+        private void PrinterList_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (!Loading)
+                UserOnSelectIndexChange.Invoke(sender, e);
         }
     }
 }

+ 7 - 2
UAS-出货标签管理/Login.cs

@@ -1,4 +1,5 @@
-using System;
+using Seagull.BarTender.Print;
+using System;
 using System.Data;
 using System.Drawing;
 using System.Drawing.Drawing2D;
@@ -14,13 +15,15 @@ namespace UAS_LabelMachine
         DataHelper dh;
         DataTable dt;
 
+     
+
         public Login()
         {
             InitializeComponent();
             StartPosition = FormStartPosition.CenterScreen;
         }
 
-        protected override void WndProc(ref Message m)
+        protected override void WndProc(ref System.Windows.Forms.Message m)
         {
             //拦截双击标题栏、移动窗体的系统消息  
             if (m.Msg != 0xA3)
@@ -29,6 +32,8 @@ namespace UAS_LabelMachine
 
         private void Login_Load(object sender, EventArgs e)
         {
+            Engine engine = new Engine(true);
+            LabelFormatDocument format = engine.Documents.Open(@"C:\Users\callm\Desktop\GI-1A-5D.btw");
             dh = new DataHelper();
             SystemInf.dh = dh;
             //获取账套信息

+ 142 - 0
UAS-出货标签管理/PublicMethod/Print.cs

@@ -0,0 +1,142 @@
+using LabelManager2;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using UAS_LabelMachine.Entity;
+
+namespace UAS_LabelMachine.PublicMethod
+{
+    class Print
+    {
+        public class CodeSoft
+        {
+            public static void SinglePrint(Document SingleDoc, string[] arg, string pib_id)
+            {
+                Console.WriteLine(UAS_出货标签打印.SingleBoxCacheData.Rows.Count);
+                DataRow[] dr = UAS_出货标签打印.SingleBoxCacheData.Select("pib_id=" + pib_id);
+                for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
+                {
+                    if (arg.Contains(SingleDoc.Variables.FreeVariables.Item(j + 1).Name))
+                        SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][SingleDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
+                    if (SingleDoc.Variables.FreeVariables.Item(j + 1).Value == "")
+                    {
+                        DataRow[] dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
+                        if (dr1.Length > 0)
+                        {
+                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
+                        }
+                    }
+                }
+                SingleDoc.PrintDocument();
+            }
+
+            public static void MidPrint(Document MidDoc, DataTable MidLabelParam, string[] arg, string pib_id, string pib_outboxcode1)
+            {
+                for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
+                {
+                    //将维护的模板参数和模板本身的参数名称进行比对
+                    for (int k = 0; k < MidLabelParam.Rows.Count; k++)
+                    {
+                        //名称相等的时候,取SQL进行值的查询
+                        if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == MidLabelParam.Rows[k]["lp_name"].ToString())
+                        {
+                            //获取对应行的pib_id
+                            //获取打印执行的SQL
+                            string sql = MidLabelParam.Rows[k]["lp_sql"].ToString();
+                            try
+                            {
+                                //获取打印执行的SQL
+                                if (sql.IndexOf("{") == 0)
+                                {
+                                    MidDoc.Variables.FreeVariables.Item(j + 1).Value = SystemInf.dh.GetLabelParam(sql).ToString();
+                                }
+                                else
+                                {
+                                    DataRow[] dr = UAS_出货标签打印.MidBoxCacheData.Select("pib_outboxcode1='" + pib_outboxcode1 + "'");
+                                    if (arg.Contains(MidDoc.Variables.FreeVariables.Item(j + 1).Name))
+                                    {
+                                        if (dr.Length > 0)
+                                        {
+                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][MidDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
+                                        }
+                                    }
+                                    if (MidDoc.Variables.FreeVariables.Item(j + 1).Value == "")
+                                    {
+                                        DataRow[] dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
+                                        if (dr1.Length > 0)
+                                        {
+                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
+                                        }
+                                    }
+                                }
+                            }
+                            catch (Exception)
+                            {
+                                return;
+                            }
+                        }
+                    }
+                }
+                MidDoc.PrintDocument();
+            }
+
+            public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pib_id, string pib_outboxcode2)
+            {
+                for (int j = 0; j < OutBoxDoc.Variables.FreeVariables.Count; j++)
+                {
+                    //将维护的模板参数和模板本身的参数名称进行比对
+                    for (int k = 0; k < OutLabelParam.Rows.Count; k++)
+                    {
+                        //名称相等的时候,取SQL进行值的查询
+                        if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == OutLabelParam.Rows[k]["lp_name"].ToString())
+                        {
+                            //获取对应行的pib_id
+                            //获取打印执行的SQL
+                            string sql = OutLabelParam.Rows[k]["lp_sql"].ToString();
+                            //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
+                            try
+                            {
+                                string ExeSQL = "";
+                                ExeSQL = sql.ToLower().Replace("{pib_id}", "'" + pib_id + "'");
+                                ExeSQL = ExeSQL.Replace("{pib_outboxcode2}", "'" + pib_outboxcode2 + "'");
+                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = SystemInf.dh.GetLabelParam(ExeSQL).ToString();
+                                if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value == "")
+                                {
+                                    DataRow[] dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
+                                    if (dr1.Length > 0)
+                                    {
+                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
+                                    }
+                                }
+                                LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value);
+                            }
+                            catch (Exception)
+                            {
+                                return;
+                            }
+                        }
+                    }
+                }
+                OutBoxDoc.PrintDocument();
+            }
+        }
+
+        public class BarTender
+        {
+            public static void SinglePrint()
+            {
+
+            }
+            public static void MidPrint()
+            {
+
+            }
+            public static void OutPrint()
+            {
+
+            }
+        }
+    }
+}

+ 12 - 10
UAS-出货标签管理/UAS-出货标签管理.csproj

@@ -48,7 +48,7 @@
     <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
+    <PlatformTarget>x86</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
@@ -110,6 +110,7 @@
     <Reference Include="Oracle.ManagedDataAccess">
       <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
     </Reference>
+    <Reference Include="Seagull.BarTender.Print, Version=10.1.4.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7, processorArchitecture=x86" />
     <Reference Include="System" />
     <Reference Include="System.configuration" />
     <Reference Include="System.Core" />
@@ -127,6 +128,12 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="BartenderPreview.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="BartenderPreview.Designer.cs">
+      <DependentUpon>BartenderPreview.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\BlurSearch.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -240,6 +247,7 @@
     <Compile Include="PublicMethod\HttpCommand.cs" />
     <Compile Include="PublicMethod\HttpHandler.cs" />
     <Compile Include="PublicMethod\LogManager.cs" />
+    <Compile Include="PublicMethod\Print.cs" />
     <Compile Include="Service References\Vivo_BoxReelRelation\Reference.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
@@ -289,6 +297,9 @@
     <Compile Include="附件内容打印.Designer.cs">
       <DependentUpon>附件内容打印.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="BartenderPreview.resx">
+      <DependentUpon>BartenderPreview.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\BlurSearch.resx">
       <DependentUpon>BlurSearch.cs</DependentUpon>
     </EmbeddedResource>
@@ -674,15 +685,6 @@
     <None Include="Resources\preview_16px_25980_easyicon.net.png" />
   </ItemGroup>
   <ItemGroup>
-    <COMReference Include="BarTender">
-      <Guid>{D58562C1-E51B-11CF-8941-00A024A9083F}</Guid>
-      <VersionMajor>7</VersionMajor>
-      <VersionMinor>75</VersionMinor>
-      <Lcid>0</Lcid>
-      <WrapperTool>tlbimp</WrapperTool>
-      <Isolated>False</Isolated>
-      <EmbedInteropTypes>False</EmbedInteropTypes>
-    </COMReference>
     <COMReference Include="stdole">
       <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
       <VersionMajor>2</VersionMajor>

+ 23 - 20
UAS-出货标签管理/UAS_出货标签管理.Designer.cs

@@ -152,6 +152,7 @@
             this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.CancelOPPOPlate = new System.Windows.Forms.Button();
             this.OPPOPlate = new System.Windows.Forms.Button();
             this.ViVoPlate = new System.Windows.Forms.Button();
             this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
@@ -180,7 +181,6 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.CancelOPPOPlate = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -1425,6 +1425,19 @@
             this.SingleLabel.TabStop = false;
             this.SingleLabel.Text = "单盘标签";
             // 
+            // CancelOPPOPlate
+            // 
+            this.CancelOPPOPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.CancelOPPOPlate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CancelOPPOPlate.Location = new System.Drawing.Point(10, 169);
+            this.CancelOPPOPlate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CancelOPPOPlate.Name = "CancelOPPOPlate";
+            this.CancelOPPOPlate.Size = new System.Drawing.Size(80, 26);
+            this.CancelOPPOPlate.TabIndex = 43;
+            this.CancelOPPOPlate.Text = "取消Oppo";
+            this.CancelOPPOPlate.UseVisualStyleBackColor = true;
+            this.CancelOPPOPlate.Click += new System.EventHandler(this.CancelOPPOPlate_Click);
+            // 
             // OPPOPlate
             // 
             this.OPPOPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -1457,8 +1470,9 @@
             this.SingleLabelPrinter.Location = new System.Drawing.Point(6, 78);
             this.SingleLabelPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
             this.SingleLabelPrinter.Name = "SingleLabelPrinter";
-            this.SingleLabelPrinter.Size = new System.Drawing.Size(142, 30);
+            this.SingleLabelPrinter.Size = new System.Drawing.Size(142, 25);
             this.SingleLabelPrinter.TabIndex = 40;
+            this.SingleLabelPrinter.UserOnSelectIndexChange += new UAS_LabelMachine.CustomControl.PrinterCombox.OnSelectIndexChange(this.LabelPrinter_UserOnSelectIndexChange);
             // 
             // SingleLabelPrint
             // 
@@ -1557,8 +1571,9 @@
             this.MidLabelPrinter.Location = new System.Drawing.Point(6, 78);
             this.MidLabelPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
             this.MidLabelPrinter.Name = "MidLabelPrinter";
-            this.MidLabelPrinter.Size = new System.Drawing.Size(142, 30);
+            this.MidLabelPrinter.Size = new System.Drawing.Size(142, 25);
             this.MidLabelPrinter.TabIndex = 41;
+            this.MidLabelPrinter.UserOnSelectIndexChange += new UAS_LabelMachine.CustomControl.PrinterCombox.OnSelectIndexChange(this.LabelPrinter_UserOnSelectIndexChange);
             // 
             // label15
             // 
@@ -1701,8 +1716,9 @@
             this.OutBoxPrinter.Location = new System.Drawing.Point(8, 78);
             this.OutBoxPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
             this.OutBoxPrinter.Name = "OutBoxPrinter";
-            this.OutBoxPrinter.Size = new System.Drawing.Size(158, 30);
+            this.OutBoxPrinter.Size = new System.Drawing.Size(158, 25);
             this.OutBoxPrinter.TabIndex = 82;
+            this.OutBoxPrinter.UserOnSelectIndexChange += new UAS_LabelMachine.CustomControl.PrinterCombox.OnSelectIndexChange(this.LabelPrinter_UserOnSelectIndexChange);
             // 
             // OutboxCapacity
             // 
@@ -1767,19 +1783,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // CancelOPPOPlate
-            // 
-            this.CancelOPPOPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.CancelOPPOPlate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CancelOPPOPlate.Location = new System.Drawing.Point(10, 169);
-            this.CancelOPPOPlate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CancelOPPOPlate.Name = "CancelOPPOPlate";
-            this.CancelOPPOPlate.Size = new System.Drawing.Size(80, 26);
-            this.CancelOPPOPlate.TabIndex = 43;
-            this.CancelOPPOPlate.Text = "取消Oppo";
-            this.CancelOPPOPlate.UseVisualStyleBackColor = true;
-            this.CancelOPPOPlate.Click += new System.EventHandler(this.CancelOPPOPlate_Click);
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1860,7 +1863,6 @@
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder OutBoxLabel;
         private CustomControl.EnterTextBox OutBoxNum;
         private System.Windows.Forms.Label label10;
-        private CustomControl.PrinterCombox OutBoxPrinter;
         private System.Windows.Forms.Button OutBoxLabelPrint;
         private System.Windows.Forms.ComboBox OutBoxCombox;
         private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
@@ -1890,7 +1892,6 @@
         private System.Windows.Forms.Button MidLabelPrint;
         private System.Windows.Forms.NumericUpDown MidBoxCapacity;
         private System.Windows.Forms.Label label15;
-        private CustomControl.PrinterCombox MidLabelPrinter;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label label5;
         private CustomControl.EnterTextBox MidLabelNum;
@@ -1898,7 +1899,6 @@
         private System.Windows.Forms.ComboBox SingleLabelCombox;
         private System.Windows.Forms.CheckBox SingleLabelAutoPrint;
         private System.Windows.Forms.Button SingleLabelPrint;
-        private CustomControl.PrinterCombox SingleLabelPrinter;
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder SingleLabel;
         private CustomControl.EnterTextBox pi_inoutno;
         private System.Windows.Forms.Label pi_inoutno_label;
@@ -2008,5 +2008,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private CustomControl.SearchTextBox cu_code;
         private System.Windows.Forms.Button CancelOPPOPlate;
+        public CustomControl.PrinterCombox OutBoxPrinter;
+        public CustomControl.PrinterCombox MidLabelPrinter;
+        public CustomControl.PrinterCombox SingleLabelPrinter;
     }
 }

+ 75 - 232
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -15,8 +15,8 @@ using UAS_LabelMachine.PublicForm;
 using System.Threading;
 using System.IO;
 using System.Globalization;
-using System.Threading.Tasks;
 using System.Reflection;
+using Seagull.BarTender.Print;
 
 namespace UAS_LabelMachine
 {
@@ -27,6 +27,8 @@ namespace UAS_LabelMachine
 
         DataHelper dh;
 
+        Engine engine;
+
         DataTable dt;
         /// <summary>
         /// 已经打印过的Vivo外箱号
@@ -94,7 +96,7 @@ namespace UAS_LabelMachine
 
         Dictionary<string, string> CollectData;
         //缓存单盘数据数据的DataTable
-        DataTable SingleBoxCacheData;
+        public static DataTable SingleBoxCacheData;
         /// <summary>
         /// 存放单盘的ID
         /// </summary>
@@ -106,7 +108,7 @@ namespace UAS_LabelMachine
         /// <summary>
         /// 中盒缓存数据
         /// </summary>
-        DataTable MidBoxCacheData;
+        public static DataTable MidBoxCacheData;
         /// <summary>
         /// 存放中盒的ID和盒号
         /// </summary>
@@ -144,7 +146,9 @@ namespace UAS_LabelMachine
 
         List<string> OutParam = new List<string>();
 
-        DataTable Attach;
+        public static DataTable Attach;
+
+        string PrintMethod = "CodeSoft";
 
         public UAS_出货标签打印(string Master)
         {
@@ -157,7 +161,7 @@ namespace UAS_LabelMachine
             Text = Text + "-" + Master;
         }
 
-        protected override void WndProc(ref Message m)
+        protected override void WndProc(ref System.Windows.Forms.Message m)
         {
             //拦截双击标题栏、移动窗体的系统消息
             if (m.Msg != 0xA3)
@@ -243,14 +247,23 @@ namespace UAS_LabelMachine
             }
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
-            //实例化打印进程
-            try
+            //实例化打印进程,如果没有配置默认使用BarTener
+            string Code = dh.GetConfig("", "").ToString();
+            if (Code == "")
             {
-                lbl = new ApplicationClass();
+                try
+                {
+                    lbl = new ApplicationClass();
+                }
+                catch (Exception)
+                {
+                    MessageBox.Show("未安装CodeSoft软件或者版本不正确");
+                }
             }
-            catch (Exception)
+            else
             {
-                MessageBox.Show("未安装CodeSoft软件或者版本不正确");
+                engine = new Engine(true);
+                PrintMethod = "BarTender";
             }
             RefreshDBConnect.Interval = 60000;
             RefreshDBConnect.Start();
@@ -562,13 +575,7 @@ namespace UAS_LabelMachine
                                 CurrentRowIndex = i;
                                 if (SingleLabelAutoPrint.Checked)
                                 {
-                                    if (la_id != "")
-                                        AutoPrintSingleLabel(la_id, LabelUrl);
-                                    else
-                                    {
-                                        MessageBox.Show("未维护单盘标签");
-                                        return;
-                                    }
+                                    AutoPrintSingleLabel();
                                 }
                                 if (MidLabelAutoPrint.Checked)
                                     AutoPrintMidLabel();
@@ -603,7 +610,7 @@ namespace UAS_LabelMachine
                                 string la_id = SingleLabelCombox.SelectedValue.ToString().Split('#')[0];
                                 string cl_labelname = SingleLabelCombox.Text;
                                 string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
-                                AutoPrintSingleLabel(la_id, LabelUrl);
+                                AutoPrintSingleLabel();
                             }
                             else
                             {
@@ -676,38 +683,15 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void AutoPrintSingleLabel(string la_id, string LabelUrl)
+        private void AutoPrintSingleLabel()
         {
             //用标签本身的变量作为最外层的循环条件去匹配;
             string[] arg = SingleBoxArgument.ToArray();
-            StringBuilder ParamLog = new StringBuilder();
-            for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
+            string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
+            if (PrintMethod == "CodeSoft")
             {
-                //将维护的模板参数和模板本身的参数名称进行比对
-                for (int k = 0; k < SingleLabelParam.Rows.Count; k++)
-                {
-                    //名称相等的时候,取SQL进行值的查询
-                    if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == SingleLabelParam.Rows[k]["lp_name"].ToString().ToLower())
-                    {
-                        string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
-                        DataRow[] dr = SingleBoxCacheData.Select("pib_id=" + pib_id);
-                        if (arg.Contains(SingleDoc.Variables.FreeVariables.Item(j + 1).Name))
-                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][SingleDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
-                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Value == "")
-                        {
-                            DataRow[] dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                            if (dr1.Length > 0)
-                            {
-                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                            }
-                        }
-                        ParamLog.AppendLine("pib_id:" + LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString() + ",SingleDoc打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                    }
-                }
+                Print.CodeSoft.SinglePrint(SingleDoc, arg, pib_id);
             }
-            LogManager.DoLog(ParamLog.ToString());
-            SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
-            SingleDoc.PrintDocument();
             LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
         }
 
@@ -1056,6 +1040,7 @@ namespace UAS_LabelMachine
             if (SingleLabelCombox.Text != "")
             {
                 SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
+                SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
                 SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
                 for (int i = 0; i < SingleDoc.Variables.FreeVariables.Count; i++)
                 {
@@ -1085,6 +1070,7 @@ namespace UAS_LabelMachine
             if (MidLabelCombox.Text != "")
             {
                 MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
+                MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
                 MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
             }
             //缓存中盒参数
@@ -1111,6 +1097,7 @@ namespace UAS_LabelMachine
             if (OutBoxCombox.Text != "")
             {
                 OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
+                OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
                 OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
             }
             //缓存外箱参数
@@ -1270,25 +1257,8 @@ namespace UAS_LabelMachine
                         try
                         {
                             string pib_id = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
-                            DataRow[] dr = SingleBoxCacheData.Select("pib_id=" + pib_id);
-                            StringBuilder ParamLog = new StringBuilder();
-                            for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
-                            {
-                                if (arg.Contains(SingleDoc.Variables.FreeVariables.Item(j + 1).Name))
-                                    SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][SingleDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
-                                if (SingleDoc.Variables.FreeVariables.Item(j + 1).Value == "")
-                                {
-                                    DataRow[] dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                                    if (dr1.Length > 0)
-                                    {
-                                        SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                                    }
-                                }
-                                ParamLog.AppendLine("pib_id:" + LabelInf.Rows[i].Cells["pib_id1"].Value.ToString() + ",SingleDoc打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                            LogManager.DoLog(ParamLog.ToString());
-                            SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
-                            SingleDoc.PrintDocument();
+                            if (PrintMethod == "CodeSoft")
+                                Print.CodeSoft.SinglePrint(SingleDoc, arg, pib_id);
                             if (MidLabelAutoPrint.Checked)
                             {
                                 //判断当前行的盒号和下一行不相等或者已经是最后一行了
@@ -1299,7 +1269,7 @@ namespace UAS_LabelMachine
                                         if (MidLabelCombox.SelectedValue != null)
                                         {
                                             string la_id_mid = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
-                                            MidBoxCodePrint(la_id_mid, CurrentRowIndex);
+                                            MidBoxCodePrint(CurrentRowIndex);
                                         }
                                     }
                                 }
@@ -1590,7 +1560,7 @@ namespace UAS_LabelMachine
                 GetMidBoxData();
                 for (int i = 0; i < MidOutBoxCodeIndex.Count; i++)
                 {
-                    MidBoxCodePrint(la_id, MidOutBoxCodeIndex[i]);
+                    MidBoxCodePrint(MidOutBoxCodeIndex[i]);
                 }
                 MidBoxArgument.Clear();
                 MidBoxCacheData.Clear();
@@ -1620,7 +1590,7 @@ namespace UAS_LabelMachine
                 }
                 //找到了指定的盒号
                 if (FindMidLabel)
-                    MidBoxCodePrint(la_id, MidLabelRowIndex, MidRowIndex.ToArray());
+                    MidBoxCodePrint(MidLabelRowIndex);
                 else
                     MessageBox.Show("该出入库单未找到该中盒号!");
             }
@@ -1673,7 +1643,7 @@ namespace UAS_LabelMachine
                             {
                                 if (LabelInf.Rows[h].Cells["pib_outboxcode2"].Value.ToString() == Outboxcode.ToArray()[i])
                                 {
-                                    OutBoxCodePrint(la_id, h);
+                                    OutBoxCodePrint(h);
                                     break;
                                 }
                             }
@@ -1705,7 +1675,7 @@ namespace UAS_LabelMachine
                     }
                     //找到了指定的盒号
                     if (FindMidLabel)
-                        OutBoxCodePrint(la_id, OutBoxLabelRowIndex);
+                        OutBoxCodePrint(OutBoxLabelRowIndex);
                     else
                         MessageBox.Show("该出入库单未找到该外箱号!");
                 }
@@ -1714,179 +1684,32 @@ namespace UAS_LabelMachine
             Outboxcode.Clear();
         }
 
-        private void MidBoxCodePrint(string la_id, int rowindex)
+        private void MidBoxCodePrint(int rowindex)
         {
             if (MidBoxCacheData.Rows.Count == 0)
             {
                 MidIDAndOutboxcode.Add(LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString());
                 GetMidBoxData();
             }
-            DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");
             string[] arg = MidBoxArgument.ToArray();
-            for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
-            {
-                //将维护的模板参数和模板本身的参数名称进行比对
-                for (int k = 0; k < MidLabelParam.Rows.Count; k++)
-                {
-                    //名称相等的时候,取SQL进行值的查询
-                    if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == MidLabelParam.Rows[k]["lp_name"].ToString())
-                    {
-                        //获取对应行的pib_id
-                        string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
-                        string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
-                        //获取打印执行的SQL
-                        string sql = MidLabelParam.Rows[k]["lp_sql"].ToString();
-                        try
-                        {
-                            //获取打印执行的SQL
-                            if (sql.IndexOf("{") == 0)
-                            {
-                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
-                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + dt.Rows[k]["lp_sql"].ToString() + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                            else
-                            {
-                                DataRow[] dr = MidBoxCacheData.Select("pib_outboxcode1='" + pib_outboxcode1 + "'");
-                                if (arg.Contains(MidDoc.Variables.FreeVariables.Item(j + 1).Name))
-                                {
-                                    if (dr.Length > 0)
-                                    {
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr[0][MidDoc.Variables.FreeVariables.Item(j + 1).Name].ToString();
-                                    }
-                                }
-                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Value == "")
-                                {
-                                    DataRow[] dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                                    if (dr1.Length > 0)
-                                    {
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                                    }
-                                }
-                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                        }
-                        catch (Exception)
-                        {
-                            LogManager.DoLog("SQL维护不正确,请检查SQL语句\n" + sql);
-                            return;
-                        }
-                    }
-                }
-            }
-            MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
-            MidDoc.PrintDocument();
-        }
-
-        private void MidBoxCodePrint(string la_id, int rowindex, int[] midindex)
-        {
-            for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
-            {
-                //将维护的模板参数和模板本身的参数名称进行比对
-                for (int k = 0; k < MidLabelParam.Rows.Count; k++)
-                {
-                    //名称相等的时候,取SQL进行值的查询
-                    if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == MidLabelParam.Rows[k]["lp_name"].ToString())
-                    {
-                        //获取对应行的pib_id
-                        string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
-                        string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
-                        //获取打印执行的SQL
-                        string sql = MidLabelParam.Rows[k]["lp_sql"].ToString();
-                        try
-                        {
-                            //获取打印执行的SQL
-                            if (sql.IndexOf("{") == 0)
-                            {
-                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
-                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + dt.Rows[k]["lp_sql"].ToString() + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                            else
-                            {
-                                if (sql.ToLower().Contains("pib_qty"))
-                                {
-                                    sql = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                    sql = sql.Substring(0, sql.LastIndexOf("=")) + "='" + pib_outboxcode1 + "' group by pib_outboxcode1";
-                                }
-                                else
-                                {
-                                    sql = sql.Substring(0, sql.IndexOf("{"));
-                                    sql = sql.Substring(0, sql.LastIndexOf("="));
-                                    sql = sql + " in (select distinct pib_outboxcode1 from PRODIOBARCODE where pib_inoutno='" + pi_inoutno.Text + "')" + " and pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1='" + pib_outboxcode1 + "'";
-                                }
-                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
-                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Value == "")
-                                {
-                                    DataRow[] dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                                    if (dr1.Length > 0)
-                                    {
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                                    }
-                                }
-                                LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                        }
-                        catch (Exception)
-                        {
-                            LogManager.DoLog("SQL维护不正确,请检查SQL语句\n" + sql);
-                            return;
-                        }
-                    }
-                }
-            }
-            MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
-            MidDoc.PrintDocument();
+            //获取对应行的pib_id
+            string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
+            string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
+            if (PrintMethod == "CodeSoft")
+                Print.CodeSoft.MidPrint(MidDoc, MidLabelParam, arg, pib_id, pib_outboxcode1);
         }
 
         /// <summary>
         /// 执行打印外箱号
         /// </summary>
-        private void OutBoxCodePrint(string la_id, int rowindex)
+        private void OutBoxCodePrint(int rowindex)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + la_id, "select");
             try
-            {
-                for (int j = 0; j < OutBoxDoc.Variables.FreeVariables.Count; j++)
-                {
-                    //将维护的模板参数和模板本身的参数名称进行比对
-                    for (int k = 0; k < OutLabelParam.Rows.Count; k++)
-                    {
-                        //名称相等的时候,取SQL进行值的查询
-                        if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == OutLabelParam.Rows[k]["lp_name"].ToString())
-                        {
-                            //获取对应行的pib_id
-                            string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
-                            string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
-                            //获取打印执行的SQL
-                            string sql = OutLabelParam.Rows[k]["lp_sql"].ToString();
-                            //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                            try
-                            {
-                                string ExeSQL = "";
-                                ExeSQL = sql.ToLower().Replace("{pib_id}", "'" + pib_id + "'");
-                                ExeSQL = ExeSQL.Replace("{pib_outboxcode2}", "'" + pib_outboxcode2 + "'");
-                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value == "")
-                                {
-                                    DataRow[] dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "'");
-                                    if (dr1.Length > 0)
-                                    {
-                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
-                                    }
-                                }
-                                LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value);
-                            }
-                            catch (Exception)
-                            {
-                                LogManager.DoLog("SQL维护不正确,请检查SQL语句" + sql);
-                                MessageBox.Show("SQL维护不正确,请检查SQL语句\n" + sql);
-                                return;
-                            }
-                        }
-                    }
-                }
-                OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
-                OutBoxDoc.PrintDocument();
-                LogManager.DoLog("执行打印外箱,pib_id:" + LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString());
+            {  //获取对应行的pib_id
+                string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
+                string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
+                if (PrintMethod == "CodeSoft")
+                    Print.CodeSoft.OutPrint(OutBoxDoc, OutLabelParam, pib_id, pib_outboxcode2);
             }
             catch (Exception ex) { MessageBox.Show(ex.Message); }
         }
@@ -2035,7 +1858,7 @@ namespace UAS_LabelMachine
             bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
             if (e.ColumnIndex > 0)
             {
-                if (LabelInf.Columns[e.ColumnIndex].Name == "pib_custbarcode"|| LabelInf.Columns[e.ColumnIndex].Name == "pib_barcode"||LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" || LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode1" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode2" || LabelInf.Columns[e.ColumnIndex].Name == "pib_brand")
+                if (LabelInf.Columns[e.ColumnIndex].Name == "pib_custbarcode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_barcode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" || LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode1" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode2" || LabelInf.Columns[e.ColumnIndex].Name == "pib_brand")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
                     e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
@@ -2100,7 +1923,7 @@ namespace UAS_LabelMachine
             {
                 if (!PrintedVivoOutboxCode.Contains(CusOutBoxCode[i].ToString()))
                 {
-                    OutBoxCodePrint(la_id, CusOutBoxCode[i]);
+                    OutBoxCodePrint(CusOutBoxCode[i]);
                     PrintedVivoOutboxCode.Add(CusOutBoxCode[i].ToString());
                 }
             }
@@ -2172,8 +1995,7 @@ namespace UAS_LabelMachine
             {
                 if (MidLabelCombox.SelectedValue != null)
                 {
-                    string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
-                    MidBoxCodePrint(la_id, CurrentRowIndex);
+                    MidBoxCodePrint(CurrentRowIndex);
                 }
                 else
                     MessageBox.Show("未维护中盒模板");
@@ -2672,5 +2494,26 @@ namespace UAS_LabelMachine
                 }
             }
         }
+
+        private void LabelPrinter_UserOnSelectIndexChange(object sender, EventArgs e)
+        {
+            switch ((sender as Control).Parent.Name)
+            {
+                case "SingleLabelPrinter":
+                    if (SingleDoc != null)
+                        SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
+                    break;
+                case "MidLabelPrinter":
+                    if (MidDoc != null)
+                        MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
+                    break;
+                case "OutBoxPrinter":
+                    if (OutBoxDoc != null)
+                        OutBoxDoc.Printer.SwitchTo(OutBoxLabelPrint.Text);
+                    break;
+                default:
+                    break;
+            }
+        }
     }
 }

BIN
UAS-出货标签管理/tool/BarTenderPrintClient.dll


BIN
UAS-出货标签管理/tool/Seagull.BarTender.Print.dll