Browse Source

吉利通项目提交

章政 7 years ago
parent
commit
ceb08aa412

+ 3 - 3
UAS-出货标签管理(吉利通)/CustomControl/GroupBoxWithBorder.cs

@@ -18,9 +18,9 @@ namespace UAS_LabelMachine.CustomControl.GroupBoxWithBorder
             Pen LineColor = Pens.Gray;
             e.Graphics.DrawLine(LineColor, 1, 7, 8, 7);
             e.Graphics.DrawLine(LineColor, e.Graphics.MeasureString(this.Text, this.Font).Width + 8, 7, this.Width - 2, 7);
-            e.Graphics.DrawLine(LineColor, 1, 7, 1, this.Height - 2);
-            e.Graphics.DrawLine(LineColor, 1, this.Height - 2, this.Width - 2, this.Height - 2);
-            e.Graphics.DrawLine(LineColor, this.Width - 2, 7, this.Width - 2, this.Height - 2);
+            //e.Graphics.DrawLine(LineColor, 1, 7, 1, this.Height - 2);
+            //e.Graphics.DrawLine(LineColor, 1, this.Height - 2, this.Width - 2, this.Height - 2);
+            //e.Graphics.DrawLine(LineColor, this.Width - 2, 7, this.Width - 2, this.Height - 2);
         }
     }
 }

+ 60 - 0
UAS-出货标签管理(吉利通)/ParamSetting.Designer.cs

@@ -0,0 +1,60 @@
+namespace UAS_LabelMachine
+{
+    partial class ParamSetting
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.SuspendLayout();
+            // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(12, 28);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(823, 100);
+            this.groupBoxWithBorder1.TabIndex = 0;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "groupBoxWithBorder1";
+            // 
+            // ParamSetting
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(847, 561);
+            this.Controls.Add(this.groupBoxWithBorder1);
+            this.MaximizeBox = false;
+            this.Name = "ParamSetting";
+            this.Text = "参数设置";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+    }
+}

+ 19 - 0
UAS-出货标签管理(吉利通)/ParamSetting.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace UAS_LabelMachine
+{
+    public partial class ParamSetting : Form
+    {
+        public ParamSetting()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 120 - 0
UAS-出货标签管理(吉利通)/ParamSetting.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 997 - 0
UAS-出货标签管理(吉利通)/PublicMethod/AccessDBHelper.cs

@@ -0,0 +1,997 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.OleDb;
+using System.IO;
+using System.Text;
+using System.Windows.Forms;
+
+
+namespace UAS_LabelMachine
+{
+    class AccessDBHelper
+    {
+        private string _fileName;
+        private string _connectionString;
+        private OleDbConnection _odcConnection = null;
+        private OleDbCommand command = null;
+
+        public AccessDBHelper(string fileName)
+        {
+            this._fileName = fileName;
+            this._connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";";
+            Open();
+        }
+
+
+        public AccessDBHelper(string fileName, string password)
+        {
+            this._fileName = fileName;
+            this._connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Jet OLEDB:Database Password=" + password + ";";
+            Open();
+        }
+
+        public void Open()
+        {
+            try
+            {
+                // 建立连接
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                // 打开连接
+                this._odcConnection.Open();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+        }
+
+        public void Close()
+        {
+            this._odcConnection.Close();
+        }
+
+
+        public DataTable GetDataTable(string sql)
+        {
+            DataTable ds = new DataTable();
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter adapter = new OleDbDataAdapter(command);
+            try
+            {
+                adapter.Fill(ds);
+            }
+            catch (Exception ex)
+            {
+                throw new Exception("sql語句: " + sql + " 執行失敗!" + ex.Message);
+            }
+            adapter.Dispose();
+            return ds;
+        }
+
+        public DataSet GetDataSet(string sql)
+        {
+            DataSet ds = new DataSet();
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter adapter = new OleDbDataAdapter(command);
+            try
+            {
+                adapter.Fill(ds);
+            }
+            catch (Exception ex)
+            {
+                throw new Exception("sql語句: " + sql + " 執行失敗!" + ex.Message);
+            }
+            adapter.Dispose();
+            return ds;
+        }
+
+        public void Reconnect(OleDbCommand cmd)
+        {
+            if (cmd.Connection.State == ConnectionState.Closed)
+            {
+                cmd.Connection.Open();
+                //超时重连
+            }
+        }
+
+        /// <summary>
+        /// 根据表名获取该表字段数据类型
+        /// </summary>
+        public DataTable GetColumnDataType(string TableName)
+        {
+            DataTable dt = new DataTable();
+            command = new OleDbCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 获取第一行第一列的信息
+        /// </summary>
+        public object getFieldDataByCondition(string TableName, string Field, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter();
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            if (dt.Rows.Count > 0)
+            {
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+        public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
+        {
+            command = new OleDbCommand(sql, _odcConnection);
+            OleDbDataAdapter adapter = new OleDbDataAdapter();
+            adapter.UpdateBatchSize = param1[0].Length;
+            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
+            //将第一个数组的下标固定为0作为循环添加的参数的名称
+            for (int i = 0; i < param.Length; i++)
+            {
+                command.Parameters.Add(new OleDbParameter(param[i].ToString(), param1[i]));
+            }
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+
+            }
+            command.Dispose();
+        }
+
+        public void DeleleFile(string accessFile )
+        {
+            var dbe = new Microsoft.Office.Interop.Access.Dao.DBEngine();
+            try
+            {
+                string tempFile = Path.Combine(Path.GetDirectoryName(accessFile),Path.GetRandomFileName() + Path.GetExtension(accessFile));
+                dbe.CompactDatabase(accessFile, tempFile);
+                FileInfo temp = new FileInfo(tempFile);
+                temp.CopyTo(accessFile, true);
+                temp.Delete();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine("Error: " + e.Message);
+            }
+        }
+
+        public void SaveDataTable(DataTable dt, string TableName)
+        {
+            StringBuilder sb = new StringBuilder();
+            //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
+            DataTable data = (DataTable)ExecuteSql("select top 1 * from " + TableName, "select");
+            //将所有的字段拼接起来
+            for (int i = 0; i < data.Columns.Count; i++)
+            {
+                sb.Append("#" + data.Columns[i].ColumnName.ToString().ToUpper());
+            }
+            //移除掉所有不属于该表的列
+            for (int i = dt.Columns.Count - 1; i >= 0; i--)
+            {
+                if (!sb.ToString().Contains(dt.Columns[i].ColumnName.ToUpper()))
+                {
+                    dt.Columns.RemoveAt(i);
+                }
+            }
+            sb.Clear();
+            sb.Append("insert into prodiobarcode (");
+            string field = "";
+            string valuefield = "";
+            for (int i = 0; i < dt.Columns.Count; i++)
+            {
+                if (i != dt.Columns.Count - 1)
+                {
+                    field += dt.Columns[i].ColumnName + ",";
+                    valuefield += "?,";
+                }
+                else
+                {
+                    field += dt.Columns[i].ColumnName + "";
+                    valuefield += "?";
+                }
+            }
+            sb.Append(field + ") values(" + valuefield + ")");
+            OleDbTransaction tx = this._odcConnection.BeginTransaction();
+            command = new OleDbCommand();
+            command.Connection = this._odcConnection;
+            command.Transaction = tx;
+            string sql = sb.ToString();
+            try
+            {
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    command.CommandText = sql;
+                    for (int j = 0; j < dt.Columns.Count; j++)
+                    {
+                        command.Parameters.AddWithValue(dt.Columns[j].ColumnName, dt.Rows[i][j]);
+                    }
+                    try
+                    {
+                        command.ExecuteNonQuery();
+                        command.Parameters.Clear();
+                    }
+                    catch (Exception e)
+                    {
+                        MessageBox.Show(e.Message.ToString());
+                    }
+                }
+                tx.Commit();
+            }
+            catch (Exception E)
+            {
+                tx.Rollback();
+                throw new Exception(E.Message);
+            }
+            command.Dispose();
+            //string[][] param_array = new string[dt.Columns.Count][];
+            //for (int i = 0; i < dt.Columns.Count; i++)
+            //{
+            //    param_array[i] = new string[dt.Rows.Count];
+            //}
+            ////变量所有的行,如果有主键为空的则移除,不为空的进行参数的拼接
+            //for (int i = dt.Rows.Count - 1; i >= 0; i--)
+            //{
+            //    //当为新添加行的时候才去设置参数,设置过后索引+1
+            //    for (int j = 0; j < dt.Columns.Count; j++)
+            //    {
+            //        param_array[j][i] = dt.Rows[i][j].ToString();
+            //    }
+            //}
+            //for (int i = 0; i < dt.Columns.Count; i++)
+            //{
+            //    command.Parameters.AddWithValue(dt.Columns[i].ColumnName, param_array[i]);
+            //}
+            //command.ExecuteNonQuery();
+        }
+
+        public void BatchInsert(string tableName, DataTable dt)
+        {
+            List<string> columnList = new List<string>();
+            foreach (DataColumn one in dt.Columns)
+            {
+                columnList.Add(one.ColumnName);
+            }
+            OleDbDataAdapter adapter = new OleDbDataAdapter();
+            adapter.SelectCommand = new OleDbCommand("select pib_id from " + tableName, this._odcConnection);
+            using (OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter))
+            {
+                adapter.InsertCommand = builder.GetInsertCommand();
+                for (int i = 0; i < adapter.InsertCommand.Parameters.Count; i++)
+                {
+                    Console.WriteLine(adapter.InsertCommand.Parameters[i].ParameterName);
+                }
+                foreach (string one in columnList)
+                {
+                    Console.WriteLine(one.ToLower());
+                    adapter.InsertCommand.Parameters.Add(new OleDbParameter(one.ToLower(), "Test"));
+                }
+                Console.WriteLine(adapter.Update(dt));
+            }
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,带条件
+        /// </summary>
+        /// <returns></returns>
+        public int getRowCount(string TableName, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,不带条件
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <returns></returns>
+        public int getRowCount(string TableName)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 通过表名和获取单行的记录
+        /// </summary>
+        public DataTable getFieldsDataByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition + " and rownum=1";
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 将DataTable导入到指定的表中
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        public void InsertDataTable(DataTable DataTable, string TableName)
+        {
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                for (int j = 0; j < DataTable.Columns.Count; j++)
+                {
+
+                }
+            }
+        }
+
+        /// <summary>
+        /// 按分页获取数据
+        /// </summary>
+        /// <param name="TableName">表名</param>
+        /// <param name="Fields">查询字段</param>
+        /// <param name="CurrentPage">当前页面</param>
+        /// <param name="PageSize">页面展示条数</param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        // SELECT * FROM (SELECT   A.*  FROM (SELECT* FROM datalist) A WHERE ROWNUM <= 50) WHERE ROWNUM >= 21
+        public DataTable getFieldsDatasByPageing(string TableName, string Fields, int CurrentPage, int PageSize, string Caller, params string[] condition)
+        {
+            DataTable dt = new DataTable();
+            StringBuilder sql = new StringBuilder();
+            //先查询出配置出去的列
+            //获取查询的列
+            string[] caption = GetCaptionFromField(Fields);
+            //获取对应列的描述
+            string[] field = GetField(Fields);
+            sql.Append(" select * from (select RowNum RN, A.* from (select ");
+            sql.Append(AddField(caption));
+            if (condition.Length > 0)
+            {
+                if (condition[0] != null && condition[0].Trim() != "")
+                    sql.Append(" from " + TableName + " where " + condition[0] + " ) A where ROWNUM <=" + CurrentPage * PageSize + ") where RN>" + (CurrentPage - 1) * PageSize);
+                else
+                    sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
+            }
+            command = new OleDbCommand(sql.ToString(), this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            dt.Columns.RemoveAt(0);
+            foreach (DataColumn dc in dt.Columns)
+            {
+                dc.ColumnName = field[dt.Columns.IndexOf(dc)];
+                dc.Caption = caption[dt.Columns.IndexOf(dc)];
+            }
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段和条件获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatasByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition;
+
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatas(string TableName, string Fields)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += Fields;
+            sql += " from " + TableName;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+
+        /// <summary>
+        /// 获取DbFind的数据的DataTable的结构
+        /// </summary>
+        /// <param name="field"></param>
+        /// <param name="caller"></param>
+        /// <returns></returns>
+        public DataTable GetDbFindDataTable(string field, string caller)
+        {
+            string sql = "select * from dbfindsetui where ds_caller='" + caller + "' and ds_whichui='" + field + "'";
+            DataTable dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count != 0)
+            {
+                //通过#号分割字段
+                string[] dbfield = dt.Rows[0]["ds_findtoui"].ToString().Split('#');
+                string[] cnfield = dt.Rows[0]["ds_dbcaption"].ToString().Split('#');
+                //获取查询要查询的Table
+                string dbtable = dt.Rows[0]["ds_tables"].ToString();
+                //拼接查询的字段
+                for (int i = 0; i < dbfield.Length; i++)
+                {
+                    dbfield[i] = dbfield[i].Split(',')[0];
+                }
+                //新建一个空的DataTable
+                DataTable dt1 = new DataTable();
+                //往空的DataTable添加结构,ColumnName是中文,Caption是实际的字段名称
+                for (int i = 0; i < cnfield.Length; i++)
+                {
+                    dt1.Columns.Add(cnfield[i]);
+                    dt1.Columns[i].Caption = dbfield[i];
+                }
+                //返回一个带有结构的空的DataTable
+                //DbFind.BindTable1 = dbtable;
+                return dt1;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// 检测内容是否存在
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        /// <returns></returns>
+        public bool CheckExist(string TableName, string Condition)
+        {
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            DataTable dt = new DataTable();
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString()) > 0;
+        }
+
+        /// <summary>
+        /// 直接执行SQL,同时传入SQL的类型
+        /// </summary>
+        /// <param name="SQL"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public object ExecuteSql(string SQL, string Type, params object[] names)
+        {
+            object result = null;
+            command = new OleDbCommand(SQL, this._odcConnection);
+            Reconnect(command);
+            //用来拼接参数的
+            if (names.Length > 0)
+            {
+                string[] par = SQL.Split(':');
+                //用来存参数的数组
+                StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+                for (int i = 0; i < par.Length - 1; i++)
+                {
+                    //新建一个char类型的数组用来存储每个字节的变量
+                    char[] c = par[i + 1].ToCharArray();
+                    addpar[i] = new StringBuilder();
+                    for (int j = 0; j < c.Length; j++)
+                    {
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                        {
+                            addpar[i].Append(c[j]);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+                for (int i = 0; i < addpar.Length; i++)
+                    command.Parameters.Add(new OleDbParameter(addpar[i].ToString(), names[i]));
+            }
+
+            switch (Type.ToUpper())
+            {
+                case "SELECT":
+                    OleDbDataAdapter ad = new OleDbDataAdapter(command);
+                    result = new DataTable();
+                    try
+                    {
+                        ad.Fill((DataTable)result);
+                    }
+                    catch (Exception)
+                    {
+                        this._odcConnection = new OleDbConnection(this._connectionString);
+                        this._odcConnection.Open();
+                        command = new OleDbCommand(SQL, this._odcConnection);
+                        ad = new OleDbDataAdapter();
+                        ad.SelectCommand = command;
+                        ad.Fill((DataTable)result);
+                    }
+                    break;
+                case "DELETE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OleDbConnection(this._connectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "UPDATE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OleDbConnection(this._connectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "INSERT":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OleDbConnection(this._connectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+            }
+            command.Dispose();
+            return result;
+        }
+
+        /// <summary>
+        /// 为了同步BS端的条码维护,检测时允许问号的存在,在检测时默认将问号换成:Param参数
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void CheckSQL(string SQL)
+        {
+            SQL = SQL.Replace("?", ":Param");
+            command = new OleDbCommand(SQL, this._odcConnection);
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        public int GetDistinctRowCount(string TableName, string Field)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select distinct count('" + Field + "') from " + TableName;
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 根据Caller获取流水号
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public string GetSerialNumberByCaller(string Caller)
+        {
+            string SerialNumber = getFieldDataByCondition("MaxNumbers", "mn_number", "mn_tablename='" + Caller + "'").ToString();
+            UpdateByCondition("MaxNumbers", "mn_number=mn_number+1", "mn_tablename='" + Caller + "'");
+            return SerialNumber;
+        }
+
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string GetSEQ(string SeqName)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("SELECT " + SeqName + ".NEXTVAL FROM DUAL", "select");
+            return dt.Rows[0][0].ToString();
+        }
+
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string[] GetSEQ(string SeqName, int Num)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("SELECT " + SeqName + ".nextval  FROM DUAL CONNECT BY LEVEL<=" + Num, "select");
+            string[] SerialNum = new string[dt.Rows.Count];
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                SerialNum[i] = dt.Rows[i][0].ToString();
+            }
+            return SerialNum;
+        }
+
+        /// <summary>
+        /// 取Configs表中的配置,进行该客户是否执行某个操作
+        /// </summary>
+        /// <param name="Code"></param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public object GetConfig(string Code, string Caller)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select Data from configs where code='" + Code + "' and caller='" + Caller + "'";
+            dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count == 0)
+            {
+                return "";
+            }
+            else
+            {
+                return dt.Rows[0]["Data"];
+            }
+        }
+
+
+        //将数据类型的列类型转换为DataTable
+        public DataTable DataTypeColumnToDataTable(DataTable dt)
+        {
+            DataTable dt1 = new DataTable();
+            dt1.Rows.Add();
+            foreach (DataRow dr in dt.Rows)
+            {
+                dt1.Columns.Add(dr[0].ToString());
+                int index = dt.Rows.IndexOf(dr);
+                if (dr[1].ToString() == "NUMBER")
+                {
+                    dt1.Rows[0][index] = 0;
+                }
+                if (dr[1].ToString() == "VARCHAR2")
+                {
+                    dt1.Rows[0][index] = "这是一段文字";
+                }
+                if (dr[1].ToString() == "DATE")
+                {
+                    dt1.Rows[0][index] = DateTime.Now.ToString("yyyy-MM-dd");
+                }
+                if (dr[1].ToString() == "FLOAT")
+                {
+                    dt1.Rows[0][index] = 1.0;
+                }
+                if (dr[1].ToString() == "CLOB")
+                {
+                    dt1.Rows[0][index] = "一段长文字";
+                }
+            }
+            return dt1;
+        }
+
+
+        /// <summary>
+        /// 通过条件更新
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="update"></param>
+        /// <param name="condition"></param>
+        public string UpdateByCondition(string TableName, string update, string condition)
+        {
+            string sql = "update " + TableName + " set " + update + " where " + condition;
+            command = new OleDbCommand(sql, this._odcConnection);
+
+            Reconnect(command);
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OleDbConnection(this._connectionString);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            command.Dispose();
+            return sql;
+        }
+
+        /// <summary>
+        /// 调用存储过程
+        /// </summary>
+        /// <param name="ProcedureName"></param>    
+        /// <param name="param"></param>
+        public void CallProcedure(string ProcedureName, ref string[] param)
+        {
+            command = new OleDbCommand(ProcedureName);
+            command.Connection = this._odcConnection;
+            Reconnect(command);
+            command.CommandText = ProcedureName;
+            command.CommandType = CommandType.StoredProcedure;
+            for (int i = 0; i < param.Length; i++)
+                command.Parameters.Add(new OleDbParameter(param[i].ToString(), OleDbType.VarChar, 200, param[i]));
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OleDbConnection(this._connectionString);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            for (int i = 0; i < command.Parameters.Count; i++)
+                param[i] = command.Parameters[i].Value.ToString();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 出现异常进行回滚的执行方法
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void ExecuteSQLTran(params string[] SQL)
+        {
+            OleDbTransaction tx = this._odcConnection.BeginTransaction();
+            command = new OleDbCommand();
+            command.Connection = this._odcConnection;
+            command.Transaction = tx;
+            try
+            {
+                foreach (string sql in SQL)
+                {
+                    if (!String.IsNullOrEmpty(sql))
+                    {
+                        command.CommandText = sql;
+                        try
+                        {
+                            command.ExecuteNonQuery();
+                        }
+                        catch (Exception)
+                        {
+                            command.Connection = new OleDbConnection(this._connectionString);
+                            command.Connection.Open();
+                            command.ExecuteNonQuery();
+                        }
+                    }
+                }
+                tx.Commit();
+            }
+            catch (Exception E)
+            {
+                tx.Rollback();
+                throw new Exception(E.Message);
+            }
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 用于将string 的数组转换成SQL的查询内容
+        /// </summary>
+        /// <param name="Fields"></param>
+        /// <returns></returns>
+        private string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+        /// <summary>
+        /// 通过查询的内容获取到字段的描述
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetCaptionFromField(string field)
+        {
+            string[] caption = field.Split(',');
+            for (int i = 0; i < caption.Length; i++)
+            {
+                caption[i] = caption[i].Substring(0, caption[i].LastIndexOf("as")).Trim();
+            }
+            return caption;
+        }
+
+        /// <summary>
+        /// 通过查询的语句获取查询的字段
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetField(string field)
+        {
+            string[] fields = field.Split(',');
+            for (int i = 0; i < fields.Length; i++)
+            {
+                fields[i] = fields[i].Substring(fields[i].LastIndexOf("as") + 2, fields[i].Length - fields[i].LastIndexOf("as") - 2).Trim();
+            }
+            return fields;
+        }
+
+        public object GetLabelParam(string sql)
+        {
+            DataTable dt = new DataTable();
+            command = new OleDbCommand(sql, this._odcConnection);
+            Reconnect(command);
+            OleDbDataAdapter ad = new OleDbDataAdapter();
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                this._odcConnection = new OleDbConnection(this._connectionString);
+                this._odcConnection.Open();
+                command = new OleDbCommand(sql, this._odcConnection);
+                ad = new OleDbDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            if (dt.Rows.Count > 0)
+            {
+                ad.Dispose();
+                command.Dispose();
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                command.Dispose();
+                return "";
+            }
+        }
+
+        public static string[] GetParamFromSQL(string SQL)
+        {
+            string[] par = SQL.Split(':');
+            //用来存参数的数组
+            StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+            string[] param = new string[par.Length - 1];
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                //新建一个char类型的数组用来存储每个字节的变量
+                char[] c = par[i + 1].ToCharArray();
+                addpar[i] = new StringBuilder();
+
+                for (int j = 0; j < c.Length; j++)
+                {
+                    if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                    {
+                        addpar[i].Append(c[j]);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+            }
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                param[i] = addpar[i].ToString();
+            }
+            return param;
+        }
+    }
+}

+ 20 - 20
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -22,16 +22,16 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
 
-        ////怡海能达外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////怡海能达ERP地址
-        //public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
-        ////怡海能达FTP
-        //public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER";
+        //怡海能达外网地址
+        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        //怡海能达ERP地址
+        public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
+        //怡海能达FTP
+        public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER";
 
         ////华商龙外网地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -56,16 +56,16 @@ namespace UAS_LabelMachine
         //public static readonly string Masters = "ZT_TEST";
         //用户选择的数据库的连接字符串
 
-        //UAS测试地址
-        private readonly string ConnectionStrings = "Data Source=192.168.253.6/orcl;User ID=UAS_TEST;PassWord=select!#%*(";
-        //UAS测试地址
-        public static readonly string ERPAddesss = "http://192.168.253.6/uas_test/";
-        //UAS测试FTP
-        public static readonly string FTPAdress = "ftp://192.168.253.9/PrintFile|mesconfig|Administrator1@#";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
-        //需要显示的账套
-        public static readonly string Masters = "UAS_TEST";
+        ////UAS测试地址
+        //private readonly string ConnectionStrings = "Data Source=192.168.253.6/orcl;User ID=UAS_TEST;PassWord=select!#%*(";
+        ////UAS测试地址
+        //public static readonly string ERPAddesss = "http://192.168.253.6/uas_test/";
+        ////UAS测试FTP
+        //public static readonly string FTPAdress = "ftp://192.168.253.9/PrintFile|mesconfig|Administrator1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "UAS_TEST";
         public static string DBConnectionString;
         static OracleConnection connection = null;
         static OracleCommand command = null;

+ 20 - 0
UAS-出货标签管理(吉利通)/UAS-出货标签管理(吉利通).csproj

@@ -100,10 +100,19 @@
     <Reference Include="Analysis">
       <HintPath>tool\Analysis.dll</HintPath>
     </Reference>
+    <Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="Interop.LabelManager2">
       <HintPath>..\..\..\UAS_WinForm\UAS-出货标签管理\bin\Debug\Interop.LabelManager2.dll</HintPath>
       <EmbedInteropTypes>False</EmbedInteropTypes>
     </Reference>
+    <Reference Include="Microsoft.Office.Interop.Access.Dao, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+      <HintPath>..\packages\Microsoft.Office.Interop.Access.Dao.15.0.4420.1017\lib\net20\Microsoft.Office.Interop.Access.Dao.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
     <Reference Include="NPOI">
       <HintPath>tool\NPOI.dll</HintPath>
     </Reference>
@@ -219,6 +228,12 @@
     <Compile Include="Login.Designer.cs">
       <DependentUpon>Login.cs</DependentUpon>
     </Compile>
+    <Compile Include="ParamSetting.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="ParamSetting.Designer.cs">
+      <DependentUpon>ParamSetting.cs</DependentUpon>
+    </Compile>
     <Compile Include="PowerSetting.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -230,6 +245,7 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="PublicMethod\AccessDBHelper.cs" />
     <Compile Include="PublicMethod\ArrayList.cs" />
     <Compile Include="PublicMethod\AutoSizeFormClass.cs" />
     <Compile Include="PublicMethod\BaseUtil.cs" />
@@ -321,6 +337,9 @@
     <EmbeddedResource Include="Login.resx">
       <DependentUpon>Login.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="ParamSetting.resx">
+      <DependentUpon>ParamSetting.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="PowerSetting.resx">
       <DependentUpon>PowerSetting.cs</DependentUpon>
     </EmbeddedResource>
@@ -352,6 +371,7 @@
     <EmbeddedResource Include="附件内容打印.resx">
       <DependentUpon>附件内容打印.cs</DependentUpon>
     </EmbeddedResource>
+    <None Include="packages.config" />
     <None Include="Properties\app.manifest" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>

+ 94 - 77
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -40,10 +40,8 @@
             this.CollectionUnit = new System.Windows.Forms.ComboBox();
             this.CollectionUnit_label = new System.Windows.Forms.Label();
             this.GenerateBarCode = new System.Windows.Forms.Button();
-            this.LabelMainTain = new System.Windows.Forms.Button();
             this.SaveGrid = new System.Windows.Forms.Button();
             this.sg_separator_label = new System.Windows.Forms.Label();
-            this.CollectionSetting = new System.Windows.Forms.Button();
             this.Si_ItemDGV = new System.Windows.Forms.DataGridView();
             this.si_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.si_index = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -61,7 +59,6 @@
             this.label3 = new System.Windows.Forms.Label();
             this.CleanInputAfterCollect = new System.Windows.Forms.CheckBox();
             this.AllCollected = new System.Windows.Forms.Button();
-            this.PowerSetting = new System.Windows.Forms.Button();
             this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
             this.GetGridOnly = new System.Windows.Forms.CheckBox();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
@@ -93,14 +90,20 @@
             this.MidSource = new System.Windows.Forms.BindingSource(this.components);
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
-            this.AttachInfo = new System.Windows.Forms.Button();
             this.pi_date = new System.Windows.Forms.Label();
+            this.CleanBarCode = new System.Windows.Forms.Button();
+            this.ListButtonMenu = new System.Windows.Forms.ListBox();
+            this.ButtonSetting = new System.Windows.Forms.Button();
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
             this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.ExportData = new System.Windows.Forms.Button();
             this.label18 = new System.Windows.Forms.Label();
             this.MidBoxEnd = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.MidBoxBegin = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label16 = new System.Windows.Forms.Label();
+            this.PowerSetting = new System.Windows.Forms.Button();
             this.SingleBoxEnd = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleBoxBegin = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label12 = new System.Windows.Forms.Label();
@@ -178,9 +181,9 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.CleanBarCode = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
+            this.contextMenuStrip1.SuspendLayout();
             this.groupBoxWithBorder1.SuspendLayout();
             this.CollectionProcess.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).BeginInit();
@@ -235,7 +238,7 @@
             // 
             this.AutoMatch.AutoSize = true;
             this.AutoMatch.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoMatch.Location = new System.Drawing.Point(144, 106);
+            this.AutoMatch.Location = new System.Drawing.Point(144, 105);
             this.AutoMatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AutoMatch.Name = "AutoMatch";
             this.AutoMatch.Size = new System.Drawing.Size(84, 24);
@@ -272,7 +275,7 @@
             "盘",
             "盒",
             "全部"});
-            this.CollectionUnit.Location = new System.Drawing.Point(296, 182);
+            this.CollectionUnit.Location = new System.Drawing.Point(296, 180);
             this.CollectionUnit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CollectionUnit.Name = "CollectionUnit";
             this.CollectionUnit.Size = new System.Drawing.Size(54, 25);
@@ -291,7 +294,7 @@
             // GenerateBarCode
             // 
             this.GenerateBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GenerateBarCode.Location = new System.Drawing.Point(374, 178);
+            this.GenerateBarCode.Location = new System.Drawing.Point(448, 178);
             this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.GenerateBarCode.Name = "GenerateBarCode";
             this.GenerateBarCode.Size = new System.Drawing.Size(68, 26);
@@ -300,18 +303,6 @@
             this.GenerateBarCode.UseVisualStyleBackColor = true;
             this.GenerateBarCode.Click += new System.EventHandler(this.GenerateBarCode_Click);
             // 
-            // LabelMainTain
-            // 
-            this.LabelMainTain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelMainTain.Location = new System.Drawing.Point(448, 178);
-            this.LabelMainTain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.LabelMainTain.Name = "LabelMainTain";
-            this.LabelMainTain.Size = new System.Drawing.Size(68, 26);
-            this.LabelMainTain.TabIndex = 57;
-            this.LabelMainTain.Text = "标签维护";
-            this.LabelMainTain.UseVisualStyleBackColor = true;
-            this.LabelMainTain.Click += new System.EventHandler(this.LabelMaintain_Click);
-            // 
             // SaveGrid
             // 
             this.SaveGrid.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -334,18 +325,6 @@
             this.sg_separator_label.TabIndex = 61;
             this.sg_separator_label.Text = "分隔符";
             // 
-            // CollectionSetting
-            // 
-            this.CollectionSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionSetting.Location = new System.Drawing.Point(230, 104);
-            this.CollectionSetting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CollectionSetting.Name = "CollectionSetting";
-            this.CollectionSetting.Size = new System.Drawing.Size(88, 26);
-            this.CollectionSetting.TabIndex = 63;
-            this.CollectionSetting.Text = "采集策略设置";
-            this.CollectionSetting.UseVisualStyleBackColor = true;
-            this.CollectionSetting.Click += new System.EventHandler(this.CollectionSetting_Click);
-            // 
             // Si_ItemDGV
             // 
             this.Si_ItemDGV.AllowUserToAddRows = false;
@@ -515,19 +494,6 @@
             this.AllCollected.UseVisualStyleBackColor = true;
             this.AllCollected.Click += new System.EventHandler(this.AllCollected_Click);
             // 
-            // PowerSetting
-            // 
-            this.PowerSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PowerSetting.Location = new System.Drawing.Point(69, 202);
-            this.PowerSetting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.PowerSetting.Name = "PowerSetting";
-            this.PowerSetting.Size = new System.Drawing.Size(68, 26);
-            this.PowerSetting.TabIndex = 76;
-            this.PowerSetting.Text = "权限设置";
-            this.PowerSetting.UseVisualStyleBackColor = true;
-            this.PowerSetting.Visible = false;
-            this.PowerSetting.Click += new System.EventHandler(this.PowerSetting_Click);
-            // 
             // RefreshDBConnect
             // 
             this.RefreshDBConnect.Tick += new System.EventHandler(this.RefreshDBConnect_Tick);
@@ -761,18 +727,6 @@
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             // 
-            // AttachInfo
-            // 
-            this.AttachInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AttachInfo.Location = new System.Drawing.Point(230, 141);
-            this.AttachInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.AttachInfo.Name = "AttachInfo";
-            this.AttachInfo.Size = new System.Drawing.Size(88, 26);
-            this.AttachInfo.TabIndex = 85;
-            this.AttachInfo.Text = "附加信息设置";
-            this.AttachInfo.UseVisualStyleBackColor = true;
-            this.AttachInfo.Click += new System.EventHandler(this.AttachInfo_Click);
-            // 
             // pi_date
             // 
             this.pi_date.AutoSize = true;
@@ -783,6 +737,66 @@
             this.pi_date.TabIndex = 86;
             this.pi_date.Visible = false;
             // 
+            // CleanBarCode
+            // 
+            this.CleanBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CleanBarCode.Location = new System.Drawing.Point(522, 178);
+            this.CleanBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CleanBarCode.Name = "CleanBarCode";
+            this.CleanBarCode.Size = new System.Drawing.Size(68, 26);
+            this.CleanBarCode.TabIndex = 87;
+            this.CleanBarCode.Text = "清空条码";
+            this.CleanBarCode.UseVisualStyleBackColor = true;
+            this.CleanBarCode.Click += new System.EventHandler(this.CleanBarCode_Click);
+            // 
+            // ListButtonMenu
+            // 
+            this.ListButtonMenu.Font = new System.Drawing.Font("微软雅黑", 11F);
+            this.ListButtonMenu.FormattingEnabled = true;
+            this.ListButtonMenu.ItemHeight = 20;
+            this.ListButtonMenu.Items.AddRange(new object[] {
+            "采集策略设置",
+            "附加信息设置",
+            "客户标签维护",
+            "参数配置"});
+            this.ListButtonMenu.Location = new System.Drawing.Point(270, 129);
+            this.ListButtonMenu.Name = "ListButtonMenu";
+            this.ListButtonMenu.Size = new System.Drawing.Size(97, 84);
+            this.ListButtonMenu.TabIndex = 88;
+            this.ListButtonMenu.Visible = false;
+            this.ListButtonMenu.SelectedIndexChanged += new System.EventHandler(this.ListButtonMenu_SelectedIndexChanged);
+            // 
+            // ButtonSetting
+            // 
+            this.ButtonSetting.Location = new System.Drawing.Point(217, 132);
+            this.ButtonSetting.Name = "ButtonSetting";
+            this.ButtonSetting.Size = new System.Drawing.Size(90, 23);
+            this.ButtonSetting.TabIndex = 89;
+            this.ButtonSetting.Text = "后台设置";
+            this.ButtonSetting.UseVisualStyleBackColor = true;
+            this.ButtonSetting.Click += new System.EventHandler(this.ButtonSetting_Click);
+            // 
+            // contextMenuStrip1
+            // 
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripMenuItem1,
+            this.toolStripMenuItem2});
+            this.contextMenuStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(193, 48);
+            // 
+            // toolStripMenuItem1
+            // 
+            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(192, 22);
+            this.toolStripMenuItem1.Text = "toolStripMenuItem1";
+            // 
+            // toolStripMenuItem2
+            // 
+            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(192, 22);
+            this.toolStripMenuItem2.Text = "toolStripMenuItem2";
+            // 
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.Controls.Add(this.ExportData);
@@ -861,6 +875,19 @@
             this.label16.TabIndex = 87;
             this.label16.Text = "-";
             // 
+            // PowerSetting
+            // 
+            this.PowerSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PowerSetting.Location = new System.Drawing.Point(69, 202);
+            this.PowerSetting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PowerSetting.Name = "PowerSetting";
+            this.PowerSetting.Size = new System.Drawing.Size(68, 26);
+            this.PowerSetting.TabIndex = 76;
+            this.PowerSetting.Text = "权限设置";
+            this.PowerSetting.UseVisualStyleBackColor = true;
+            this.PowerSetting.Visible = false;
+            this.PowerSetting.Click += new System.EventHandler(this.PowerSetting_Click);
+            // 
             // SingleBoxEnd
             // 
             this.SingleBoxEnd.ID = null;
@@ -1401,7 +1428,7 @@
             // 
             this.ViVoPlate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.ViVoPlate.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ViVoPlate.Location = new System.Drawing.Point(34, 164);
+            this.ViVoPlate.Location = new System.Drawing.Point(72, 164);
             this.ViVoPlate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ViVoPlate.Name = "ViVoPlate";
             this.ViVoPlate.Size = new System.Drawing.Size(68, 26);
@@ -1423,7 +1450,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(34, 199);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(72, 199);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1726,27 +1753,16 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // CleanBarCode
-            // 
-            this.CleanBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanBarCode.Location = new System.Drawing.Point(522, 178);
-            this.CleanBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.CleanBarCode.Name = "CleanBarCode";
-            this.CleanBarCode.Size = new System.Drawing.Size(68, 26);
-            this.CleanBarCode.TabIndex = 87;
-            this.CleanBarCode.Text = "清空条码";
-            this.CleanBarCode.UseVisualStyleBackColor = true;
-            this.CleanBarCode.Click += new System.EventHandler(this.CleanBarCode_Click);
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
             this.ClientSize = new System.Drawing.Size(1257, 711);
+            this.Controls.Add(this.ButtonSetting);
+            this.Controls.Add(this.ListButtonMenu);
             this.Controls.Add(this.CleanBarCode);
             this.Controls.Add(this.pi_date);
-            this.Controls.Add(this.AttachInfo);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.GetGridOnly);
@@ -1760,11 +1776,9 @@
             this.Controls.Add(this.CleanDetail);
             this.Controls.Add(this.Si_ItemDGV);
             this.Controls.Add(this.CollectionProcess);
-            this.Controls.Add(this.CollectionSetting);
             this.Controls.Add(this.sg_separator);
             this.Controls.Add(this.sg_separator_label);
             this.Controls.Add(this.SaveGrid);
-            this.Controls.Add(this.LabelMainTain);
             this.Controls.Add(this.GenerateBarCode);
             this.Controls.Add(this.CollectionUnit_label);
             this.Controls.Add(this.CollectionUnit);
@@ -1796,6 +1810,7 @@
             this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
+            this.contextMenuStrip1.ResumeLayout(false);
             this.groupBoxWithBorder1.ResumeLayout(false);
             this.groupBoxWithBorder1.PerformLayout();
             this.CollectionProcess.ResumeLayout(false);
@@ -1873,11 +1888,9 @@
         private System.Windows.Forms.ComboBox CollectionUnit;
         private System.Windows.Forms.Label CollectionUnit_label;
         private System.Windows.Forms.Button GenerateBarCode;
-        private System.Windows.Forms.Button LabelMainTain;
         private System.Windows.Forms.Button SaveGrid;
         private System.Windows.Forms.Label sg_separator_label;
         private CustomControl.EnterTextBox sg_separator;
-        private System.Windows.Forms.Button CollectionSetting;
         private System.Windows.Forms.Label Process;
         private System.Windows.Forms.Label Installed;
         private System.Windows.Forms.Label label13;
@@ -1936,7 +1949,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn si_expression;
         private System.Windows.Forms.DataGridViewTextBoxColumn si_item;
         private System.Windows.Forms.DataGridViewTextBoxColumn si_expressionitem;
-        private System.Windows.Forms.Button AttachInfo;
         private System.Windows.Forms.Label pi_date;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
@@ -1964,5 +1976,10 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.Button CleanBarCode;
+        private System.Windows.Forms.ListBox ListButtonMenu;
+        private System.Windows.Forms.Button ButtonSetting;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
     }
 }

+ 68 - 60
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -219,7 +219,6 @@ namespace UAS_LabelMachine
             {
                 pib_cusbarcode.Visible = false;
                 pib_cusoutboxcode.Visible = false;
-                ViVoPlate.Visible = false;
                 OutBoxLabelPackage.Visible = false;
                 //GetOutBoxCode.Visible = false;
             }
@@ -263,14 +262,6 @@ namespace UAS_LabelMachine
             form.ShowDialog();
         }
 
-        private void CollectionSetting_Click(object sender, EventArgs e)
-        {
-            采集策略 form = new 采集策略(sg_code.Text);
-            form.FormClosed += sg_code_UserControlTextChanged;
-            BaseUtil.SetFormCenter(form);
-            form.ShowDialog();
-        }
-
         private void LabelMaintain_Click(object sender, EventArgs e)
         {
             客户标签维护 form = new 客户标签维护();
@@ -2256,53 +2247,13 @@ namespace UAS_LabelMachine
 
         private void GetOutBoxCode_Click(object sender, EventArgs e)
         {
-            if (dh.GetConfig("UsingPacking", "ProdInOut!Sale").ToString() != "")
-            {
-                int Current = 0;
-                sql.Clear();
-                sql.Append("select pr_qtyperplace,pd_qty,packingdetail.pd_cartonno,pr_zxbzs,packingdetail.pd_cartons from packingdetail left join packing on pd_piid=pi_id left join prodinout on ");
-                sql.Append("pi_packingcode=packing.pi_code left join product on pd_prodcode=pr_code where pi_inoutno='" + pi_inoutno.Text + "' order by pr_code,pd_detno");
-                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    try { OutboxCapacity.Value = (decimal)dt.Rows[0]["pr_qtyperplace"] / (decimal)dt.Rows[0]["pr_zxbzs"]; }
-                    catch (Exception) { }
-                }
-                try
-                {
-                    for (int i = 0; i < dt.Rows.Count; i++)
-                    {
-                        int pd_qty = int.Parse(dt.Rows[i]["pd_qty"].ToString());
-                        int pr_zxbzs = int.Parse(dt.Rows[i]["pr_zxbzs"].ToString());
-                        int pd_cartons = int.Parse(dt.Rows[i]["pd_cartons"].ToString());
-                        for (int j = 0; j < pd_qty * pd_cartons / pr_zxbzs; j++)
-                        {
-                            LabelInf.Rows[Current].Cells["pib_outboxcode2"].Value = dt.Rows[i]["pd_cartonno"].ToString();
-                            Current++;
-                        }
-                    }
-                    GetPackingCode = true;
-                }
-                catch (Exception)
-                {
-                }
-            }
-            else
-            {
-                int BoxCode = 1;
-                for (int i = 0; i < LabelInf.Rows.Count; i++)
-                {
-                    LabelInf.Rows[i].Cells["pib_outboxcode2"].Value = BoxCode;
-                    if (i + 1 < LabelInf.Rows.Count)
-                    {
-                        if (int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()) % OutboxCapacity.Value == 0 && (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString()))
-                        {
-                            BoxCode = BoxCode + 1;
-                        }
-                    }
-                }
-            }
-            SaveGrid_Click(sender, e);
+            Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+            sql.Clear();
+            sql.Append("select top 1000 pib_madein,pib_inoutno,pib_id,pib_pdid,pib_piid,pib_indate,pib_pdno,pib_prodcode,pib_brand,");
+            sql.Append("pib_lotno,pib_datecode,pib_qty,pib_barcode,pib_outboxcode1,pib_outboxcode2,pib_ifpick,pib_ifprint ");
+            sql.Append("from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id ");
+            (MidSource.DataSource as DataTable).Merge((DataTable)adh.ExecuteSql(sql.ToString(), "select"));
+            Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
         }
 
         private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -2391,6 +2342,7 @@ namespace UAS_LabelMachine
             }
             catch (Exception) { }
         }
+        AccessDBHelper adh = new AccessDBHelper("LabelPrint.accdb");
 
         /// <summary>
         /// 获取ViVo的料盘信息
@@ -2399,10 +2351,19 @@ namespace UAS_LabelMachine
         /// <param name="e"></param>
         private void ViVoPlate_Click(object sender, EventArgs e)
         {
-            thread = new Thread(GetVivoInf);
-            stw = new SetLoadingWindow(thread, "正在获取Vivo箱号");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
+            sql.Clear();
+            sql.Append("select top 500  pib_madein,pib_inoutno,pib_id,pib_pdid,pib_piid,pib_indate,pib_pdno,pib_prodcode,pib_brand,");
+            sql.Append("pib_lotno,pib_datecode,pib_qty,pib_barcode,pib_outboxcode1,pib_outboxcode2,pib_ifpick,pib_ifprint ");
+            sql.Append("from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id ");
+            MidSource.DataSource = (DataTable)adh.ExecuteSql(sql.ToString(), "select");
+
+            LabelInf.DataSource = MidSource;
+
+            //Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+            //adh.SaveDataTable(dt, "prodiobarcode");
+            //Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+            //adh.DeleleFile("LabelPrint.accdb");
+            //Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
         }
 
         private void GetVivoInf()
@@ -2594,5 +2555,52 @@ namespace UAS_LabelMachine
                 LoadGridData(sender, e);
             }
         }
+
+        private void ButtonSetting_Click(object sender, EventArgs e)
+        {
+            ListButtonMenu.BringToFront();
+            ListButtonMenu.Visible = true;
+        }
+
+        private void ListButtonMenu_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            ListButtonMenu.Visible = false;
+            switch (ListButtonMenu.SelectedItem.ToString())
+            {
+                case "采集策略设置":
+                    采集策略 form = new 采集策略(sg_code.Text);
+                    form.FormClosed += sg_code_UserControlTextChanged;
+                    BaseUtil.SetFormCenter(form);
+                    form.ShowDialog();
+                    break;
+                case "附加信息设置":
+                    if (pi_cardcode.Text != "")
+                    {
+                        附件内容打印 att = new 附件内容打印(pi_cardcode.Text);
+                        att.ShowDialog();
+                    }
+                    else MessageBox.Show("请先获取出库单信息");
+                    break;
+                case "客户标签维护":
+                    客户标签维护 form1 = new 客户标签维护();
+                    BaseUtil.SetFormCenter(form1);
+                    if (SingleDoc != null)
+                        SingleDoc.Close();
+                    if (MidDoc != null)
+                        MidDoc.Close();
+                    if (OutBoxDoc != null)
+                        OutBoxDoc.Close();
+                    form1.FormClosed += LabelFormClose;
+                    form1.ShowDialog();
+                    break;
+                case "参数配置":
+                    ParamSetting form2 = new ParamSetting();
+                    BaseUtil.SetFormCenter(form2);
+                    form2.ShowDialog();
+                    break;
+                default:
+                    break;
+            }
+        }
     }
 }

+ 3 - 0
UAS-出货标签管理(吉利通)/UAS_出货标签管理.resx

@@ -150,6 +150,9 @@
   <metadata name="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>294, 17</value>
   </metadata>
+  <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>442, 17</value>
+  </metadata>
   <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

+ 4 - 0
UAS-出货标签管理(吉利通)/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.Office.Interop.Access.Dao" version="15.0.4420.1017" targetFramework="net40" />
+</packages>

+ 0 - 1602
UAS-出货标签管理(吉利通)/贴标机条码打印.Designer.cs

@@ -1,1602 +0,0 @@
-namespace UAS_LabelMachine
-{
-    partial class UAS_出货标签打印
-    {
-        /// <summary>
-        /// 必需的设计器变量。
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// 清理所有正在使用的资源。
-        /// </summary>
-        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows 窗体设计器生成的代码
-
-        /// <summary>
-        /// 设计器支持所需的方法 - 不要修改
-        /// 使用代码编辑器修改此方法的内容。
-        /// </summary>
-        private void InitializeComponent()
-        {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
-            this.pi_inoutno_label = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label22 = new System.Windows.Forms.Label();
-            this.AutoMatch = new System.Windows.Forms.CheckBox();
-            this.pr_code_label = new System.Windows.Forms.Label();
-            this.label24 = new System.Windows.Forms.Label();
-            this.CollectionUnit = new System.Windows.Forms.ComboBox();
-            this.CollectionUnit_label = new System.Windows.Forms.Label();
-            this.GenerateBarCode = new System.Windows.Forms.Button();
-            this.LabelMainTain = new System.Windows.Forms.Button();
-            this.SaveGrid = new System.Windows.Forms.Button();
-            this.sg_separator_label = new System.Windows.Forms.Label();
-            this.CollectionSetting = new System.Windows.Forms.Button();
-            this.Si_ItemDGV = new System.Windows.Forms.DataGridView();
-            this.si_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_index = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_kind = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_indexstring = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_expression = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.si_item = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.CleanDetail = new System.Windows.Forms.Button();
-            this.pib_id = new System.Windows.Forms.Label();
-            this.pi_cardcode = new System.Windows.Forms.Label();
-            this.pi_cardcode_label = new System.Windows.Forms.Label();
-            this.Fresh = new System.Windows.Forms.LinkLabel();
-            this.label3 = new System.Windows.Forms.Label();
-            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.dataGridViewCheckBoxColumn3 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.CleanInputAfterCollect = new System.Windows.Forms.CheckBox();
-            this.AllCollected = new System.Windows.Forms.Button();
-            this.PowerSetting = new System.Windows.Forms.Button();
-            this.ChooseAll = new UAS_LabelMachine.CustomControl.ChooseAllButton();
-            this.pr_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
-            this.CollectionProcess = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.Capacity = new System.Windows.Forms.Label();
-            this.Process_midboxcode = new System.Windows.Forms.Label();
-            this.Process_outboxcode = new System.Windows.Forms.Label();
-            this.TotalCount = new System.Windows.Forms.Label();
-            this.label17 = new System.Windows.Forms.Label();
-            this.CollectedCount = new System.Windows.Forms.Label();
-            this.label14 = new System.Windows.Forms.Label();
-            this.label11 = new System.Windows.Forms.Label();
-            this.label13 = new System.Windows.Forms.Label();
-            this.Installed = new System.Windows.Forms.Label();
-            this.Process = new System.Windows.Forms.Label();
-            this.sg_separator = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.Input = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.griddetno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.sg_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
-            this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
-            this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.DateCode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.SingleLabelPrint = new System.Windows.Forms.Button();
-            this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
-            this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.MidLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.label15 = new System.Windows.Forms.Label();
-            this.MidBoxCapacity = new System.Windows.Forms.NumericUpDown();
-            this.MidLabelPrint = new System.Windows.Forms.Button();
-            this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.MidLabelCombox = new System.Windows.Forms.ComboBox();
-            this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.LogingOut = new System.Windows.Forms.LinkLabel();
-            this.GetOutBoxCode = new System.Windows.Forms.Button();
-            this.OutBoxNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label10 = new System.Windows.Forms.Label();
-            this.WeightNet = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label9 = new System.Windows.Forms.Label();
-            this.WeightGross = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label8 = new System.Windows.Forms.Label();
-            this.label6 = new System.Windows.Forms.Label();
-            this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.label7 = new System.Windows.Forms.Label();
-            this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
-            this.OutBoxLabelPackage = new System.Windows.Forms.Button();
-            this.OutBoxLabelPrint = new System.Windows.Forms.Button();
-            this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
-            this.CollectionProcess.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).BeginInit();
-            this.SingleLabel.SuspendLayout();
-            this.MidLabel.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).BeginInit();
-            this.OutBoxLabel.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // pi_inoutno_label
-            // 
-            this.pi_inoutno_label.AutoSize = true;
-            this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(4, 12);
-            this.pi_inoutno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pi_inoutno_label.Name = "pi_inoutno_label";
-            this.pi_inoutno_label.Size = new System.Drawing.Size(82, 24);
-            this.pi_inoutno_label.TabIndex = 3;
-            this.pi_inoutno_label.Text = "出货单号";
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(4, 81);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(82, 24);
-            this.label1.TabIndex = 31;
-            this.label1.Text = "采集策略";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(7, 132);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(82, 24);
-            this.label2.TabIndex = 33;
-            this.label2.Text = "当前采集";
-            // 
-            // label22
-            // 
-            this.label22.AutoSize = true;
-            this.label22.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label22.Location = new System.Drawing.Point(96, 132);
-            this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(82, 24);
-            this.label22.TabIndex = 34;
-            this.label22.Text = "明细序号";
-            // 
-            // AutoMatch
-            // 
-            this.AutoMatch.AutoSize = true;
-            this.AutoMatch.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoMatch.Location = new System.Drawing.Point(196, 133);
-            this.AutoMatch.Margin = new System.Windows.Forms.Padding(4);
-            this.AutoMatch.Name = "AutoMatch";
-            this.AutoMatch.Size = new System.Drawing.Size(104, 28);
-            this.AutoMatch.TabIndex = 49;
-            this.AutoMatch.Text = "自动匹配";
-            this.AutoMatch.UseVisualStyleBackColor = true;
-            // 
-            // pr_code_label
-            // 
-            this.pr_code_label.AutoSize = true;
-            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(96, 199);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(82, 24);
-            this.pr_code_label.TabIndex = 51;
-            this.pr_code_label.Text = "物料编号";
-            // 
-            // label24
-            // 
-            this.label24.AutoSize = true;
-            this.label24.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label24.Location = new System.Drawing.Point(12, 272);
-            this.label24.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label24.Name = "label24";
-            this.label24.Size = new System.Drawing.Size(64, 24);
-            this.label24.TabIndex = 55;
-            this.label24.Text = "输入框";
-            // 
-            // CollectionUnit
-            // 
-            this.CollectionUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.CollectionUnit.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionUnit.FormattingEnabled = true;
-            this.CollectionUnit.Items.AddRange(new object[] {
-            "盘",
-            "盒",
-            "全部"});
-            this.CollectionUnit.Location = new System.Drawing.Point(390, 228);
-            this.CollectionUnit.Margin = new System.Windows.Forms.Padding(4);
-            this.CollectionUnit.Name = "CollectionUnit";
-            this.CollectionUnit.Size = new System.Drawing.Size(69, 28);
-            this.CollectionUnit.TabIndex = 41;
-            // 
-            // CollectionUnit_label
-            // 
-            this.CollectionUnit_label.AutoSize = true;
-            this.CollectionUnit_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionUnit_label.Location = new System.Drawing.Point(304, 229);
-            this.CollectionUnit_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.CollectionUnit_label.Name = "CollectionUnit_label";
-            this.CollectionUnit_label.Size = new System.Drawing.Size(82, 24);
-            this.CollectionUnit_label.TabIndex = 56;
-            this.CollectionUnit_label.Text = "采集单位";
-            // 
-            // GenerateBarCode
-            // 
-            this.GenerateBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GenerateBarCode.Location = new System.Drawing.Point(498, 222);
-            this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(4);
-            this.GenerateBarCode.Name = "GenerateBarCode";
-            this.GenerateBarCode.Size = new System.Drawing.Size(90, 34);
-            this.GenerateBarCode.TabIndex = 41;
-            this.GenerateBarCode.Text = "生成条码";
-            this.GenerateBarCode.UseVisualStyleBackColor = true;
-            this.GenerateBarCode.Click += new System.EventHandler(this.GenerateBarCode_Click);
-            // 
-            // LabelMainTain
-            // 
-            this.LabelMainTain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelMainTain.Location = new System.Drawing.Point(598, 222);
-            this.LabelMainTain.Margin = new System.Windows.Forms.Padding(4);
-            this.LabelMainTain.Name = "LabelMainTain";
-            this.LabelMainTain.Size = new System.Drawing.Size(90, 34);
-            this.LabelMainTain.TabIndex = 57;
-            this.LabelMainTain.Text = "标签维护";
-            this.LabelMainTain.UseVisualStyleBackColor = true;
-            this.LabelMainTain.Click += new System.EventHandler(this.LabelMaintain_Click);
-            // 
-            // SaveGrid
-            // 
-            this.SaveGrid.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SaveGrid.Location = new System.Drawing.Point(598, 270);
-            this.SaveGrid.Margin = new System.Windows.Forms.Padding(4);
-            this.SaveGrid.Name = "SaveGrid";
-            this.SaveGrid.Size = new System.Drawing.Size(90, 34);
-            this.SaveGrid.TabIndex = 59;
-            this.SaveGrid.Text = "保存明细";
-            this.SaveGrid.UseVisualStyleBackColor = true;
-            this.SaveGrid.Click += new System.EventHandler(this.SaveGrid_Click);
-            // 
-            // sg_separator_label
-            // 
-            this.sg_separator_label.AutoSize = true;
-            this.sg_separator_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sg_separator_label.Location = new System.Drawing.Point(311, 81);
-            this.sg_separator_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sg_separator_label.Name = "sg_separator_label";
-            this.sg_separator_label.Size = new System.Drawing.Size(64, 24);
-            this.sg_separator_label.TabIndex = 61;
-            this.sg_separator_label.Text = "分隔符";
-            // 
-            // CollectionSetting
-            // 
-            this.CollectionSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionSetting.Location = new System.Drawing.Point(314, 130);
-            this.CollectionSetting.Margin = new System.Windows.Forms.Padding(4);
-            this.CollectionSetting.Name = "CollectionSetting";
-            this.CollectionSetting.Size = new System.Drawing.Size(109, 34);
-            this.CollectionSetting.TabIndex = 63;
-            this.CollectionSetting.Text = "采集策略设置";
-            this.CollectionSetting.UseVisualStyleBackColor = true;
-            this.CollectionSetting.Click += new System.EventHandler(this.CollectionSetting_Click);
-            // 
-            // Si_ItemDGV
-            // 
-            this.Si_ItemDGV.AllowUserToAddRows = false;
-            this.Si_ItemDGV.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.Si_ItemDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.Si_ItemDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.si_detno,
-            this.si_index,
-            this.si_kind,
-            this.si_indexstring,
-            this.si_length,
-            this.si_expression,
-            this.si_item});
-            this.Si_ItemDGV.Location = new System.Drawing.Point(434, 20);
-            this.Si_ItemDGV.Margin = new System.Windows.Forms.Padding(4);
-            this.Si_ItemDGV.Name = "Si_ItemDGV";
-            this.Si_ItemDGV.RowTemplate.Height = 23;
-            this.Si_ItemDGV.Size = new System.Drawing.Size(175, 180);
-            this.Si_ItemDGV.TabIndex = 65;
-            // 
-            // si_detno
-            // 
-            this.si_detno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.si_detno.DataPropertyName = "si_detno";
-            this.si_detno.HeaderText = "顺序";
-            this.si_detno.Name = "si_detno";
-            this.si_detno.ReadOnly = true;
-            this.si_detno.Width = 50;
-            // 
-            // si_index
-            // 
-            this.si_index.DataPropertyName = "si_index";
-            this.si_index.HeaderText = "起始位置";
-            this.si_index.Name = "si_index";
-            this.si_index.Visible = false;
-            // 
-            // si_kind
-            // 
-            this.si_kind.DataPropertyName = "si_kind";
-            this.si_kind.HeaderText = "解析方式";
-            this.si_kind.Name = "si_kind";
-            this.si_kind.Visible = false;
-            // 
-            // si_indexstring
-            // 
-            this.si_indexstring.DataPropertyName = "si_indexstring";
-            this.si_indexstring.HeaderText = "索引字符";
-            this.si_indexstring.Name = "si_indexstring";
-            this.si_indexstring.Visible = false;
-            // 
-            // si_length
-            // 
-            this.si_length.DataPropertyName = "si_length";
-            this.si_length.HeaderText = "长度";
-            this.si_length.Name = "si_length";
-            this.si_length.Visible = false;
-            // 
-            // si_expression
-            // 
-            this.si_expression.DataPropertyName = "si_expression";
-            this.si_expression.HeaderText = "正则表达式";
-            this.si_expression.Name = "si_expression";
-            this.si_expression.Visible = false;
-            // 
-            // si_item
-            // 
-            this.si_item.DataPropertyName = "si_item";
-            this.si_item.HeaderText = "采集项目";
-            this.si_item.Name = "si_item";
-            this.si_item.ReadOnly = true;
-            this.si_item.Width = 80;
-            // 
-            // CleanDetail
-            // 
-            this.CleanDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanDetail.Location = new System.Drawing.Point(498, 270);
-            this.CleanDetail.Margin = new System.Windows.Forms.Padding(4);
-            this.CleanDetail.Name = "CleanDetail";
-            this.CleanDetail.Size = new System.Drawing.Size(90, 34);
-            this.CleanDetail.TabIndex = 66;
-            this.CleanDetail.Text = "清除明细";
-            this.CleanDetail.UseVisualStyleBackColor = true;
-            this.CleanDetail.Click += new System.EventHandler(this.CleanDetail_Click);
-            // 
-            // pib_id
-            // 
-            this.pib_id.AutoSize = true;
-            this.pib_id.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pib_id.Location = new System.Drawing.Point(191, 200);
-            this.pib_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pib_id.Name = "pib_id";
-            this.pib_id.Size = new System.Drawing.Size(0, 24);
-            this.pib_id.TabIndex = 69;
-            this.pib_id.Visible = false;
-            // 
-            // pi_cardcode
-            // 
-            this.pi_cardcode.AutoSize = true;
-            this.pi_cardcode.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_cardcode.Location = new System.Drawing.Point(103, 46);
-            this.pi_cardcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pi_cardcode.Name = "pi_cardcode";
-            this.pi_cardcode.Size = new System.Drawing.Size(0, 24);
-            this.pi_cardcode.TabIndex = 71;
-            // 
-            // pi_cardcode_label
-            // 
-            this.pi_cardcode_label.AutoSize = true;
-            this.pi_cardcode_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_cardcode_label.Location = new System.Drawing.Point(4, 46);
-            this.pi_cardcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pi_cardcode_label.Name = "pi_cardcode_label";
-            this.pi_cardcode_label.Size = new System.Drawing.Size(82, 24);
-            this.pi_cardcode_label.TabIndex = 72;
-            this.pi_cardcode_label.Text = "客户编号";
-            // 
-            // Fresh
-            // 
-            this.Fresh.AutoSize = true;
-            this.Fresh.Location = new System.Drawing.Point(304, 18);
-            this.Fresh.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Fresh.Name = "Fresh";
-            this.Fresh.Size = new System.Drawing.Size(37, 15);
-            this.Fresh.TabIndex = 73;
-            this.Fresh.TabStop = true;
-            this.Fresh.Text = "刷新";
-            this.Fresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.Refresh_LinkClicked);
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(3, 726);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(92, 27);
-            this.label3.TabIndex = 29;
-            this.label3.Text = "输出日志";
-            // 
-            // dataGridViewTextBoxColumn1
-            // 
-            this.dataGridViewTextBoxColumn1.DataPropertyName = "si_detno";
-            this.dataGridViewTextBoxColumn1.HeaderText = "bi_id";
-            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
-            this.dataGridViewTextBoxColumn1.ReadOnly = true;
-            this.dataGridViewTextBoxColumn1.Visible = false;
-            this.dataGridViewTextBoxColumn1.Width = 80;
-            // 
-            // dataGridViewTextBoxColumn2
-            // 
-            this.dataGridViewTextBoxColumn2.DataPropertyName = "si_index";
-            this.dataGridViewTextBoxColumn2.HeaderText = "明细序号";
-            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
-            this.dataGridViewTextBoxColumn2.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn3
-            // 
-            this.dataGridViewTextBoxColumn3.DataPropertyName = "bi_prodcode";
-            this.dataGridViewTextBoxColumn3.HeaderText = "物料编号";
-            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
-            this.dataGridViewTextBoxColumn3.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn4
-            // 
-            this.dataGridViewTextBoxColumn4.DataPropertyName = "si_indexstring";
-            this.dataGridViewTextBoxColumn4.HeaderText = "MPN";
-            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
-            this.dataGridViewTextBoxColumn4.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn5
-            // 
-            this.dataGridViewTextBoxColumn5.DataPropertyName = "si_length";
-            this.dataGridViewTextBoxColumn5.HeaderText = "LotNo";
-            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
-            this.dataGridViewTextBoxColumn5.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn6
-            // 
-            this.dataGridViewTextBoxColumn6.DataPropertyName = "si_expression";
-            this.dataGridViewTextBoxColumn6.HeaderText = "DateCode";
-            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
-            this.dataGridViewTextBoxColumn6.Visible = false;
-            // 
-            // dataGridViewTextBoxColumn7
-            // 
-            this.dataGridViewTextBoxColumn7.DataPropertyName = "bi_inqty";
-            this.dataGridViewTextBoxColumn7.HeaderText = "数量";
-            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
-            this.dataGridViewTextBoxColumn7.ReadOnly = true;
-            this.dataGridViewTextBoxColumn7.Width = 80;
-            // 
-            // dataGridViewCheckBoxColumn1
-            // 
-            this.dataGridViewCheckBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn1.HeaderText = "勾选";
-            this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
-            this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.dataGridViewCheckBoxColumn1.Width = 60;
-            // 
-            // dataGridViewTextBoxColumn8
-            // 
-            this.dataGridViewTextBoxColumn8.HeaderText = "唯一条码";
-            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
-            // 
-            // dataGridViewTextBoxColumn9
-            // 
-            this.dataGridViewTextBoxColumn9.HeaderText = "中盒号";
-            this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
-            // 
-            // dataGridViewTextBoxColumn10
-            // 
-            this.dataGridViewTextBoxColumn10.HeaderText = "外箱号";
-            this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
-            // 
-            // dataGridViewCheckBoxColumn2
-            // 
-            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn2.HeaderText = "已采集";
-            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
-            // 
-            // dataGridViewCheckBoxColumn3
-            // 
-            this.dataGridViewCheckBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn3.HeaderText = "已打印";
-            this.dataGridViewCheckBoxColumn3.Name = "dataGridViewCheckBoxColumn3";
-            // 
-            // dataGridViewTextBoxColumn11
-            // 
-            this.dataGridViewTextBoxColumn11.DataPropertyName = "si_item";
-            this.dataGridViewTextBoxColumn11.HeaderText = "采集项次";
-            this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
-            this.dataGridViewTextBoxColumn11.ReadOnly = true;
-            // 
-            // dataGridViewTextBoxColumn12
-            // 
-            this.dataGridViewTextBoxColumn12.DataPropertyName = "si_kind";
-            this.dataGridViewTextBoxColumn12.HeaderText = "解析方式";
-            this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
-            // 
-            // dataGridViewTextBoxColumn13
-            // 
-            this.dataGridViewTextBoxColumn13.DataPropertyName = "si_expression";
-            this.dataGridViewTextBoxColumn13.HeaderText = "正则表达式";
-            this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
-            // 
-            // dataGridViewTextBoxColumn14
-            // 
-            this.dataGridViewTextBoxColumn14.DataPropertyName = "si_index";
-            this.dataGridViewTextBoxColumn14.HeaderText = "起始位置";
-            this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
-            // 
-            // dataGridViewTextBoxColumn15
-            // 
-            this.dataGridViewTextBoxColumn15.DataPropertyName = "si_length";
-            this.dataGridViewTextBoxColumn15.HeaderText = "字符长度";
-            this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
-            // 
-            // CleanInputAfterCollect
-            // 
-            this.CleanInputAfterCollect.AutoSize = true;
-            this.CleanInputAfterCollect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanInputAfterCollect.Location = new System.Drawing.Point(308, 274);
-            this.CleanInputAfterCollect.Margin = new System.Windows.Forms.Padding(4);
-            this.CleanInputAfterCollect.Name = "CleanInputAfterCollect";
-            this.CleanInputAfterCollect.Size = new System.Drawing.Size(151, 24);
-            this.CleanInputAfterCollect.TabIndex = 74;
-            this.CleanInputAfterCollect.Text = "采集后清除输入框";
-            this.CleanInputAfterCollect.UseVisualStyleBackColor = true;
-            // 
-            // AllCollected
-            // 
-            this.AllCollected.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllCollected.Location = new System.Drawing.Point(695, 271);
-            this.AllCollected.Margin = new System.Windows.Forms.Padding(4);
-            this.AllCollected.Name = "AllCollected";
-            this.AllCollected.Size = new System.Drawing.Size(90, 34);
-            this.AllCollected.TabIndex = 75;
-            this.AllCollected.Text = "全部已采";
-            this.AllCollected.UseVisualStyleBackColor = true;
-            this.AllCollected.Click += new System.EventHandler(this.AllCollected_Click);
-            // 
-            // PowerSetting
-            // 
-            this.PowerSetting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PowerSetting.Location = new System.Drawing.Point(695, 224);
-            this.PowerSetting.Margin = new System.Windows.Forms.Padding(4);
-            this.PowerSetting.Name = "PowerSetting";
-            this.PowerSetting.Size = new System.Drawing.Size(90, 34);
-            this.PowerSetting.TabIndex = 76;
-            this.PowerSetting.Text = "权限设置";
-            this.PowerSetting.UseVisualStyleBackColor = true;
-            this.PowerSetting.Visible = false;
-            this.PowerSetting.Click += new System.EventHandler(this.PowerSetting_Click);
-            // 
-            // ChooseAll
-            // 
-            this.ChooseAll.Location = new System.Drawing.Point(5, 316);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(53, 25);
-            this.ChooseAll.TabIndex = 70;
-            this.ChooseAll.Text = "全选";
-            this.ChooseAll.UseVisualStyleBackColor = true;
-            // 
-            // pr_code
-            // 
-            this.pr_code.Caller = null;
-            this.pr_code.Condition = null;
-            this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(101, 229);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.SelectField = null;
-            this.pr_code.SetValueField = null;
-            this.pr_code.Size = new System.Drawing.Size(199, 30);
-            this.pr_code.TabIndex = 68;
-            this.pr_code.TableName = null;
-            this.pr_code.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.pr_code_UserControlTextChanged);
-            this.pr_code.SearchIconClick += new UAS_LabelMachine.CustomControl.SearchTextBox.Icon_Click(this.pr_code_SearchIconClick);
-            // 
-            // CollectionProcess
-            // 
-            this.CollectionProcess.Controls.Add(this.Capacity);
-            this.CollectionProcess.Controls.Add(this.Process_midboxcode);
-            this.CollectionProcess.Controls.Add(this.Process_outboxcode);
-            this.CollectionProcess.Controls.Add(this.TotalCount);
-            this.CollectionProcess.Controls.Add(this.label17);
-            this.CollectionProcess.Controls.Add(this.CollectedCount);
-            this.CollectionProcess.Controls.Add(this.label14);
-            this.CollectionProcess.Controls.Add(this.label11);
-            this.CollectionProcess.Controls.Add(this.label13);
-            this.CollectionProcess.Controls.Add(this.Installed);
-            this.CollectionProcess.Controls.Add(this.Process);
-            this.CollectionProcess.Location = new System.Drawing.Point(618, 12);
-            this.CollectionProcess.Name = "CollectionProcess";
-            this.CollectionProcess.Size = new System.Drawing.Size(173, 190);
-            this.CollectionProcess.TabIndex = 80;
-            this.CollectionProcess.TabStop = false;
-            this.CollectionProcess.Text = " ";
-            // 
-            // Capacity
-            // 
-            this.Capacity.AutoSize = true;
-            this.Capacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Capacity.Location = new System.Drawing.Point(75, 84);
-            this.Capacity.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Capacity.Name = "Capacity";
-            this.Capacity.Size = new System.Drawing.Size(0, 20);
-            this.Capacity.TabIndex = 75;
-            // 
-            // Process_midboxcode
-            // 
-            this.Process_midboxcode.AutoSize = true;
-            this.Process_midboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_midboxcode.Location = new System.Drawing.Point(59, 149);
-            this.Process_midboxcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Process_midboxcode.Name = "Process_midboxcode";
-            this.Process_midboxcode.Size = new System.Drawing.Size(18, 20);
-            this.Process_midboxcode.TabIndex = 74;
-            this.Process_midboxcode.Text = "0";
-            // 
-            // Process_outboxcode
-            // 
-            this.Process_outboxcode.AutoSize = true;
-            this.Process_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process_outboxcode.Location = new System.Drawing.Point(59, 120);
-            this.Process_outboxcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Process_outboxcode.Name = "Process_outboxcode";
-            this.Process_outboxcode.Size = new System.Drawing.Size(18, 20);
-            this.Process_outboxcode.TabIndex = 73;
-            this.Process_outboxcode.Text = "0";
-            // 
-            // TotalCount
-            // 
-            this.TotalCount.AutoSize = true;
-            this.TotalCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.TotalCount.ForeColor = System.Drawing.Color.Blue;
-            this.TotalCount.Location = new System.Drawing.Point(120, 24);
-            this.TotalCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.TotalCount.Name = "TotalCount";
-            this.TotalCount.Size = new System.Drawing.Size(18, 20);
-            this.TotalCount.TabIndex = 72;
-            this.TotalCount.Text = "0";
-            // 
-            // label17
-            // 
-            this.label17.AutoSize = true;
-            this.label17.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(103, 24);
-            this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(15, 20);
-            this.label17.TabIndex = 71;
-            this.label17.Text = "/";
-            // 
-            // CollectedCount
-            // 
-            this.CollectedCount.AutoSize = true;
-            this.CollectedCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectedCount.ForeColor = System.Drawing.Color.Red;
-            this.CollectedCount.Location = new System.Drawing.Point(79, 24);
-            this.CollectedCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.CollectedCount.Name = "CollectedCount";
-            this.CollectedCount.Size = new System.Drawing.Size(18, 20);
-            this.CollectedCount.TabIndex = 70;
-            this.CollectedCount.Text = "0";
-            // 
-            // label14
-            // 
-            this.label14.AutoSize = true;
-            this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(8, 121);
-            this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(39, 20);
-            this.label14.TabIndex = 69;
-            this.label14.Text = "箱号";
-            // 
-            // label11
-            // 
-            this.label11.AutoSize = true;
-            this.label11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(8, 149);
-            this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(39, 20);
-            this.label11.TabIndex = 68;
-            this.label11.Text = "盒号";
-            // 
-            // label13
-            // 
-            this.label13.AutoSize = true;
-            this.label13.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(8, 56);
-            this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(54, 20);
-            this.label13.TabIndex = 67;
-            this.label13.Text = "当前盒";
-            // 
-            // Installed
-            // 
-            this.Installed.AutoSize = true;
-            this.Installed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Installed.Location = new System.Drawing.Point(75, 56);
-            this.Installed.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Installed.Name = "Installed";
-            this.Installed.Size = new System.Drawing.Size(0, 20);
-            this.Installed.TabIndex = 66;
-            // 
-            // Process
-            // 
-            this.Process.AutoSize = true;
-            this.Process.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Process.Location = new System.Drawing.Point(8, 24);
-            this.Process.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.Process.Name = "Process";
-            this.Process.Size = new System.Drawing.Size(54, 20);
-            this.Process.TabIndex = 65;
-            this.Process.Text = "总进度";
-            // 
-            // sg_separator
-            // 
-            this.sg_separator.Enabled = false;
-            this.sg_separator.ID = null;
-            this.sg_separator.Location = new System.Drawing.Point(387, 81);
-            this.sg_separator.Margin = new System.Windows.Forms.Padding(4);
-            this.sg_separator.Name = "sg_separator";
-            this.sg_separator.Size = new System.Drawing.Size(36, 25);
-            this.sg_separator.Str = null;
-            this.sg_separator.Str1 = null;
-            this.sg_separator.Str2 = null;
-            this.sg_separator.TabIndex = 62;
-            // 
-            // Input
-            // 
-            this.Input.ID = null;
-            this.Input.Location = new System.Drawing.Point(101, 272);
-            this.Input.Margin = new System.Windows.Forms.Padding(4);
-            this.Input.Name = "Input";
-            this.Input.Size = new System.Drawing.Size(199, 25);
-            this.Input.Str = null;
-            this.Input.Str1 = null;
-            this.Input.Str2 = null;
-            this.Input.TabIndex = 54;
-            this.Input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Input_KeyDown);
-            // 
-            // griddetno
-            // 
-            this.griddetno.ID = null;
-            this.griddetno.Location = new System.Drawing.Point(101, 165);
-            this.griddetno.Margin = new System.Windows.Forms.Padding(4);
-            this.griddetno.Name = "griddetno";
-            this.griddetno.Size = new System.Drawing.Size(135, 25);
-            this.griddetno.Str = null;
-            this.griddetno.Str1 = null;
-            this.griddetno.Str2 = null;
-            this.griddetno.TabIndex = 50;
-            this.griddetno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.griddetno_KeyDown);
-            // 
-            // sg_code
-            // 
-            this.sg_code.Caller = null;
-            this.sg_code.Condition = null;
-            this.sg_code.FormName = null;
-            this.sg_code.Location = new System.Drawing.Point(101, 81);
-            this.sg_code.Margin = new System.Windows.Forms.Padding(4);
-            this.sg_code.Name = "sg_code";
-            this.sg_code.SelectField = null;
-            this.sg_code.SetValueField = null;
-            this.sg_code.Size = new System.Drawing.Size(199, 30);
-            this.sg_code.TabIndex = 32;
-            this.sg_code.TableName = null;
-            this.sg_code.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.sg_code_UserControlTextChanged);
-            // 
-            // MessageLog
-            // 
-            this.MessageLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.MessageLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MessageLog.Location = new System.Drawing.Point(0, 761);
-            this.MessageLog.Margin = new System.Windows.Forms.Padding(4);
-            this.MessageLog.Name = "MessageLog";
-            this.MessageLog.Size = new System.Drawing.Size(1458, 123);
-            this.MessageLog.TabIndex = 28;
-            this.MessageLog.Text = "";
-            // 
-            // LabelInf
-            // 
-            this.LabelInf.AllowUserToAddRows = false;
-            this.LabelInf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.LabelInf.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
-            this.LabelInf.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
-            this.LabelInf.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.LabelInf.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.Choose,
-            this.pib_id1,
-            this.pib_pdno,
-            this.pib_prodcode,
-            this.pr_brand,
-            this.pr_vendprodcode,
-            this.pib_lotno,
-            this.pib_datecode,
-            this.DateCode1,
-            this.pib_qty,
-            this.pib_barcode,
-            this.pd_pocode,
-            this.pib_outboxcode1,
-            this.pib_outboxcode2,
-            this.pib_ifpick,
-            this.pib_ifprint});
-            this.LabelInf.Location = new System.Drawing.Point(4, 315);
-            this.LabelInf.Margin = new System.Windows.Forms.Padding(4);
-            this.LabelInf.Name = "LabelInf";
-            this.LabelInf.RowTemplate.Height = 23;
-            this.LabelInf.Size = new System.Drawing.Size(1454, 407);
-            this.LabelInf.TabIndex = 27;
-            this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
-            this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
-            this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
-            // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Width = 55;
-            // 
-            // pib_id1
-            // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 84;
-            // 
-            // pib_pdno
-            // 
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 96;
-            // 
-            // pib_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 96;
-            // 
-            // pr_brand
-            // 
-            this.pr_brand.DataPropertyName = "pr_brand";
-            this.pr_brand.HeaderText = "品牌";
-            this.pr_brand.Name = "pr_brand";
-            this.pr_brand.Width = 66;
-            // 
-            // pr_vendprodcode
-            // 
-            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
-            this.pr_vendprodcode.HeaderText = "MPN";
-            this.pr_vendprodcode.Name = "pr_vendprodcode";
-            this.pr_vendprodcode.ReadOnly = true;
-            this.pr_vendprodcode.Width = 60;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 76;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            // 
-            // DateCode1
-            // 
-            this.DateCode1.HeaderText = "DateCode1";
-            this.DateCode1.Name = "DateCode1";
-            this.DateCode1.Visible = false;
-            this.DateCode1.Width = 108;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 66;
-            // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 96;
-            // 
-            // pd_pocode
-            // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 82;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 81;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 81;
-            // 
-            // pib_ifpick
-            // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已采集";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 50;
-            // 
-            // pib_ifprint
-            // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打印";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Width = 50;
-            // 
-            // pi_inoutno
-            // 
-            this.pi_inoutno.ID = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(101, 12);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(4);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(199, 25);
-            this.pi_inoutno.Str = null;
-            this.pi_inoutno.Str1 = null;
-            this.pi_inoutno.Str2 = null;
-            this.pi_inoutno.TabIndex = 2;
-            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
-            // 
-            // SingleLabel
-            // 
-            this.SingleLabel.Controls.Add(this.SingleLabelPrinter);
-            this.SingleLabel.Controls.Add(this.SingleLabelPrint);
-            this.SingleLabel.Controls.Add(this.SingleLabelAutoPrint);
-            this.SingleLabel.Controls.Add(this.SingleLabelCombox);
-            this.SingleLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabel.Location = new System.Drawing.Point(800, 6);
-            this.SingleLabel.Margin = new System.Windows.Forms.Padding(4);
-            this.SingleLabel.Name = "SingleLabel";
-            this.SingleLabel.Size = new System.Drawing.Size(208, 299);
-            this.SingleLabel.TabIndex = 77;
-            this.SingleLabel.TabStop = false;
-            this.SingleLabel.Text = "单盘标签";
-            // 
-            // SingleLabelPrinter
-            // 
-            this.SingleLabelPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrinter.Location = new System.Drawing.Point(8, 99);
-            this.SingleLabelPrinter.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
-            this.SingleLabelPrinter.Name = "SingleLabelPrinter";
-            this.SingleLabelPrinter.Size = new System.Drawing.Size(190, 36);
-            this.SingleLabelPrinter.TabIndex = 40;
-            // 
-            // SingleLabelPrint
-            // 
-            this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(114, 252);
-            this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.SingleLabelPrint.Name = "SingleLabelPrint";
-            this.SingleLabelPrint.Size = new System.Drawing.Size(90, 34);
-            this.SingleLabelPrint.TabIndex = 36;
-            this.SingleLabelPrint.Text = "打印盘标";
-            this.SingleLabelPrint.UseVisualStyleBackColor = true;
-            this.SingleLabelPrint.Click += new System.EventHandler(this.SingleLabelPrint_Click);
-            // 
-            // SingleLabelAutoPrint
-            // 
-            this.SingleLabelAutoPrint.AutoSize = true;
-            this.SingleLabelAutoPrint.Checked = true;
-            this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(10, 145);
-            this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
-            this.SingleLabelAutoPrint.Size = new System.Drawing.Size(91, 24);
-            this.SingleLabelAutoPrint.TabIndex = 30;
-            this.SingleLabelAutoPrint.Text = "自动打印";
-            this.SingleLabelAutoPrint.UseVisualStyleBackColor = true;
-            // 
-            // SingleLabelCombox
-            // 
-            this.SingleLabelCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.SingleLabelCombox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelCombox.FormattingEnabled = true;
-            this.SingleLabelCombox.Location = new System.Drawing.Point(9, 56);
-            this.SingleLabelCombox.Margin = new System.Windows.Forms.Padding(4);
-            this.SingleLabelCombox.Name = "SingleLabelCombox";
-            this.SingleLabelCombox.Size = new System.Drawing.Size(189, 28);
-            this.SingleLabelCombox.TabIndex = 0;
-            // 
-            // MidLabel
-            // 
-            this.MidLabel.Controls.Add(this.MidLabelNum);
-            this.MidLabel.Controls.Add(this.label5);
-            this.MidLabel.Controls.Add(this.label4);
-            this.MidLabel.Controls.Add(this.MidLabelPrinter);
-            this.MidLabel.Controls.Add(this.label15);
-            this.MidLabel.Controls.Add(this.MidBoxCapacity);
-            this.MidLabel.Controls.Add(this.MidLabelPrint);
-            this.MidLabel.Controls.Add(this.MidLabelAutoPrint);
-            this.MidLabel.Controls.Add(this.MidLabelCombox);
-            this.MidLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabel.Location = new System.Drawing.Point(1011, 6);
-            this.MidLabel.Margin = new System.Windows.Forms.Padding(4);
-            this.MidLabel.Name = "MidLabel";
-            this.MidLabel.Size = new System.Drawing.Size(209, 299);
-            this.MidLabel.TabIndex = 78;
-            this.MidLabel.TabStop = false;
-            this.MidLabel.Text = "中盒标签";
-            // 
-            // MidLabelNum
-            // 
-            this.MidLabelNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelNum.ID = null;
-            this.MidLabelNum.Location = new System.Drawing.Point(59, 215);
-            this.MidLabelNum.Margin = new System.Windows.Forms.Padding(4);
-            this.MidLabelNum.Name = "MidLabelNum";
-            this.MidLabelNum.Size = new System.Drawing.Size(84, 27);
-            this.MidLabelNum.Str = null;
-            this.MidLabelNum.Str1 = null;
-            this.MidLabelNum.Str2 = null;
-            this.MidLabelNum.TabIndex = 56;
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(9, 220);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(39, 20);
-            this.label5.TabIndex = 50;
-            this.label5.Text = "盒号";
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(10, 180);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(39, 20);
-            this.label4.TabIndex = 49;
-            this.label4.Text = "容量";
-            // 
-            // MidLabelPrinter
-            // 
-            this.MidLabelPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelPrinter.Location = new System.Drawing.Point(8, 99);
-            this.MidLabelPrinter.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
-            this.MidLabelPrinter.Name = "MidLabelPrinter";
-            this.MidLabelPrinter.Size = new System.Drawing.Size(189, 36);
-            this.MidLabelPrinter.TabIndex = 41;
-            // 
-            // label15
-            // 
-            this.label15.AutoSize = true;
-            this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(120, 183);
-            this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(24, 20);
-            this.label15.TabIndex = 40;
-            this.label15.Text = "盘";
-            // 
-            // MidBoxCapacity
-            // 
-            this.MidBoxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidBoxCapacity.Location = new System.Drawing.Point(60, 177);
-            this.MidBoxCapacity.Margin = new System.Windows.Forms.Padding(4);
-            this.MidBoxCapacity.Name = "MidBoxCapacity";
-            this.MidBoxCapacity.Size = new System.Drawing.Size(51, 27);
-            this.MidBoxCapacity.TabIndex = 30;
-            // 
-            // MidLabelPrint
-            // 
-            this.MidLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelPrint.Location = new System.Drawing.Point(110, 252);
-            this.MidLabelPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.MidLabelPrint.Name = "MidLabelPrint";
-            this.MidLabelPrint.Size = new System.Drawing.Size(90, 34);
-            this.MidLabelPrint.TabIndex = 42;
-            this.MidLabelPrint.Text = "打印盒签";
-            this.MidLabelPrint.UseVisualStyleBackColor = true;
-            this.MidLabelPrint.Click += new System.EventHandler(this.MidLabelPrint_Click);
-            // 
-            // MidLabelAutoPrint
-            // 
-            this.MidLabelAutoPrint.AutoSize = true;
-            this.MidLabelAutoPrint.Checked = true;
-            this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(14, 144);
-            this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
-            this.MidLabelAutoPrint.Size = new System.Drawing.Size(91, 24);
-            this.MidLabelAutoPrint.TabIndex = 41;
-            this.MidLabelAutoPrint.Text = "自动打印";
-            this.MidLabelAutoPrint.UseVisualStyleBackColor = true;
-            // 
-            // MidLabelCombox
-            // 
-            this.MidLabelCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.MidLabelCombox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelCombox.FormattingEnabled = true;
-            this.MidLabelCombox.Location = new System.Drawing.Point(9, 56);
-            this.MidLabelCombox.Margin = new System.Windows.Forms.Padding(4);
-            this.MidLabelCombox.Name = "MidLabelCombox";
-            this.MidLabelCombox.Size = new System.Drawing.Size(189, 28);
-            this.MidLabelCombox.TabIndex = 40;
-            // 
-            // OutBoxLabel
-            // 
-            this.OutBoxLabel.Controls.Add(this.LogingOut);
-            this.OutBoxLabel.Controls.Add(this.GetOutBoxCode);
-            this.OutBoxLabel.Controls.Add(this.OutBoxNum);
-            this.OutBoxLabel.Controls.Add(this.label10);
-            this.OutBoxLabel.Controls.Add(this.WeightNet);
-            this.OutBoxLabel.Controls.Add(this.label9);
-            this.OutBoxLabel.Controls.Add(this.WeightGross);
-            this.OutBoxLabel.Controls.Add(this.label8);
-            this.OutBoxLabel.Controls.Add(this.label6);
-            this.OutBoxLabel.Controls.Add(this.OutBoxPrinter);
-            this.OutBoxLabel.Controls.Add(this.label7);
-            this.OutBoxLabel.Controls.Add(this.OutboxCapacity);
-            this.OutBoxLabel.Controls.Add(this.OutBoxLabelPackage);
-            this.OutBoxLabel.Controls.Add(this.OutBoxLabelPrint);
-            this.OutBoxLabel.Controls.Add(this.OutBoxLabelAutoPrint);
-            this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
-            this.OutBoxLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabel.Location = new System.Drawing.Point(1228, 7);
-            this.OutBoxLabel.Name = "OutBoxLabel";
-            this.OutBoxLabel.Size = new System.Drawing.Size(230, 298);
-            this.OutBoxLabel.TabIndex = 79;
-            this.OutBoxLabel.TabStop = false;
-            this.OutBoxLabel.Text = "外箱标签";
-            // 
-            // LogingOut
-            // 
-            this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(166, 19);
-            this.LogingOut.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.LogingOut.Name = "LogingOut";
-            this.LogingOut.Size = new System.Drawing.Size(52, 27);
-            this.LogingOut.TabIndex = 77;
-            this.LogingOut.TabStop = true;
-            this.LogingOut.Text = "注销";
-            this.LogingOut.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LogingOut_LinkClicked);
-            // 
-            // GetOutBoxCode
-            // 
-            this.GetOutBoxCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetOutBoxCode.Location = new System.Drawing.Point(142, 138);
-            this.GetOutBoxCode.Margin = new System.Windows.Forms.Padding(4);
-            this.GetOutBoxCode.Name = "GetOutBoxCode";
-            this.GetOutBoxCode.Size = new System.Drawing.Size(80, 34);
-            this.GetOutBoxCode.TabIndex = 93;
-            this.GetOutBoxCode.Text = "获取箱号";
-            this.GetOutBoxCode.UseVisualStyleBackColor = true;
-            this.GetOutBoxCode.Visible = false;
-            this.GetOutBoxCode.Click += new System.EventHandler(this.GetOutBoxCode_Click);
-            // 
-            // OutBoxNum
-            // 
-            this.OutBoxNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxNum.ID = null;
-            this.OutBoxNum.Location = new System.Drawing.Point(61, 219);
-            this.OutBoxNum.Margin = new System.Windows.Forms.Padding(4);
-            this.OutBoxNum.Name = "OutBoxNum";
-            this.OutBoxNum.Size = new System.Drawing.Size(48, 27);
-            this.OutBoxNum.Str = null;
-            this.OutBoxNum.Str1 = null;
-            this.OutBoxNum.Str2 = null;
-            this.OutBoxNum.TabIndex = 91;
-            // 
-            // label10
-            // 
-            this.label10.AutoSize = true;
-            this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(11, 222);
-            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(39, 20);
-            this.label10.TabIndex = 90;
-            this.label10.Text = "箱号";
-            // 
-            // WeightNet
-            // 
-            this.WeightNet.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeightNet.ID = null;
-            this.WeightNet.Location = new System.Drawing.Point(170, 266);
-            this.WeightNet.Margin = new System.Windows.Forms.Padding(4);
-            this.WeightNet.Name = "WeightNet";
-            this.WeightNet.Size = new System.Drawing.Size(48, 27);
-            this.WeightNet.Str = null;
-            this.WeightNet.Str1 = null;
-            this.WeightNet.Str2 = null;
-            this.WeightNet.TabIndex = 89;
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(119, 270);
-            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(39, 20);
-            this.label9.TabIndex = 88;
-            this.label9.Text = "净重";
-            // 
-            // WeightGross
-            // 
-            this.WeightGross.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.WeightGross.ID = null;
-            this.WeightGross.Location = new System.Drawing.Point(61, 265);
-            this.WeightGross.Margin = new System.Windows.Forms.Padding(4);
-            this.WeightGross.Name = "WeightGross";
-            this.WeightGross.Size = new System.Drawing.Size(48, 27);
-            this.WeightGross.Str = null;
-            this.WeightGross.Str1 = null;
-            this.WeightGross.Str2 = null;
-            this.WeightGross.TabIndex = 85;
-            // 
-            // label8
-            // 
-            this.label8.AutoSize = true;
-            this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label8.Location = new System.Drawing.Point(11, 269);
-            this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(39, 20);
-            this.label8.TabIndex = 83;
-            this.label8.Text = "毛重";
-            // 
-            // label6
-            // 
-            this.label6.AutoSize = true;
-            this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(11, 180);
-            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(39, 20);
-            this.label6.TabIndex = 87;
-            this.label6.Text = "容量";
-            // 
-            // OutBoxPrinter
-            // 
-            this.OutBoxPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxPrinter.Location = new System.Drawing.Point(10, 96);
-            this.OutBoxPrinter.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
-            this.OutBoxPrinter.Name = "OutBoxPrinter";
-            this.OutBoxPrinter.Size = new System.Drawing.Size(211, 38);
-            this.OutBoxPrinter.TabIndex = 82;
-            // 
-            // label7
-            // 
-            this.label7.AutoSize = true;
-            this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(108, 180);
-            this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(24, 20);
-            this.label7.TabIndex = 86;
-            this.label7.Text = "盘";
-            // 
-            // OutboxCapacity
-            // 
-            this.OutboxCapacity.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutboxCapacity.Location = new System.Drawing.Point(61, 178);
-            this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(4);
-            this.OutboxCapacity.Name = "OutboxCapacity";
-            this.OutboxCapacity.Size = new System.Drawing.Size(40, 27);
-            this.OutboxCapacity.TabIndex = 84;
-            // 
-            // OutBoxLabelPackage
-            // 
-            this.OutBoxLabelPackage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPackage.Location = new System.Drawing.Point(142, 182);
-            this.OutBoxLabelPackage.Margin = new System.Windows.Forms.Padding(4);
-            this.OutBoxLabelPackage.Name = "OutBoxLabelPackage";
-            this.OutBoxLabelPackage.Size = new System.Drawing.Size(71, 34);
-            this.OutBoxLabelPackage.TabIndex = 81;
-            this.OutBoxLabelPackage.Text = "装箱";
-            this.OutBoxLabelPackage.UseVisualStyleBackColor = true;
-            this.OutBoxLabelPackage.Click += new System.EventHandler(this.OutBoxLabelPackage_Click);
-            // 
-            // OutBoxLabelPrint
-            // 
-            this.OutBoxLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPrint.Location = new System.Drawing.Point(142, 223);
-            this.OutBoxLabelPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.OutBoxLabelPrint.Name = "OutBoxLabelPrint";
-            this.OutBoxLabelPrint.Size = new System.Drawing.Size(80, 34);
-            this.OutBoxLabelPrint.TabIndex = 80;
-            this.OutBoxLabelPrint.Text = "打印箱标";
-            this.OutBoxLabelPrint.UseVisualStyleBackColor = true;
-            this.OutBoxLabelPrint.Click += new System.EventHandler(this.OutBoxLabelPrint_Click);
-            // 
-            // OutBoxLabelAutoPrint
-            // 
-            this.OutBoxLabelAutoPrint.AutoSize = true;
-            this.OutBoxLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(15, 141);
-            this.OutBoxLabelAutoPrint.Margin = new System.Windows.Forms.Padding(4);
-            this.OutBoxLabelAutoPrint.Name = "OutBoxLabelAutoPrint";
-            this.OutBoxLabelAutoPrint.Size = new System.Drawing.Size(91, 24);
-            this.OutBoxLabelAutoPrint.TabIndex = 79;
-            this.OutBoxLabelAutoPrint.Text = "自动打印";
-            this.OutBoxLabelAutoPrint.UseVisualStyleBackColor = true;
-            // 
-            // OutBoxCombox
-            // 
-            this.OutBoxCombox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.OutBoxCombox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxCombox.FormattingEnabled = true;
-            this.OutBoxCombox.Location = new System.Drawing.Point(10, 55);
-            this.OutBoxCombox.Margin = new System.Windows.Forms.Padding(4);
-            this.OutBoxCombox.Name = "OutBoxCombox";
-            this.OutBoxCombox.Size = new System.Drawing.Size(211, 28);
-            this.OutBoxCombox.TabIndex = 78;
-            // 
-            // UAS_出货标签打印
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(1462, 885);
-            this.Controls.Add(this.PowerSetting);
-            this.Controls.Add(this.AllCollected);
-            this.Controls.Add(this.CleanInputAfterCollect);
-            this.Controls.Add(this.Fresh);
-            this.Controls.Add(this.pi_cardcode_label);
-            this.Controls.Add(this.pi_cardcode);
-            this.Controls.Add(this.ChooseAll);
-            this.Controls.Add(this.pib_id);
-            this.Controls.Add(this.pr_code);
-            this.Controls.Add(this.CleanDetail);
-            this.Controls.Add(this.Si_ItemDGV);
-            this.Controls.Add(this.CollectionProcess);
-            this.Controls.Add(this.CollectionSetting);
-            this.Controls.Add(this.sg_separator);
-            this.Controls.Add(this.sg_separator_label);
-            this.Controls.Add(this.SaveGrid);
-            this.Controls.Add(this.LabelMainTain);
-            this.Controls.Add(this.GenerateBarCode);
-            this.Controls.Add(this.CollectionUnit_label);
-            this.Controls.Add(this.CollectionUnit);
-            this.Controls.Add(this.label24);
-            this.Controls.Add(this.Input);
-            this.Controls.Add(this.pr_code_label);
-            this.Controls.Add(this.griddetno);
-            this.Controls.Add(this.AutoMatch);
-            this.Controls.Add(this.label22);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.sg_code);
-            this.Controls.Add(this.label1);
-            this.Controls.Add(this.label3);
-            this.Controls.Add(this.MessageLog);
-            this.Controls.Add(this.LabelInf);
-            this.Controls.Add(this.pi_inoutno_label);
-            this.Controls.Add(this.pi_inoutno);
-            this.Controls.Add(this.SingleLabel);
-            this.Controls.Add(this.MidLabel);
-            this.Controls.Add(this.OutBoxLabel);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
-            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "UAS_出货标签打印";
-            this.Text = " UAS-出货标签管理";
-            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.贴标机条码打印_FormClosing);
-            this.Load += new System.EventHandler(this.贴标机条码打印_Load);
-            this.SizeChanged += new System.EventHandler(this.贴标机条码打印_SizeChanged);
-            ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).EndInit();
-            this.CollectionProcess.ResumeLayout(true);
-            this.CollectionProcess.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(true);
-            this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(true);
-            this.MidLabel.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(true);
-            this.OutBoxLabel.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(true);
-            this.PerformLayout();
-        }
-
-        #endregion
-        private UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder OutBoxLabel;
-        private CustomControl.EnterTextBox OutBoxNum;
-        private System.Windows.Forms.Label label10;
-        private CustomControl.EnterTextBox WeightNet;
-        private System.Windows.Forms.Label label9;
-        private CustomControl.EnterTextBox WeightGross;
-        private System.Windows.Forms.Label label8;
-        private CustomControl.PrinterCombox OutBoxPrinter;
-        private System.Windows.Forms.Button OutBoxLabelPrint;
-        private System.Windows.Forms.ComboBox OutBoxCombox;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn2;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
-        private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.Label label7;
-        private System.Windows.Forms.NumericUpDown OutboxCapacity;
-        private System.Windows.Forms.Button OutBoxLabelPackage;
-        private System.Windows.Forms.CheckBox OutBoxLabelAutoPrint;
-        private System.Windows.Forms.ComboBox MidLabelCombox;
-        private System.Windows.Forms.CheckBox MidLabelAutoPrint;
-        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;
-        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder MidLabel;
-        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;
-        private CustomControl.DataGridViewWithSerialNum LabelInf;
-        private CustomControl.RichText.RichTextAutoBottom MessageLog;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label22;
-        private System.Windows.Forms.CheckBox AutoMatch;
-        private CustomControl.EnterTextBox griddetno;
-        private System.Windows.Forms.Label pr_code_label;
-        private CustomControl.EnterTextBox Input;
-        private System.Windows.Forms.Label label24;
-        private System.Windows.Forms.ComboBox CollectionUnit;
-        private System.Windows.Forms.Label CollectionUnit_label;
-        private System.Windows.Forms.Button GenerateBarCode;
-        private System.Windows.Forms.Button LabelMainTain;
-        private System.Windows.Forms.Button SaveGrid;
-        private System.Windows.Forms.Label sg_separator_label;
-        private CustomControl.EnterTextBox sg_separator;
-        private System.Windows.Forms.Button CollectionSetting;
-        private System.Windows.Forms.Label Process;
-        private System.Windows.Forms.Label Installed;
-        private System.Windows.Forms.Label label13;
-        private System.Windows.Forms.Label label11;
-        private System.Windows.Forms.Label label14;
-        private System.Windows.Forms.Label CollectedCount;
-        private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.Label TotalCount;
-        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder CollectionProcess;
-        private System.Windows.Forms.DataGridView Si_ItemDGV;
-        private System.Windows.Forms.Button CleanDetail;
-        private CustomControl.SearchTextBox sg_code;
-        private CustomControl.SearchTextBox pr_code;
-        private System.Windows.Forms.Label pib_id;
-        private CustomControl.ChooseAllButton ChooseAll;
-        private System.Windows.Forms.Label Process_midboxcode;
-        private System.Windows.Forms.Label Process_outboxcode;
-        private System.Windows.Forms.Label Capacity;
-        private System.Windows.Forms.Label pi_cardcode;
-        private System.Windows.Forms.Label pi_cardcode_label;
-        private System.Windows.Forms.LinkLabel Fresh;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.CheckBox CleanInputAfterCollect;
-        private System.Windows.Forms.Button AllCollected;
-        private System.Windows.Forms.Button PowerSetting;
-        private System.Windows.Forms.Button GetOutBoxCode;
-        private System.Windows.Forms.LinkLabel LogingOut;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_detno;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_index;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_kind;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_indexstring;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_length;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_expression;
-        private System.Windows.Forms.DataGridViewTextBoxColumn si_item;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_vendprodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn DateCode1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
-    }
-}
-

+ 0 - 2020
UAS-出货标签管理(吉利通)/贴标机条码打印.cs

@@ -1,2020 +0,0 @@
-using System;
-using System.Data;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Text.RegularExpressions;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using LabelManager2;
-using UAS_LabelMachine.PublicMethod;
-using UAS_LabelMachine.Entity;
-using UAS_特殊解析规则;
-using System.Globalization;
-using UAS_LabelMachine.CustomControl.GroupBoxWithBorder;
-using UAS_LabelMachine.PublicForm;
-using System.Threading;
-
-namespace UAS_LabelMachine
-{
-    public partial class UAS_出货标签打印 : Form
-    {
-        //自适应屏幕
-        AutoSizeFormClass asc = new AutoSizeFormClass();
-
-        DataHelper dh;
-
-        DataTable dt;
-
-        StringBuilder sql = new StringBuilder();
-
-        /*CodeSoft新建打印机引擎*/
-        ApplicationClass lbl;
-        /*单盘打印文件*/
-        Document SingleDoc;
-        /*中盒打印文件*/
-        Document MidDoc;
-        /*外箱打印文件*/
-        Document OutBoxDoc;
-
-        SetLoadingWindow stw;
-
-        Thread thread;
-        //当前品牌
-        string Brand;
-        string PI_ID;
-        //当前扫描的项目
-        int CurrentItemIndex = 0;
-        //当前扫描的所在行
-        int CurrentRowIndex = 0;
-        //最大的出入口单号
-        int MaxOutBoxCode = 1;
-        /*正则表达式用于项目匹配*/
-        Regex reg;
-        /*标识供应商物料编号采集是否通过*/
-        bool CollectVeProdCodePass = true;
-
-        bool CollectQTYPass = true;
-
-        bool logout = false;
-
-        object[] ItemData;
-
-        Dictionary<string, string> CollectData;
-
-        bool AllCollect = false;
-
-        /*用于存放采集项目的Grid信息*/
-        Dictionary<string, Dictionary<string, string>> SiItem;
-
-        /*需要重绘的Cell*/
-        Dictionary<DataGridViewCell, bool> PaintCell = new Dictionary<DataGridViewCell, bool>();
-        //使用二维数组进行排序
-        ArrayList<ArrayList<string>> ScanData;
-        ArrayList<string> GetData;
-
-        public UAS_出货标签打印()
-        {
-            InitializeComponent();
-        }
-
-        protected override void WndProc(ref Message m)
-        {
-            //拦截双击标题栏、移动窗体的系统消息  
-            if (m.Msg != 0xA3)
-            {
-                base.WndProc(ref m);
-            }
-        }
-
-        private void 贴标机条码打印_Load(object sender, EventArgs e)
-        {
-            LogManager.DoLog("程序启动,登陆人员【" + User.UserName + "】");
-            dh = new DataHelper();
-            CheckForIllegalCrossThreadCalls = false;
-            pi_inoutno.Focus();
-            //将本地读取的打印机设置进Combox,并选中默认打印机
-            if (User.UserAccountType == "admin")
-            {
-                PowerSetting.Visible = true;
-            }
-
-            sg_code.FormName = Name;
-            sg_code.SetValueField = new string[] { "sg_code" };
-            sg_code.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
-            sg_code.TableName = "scangroup";
-
-            pr_code.FormName = Name;
-            pr_code.SetValueField = new string[] { "pr_code", "pib_id" };
-            pr_code.TableName = "prodiodetail ";
-            pr_code.SelectField = "pd_pdno # 行号,pd_prodcode # 物料编号";
-
-            ChooseAll.ChooseAll(LabelInf);
-            CollectionUnit.Text = "盘";
-            Point pt = new Point();
-            int ScreenWidth = Screen.GetWorkingArea(pt).Width;
-            //如果分辨率大的设置的字体对应的变大 
-            if (ScreenWidth > 1366)
-            {
-                foreach (Control ctl in Controls)
-                {
-                    if (ctl is CheckBox || ctl is Label || ctl is RadioButton)
-                    {
-                        ctl.Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
-                    }
-                    if (ctl is GroupBoxWithBorder)
-                    {
-                        GroupBoxWithBorder gb = ctl as GroupBoxWithBorder;
-                        for (int i = 0; i < gb.Controls.Count; i++)
-                        {
-                            if (gb.Controls[i] is CheckBox || gb.Controls[i] is Label || gb.Controls[i] is RadioButton)
-                            {
-                                gb.Controls[i].Font = new Font("微软雅黑", 10.5F, FontStyle.Regular, GraphicsUnit.Point, 134);
-                            }
-                        }
-                    }
-                }
-            }
-            //设置获取当前屏幕大小自动全屏但是保留任务栏
-            Rectangle ScreenArea = Screen.GetWorkingArea(this);
-            Top = 0;
-            Left = 0;
-            Width = ScreenArea.Width;
-            Height = ScreenArea.Height;
-            //怡海能达添加的特殊字段
-            if (DataHelper.DBConnectionString.Contains("sz.hi-mantech.com") || DataHelper.DBConnectionString.Contains("192.168.1.200"))
-            {
-                DateCode1.Visible = true;
-            }
-            asc.controlAutoSize(this);
-
-            //实例化打印进程
-            try
-            {
-                lbl = new ApplicationClass();
-            }
-            catch (Exception)
-            {
-                MessageBox.Show("未安装CodeSoft软件或者版本不正确");
-            }
-        }
-
-        private void 贴标机条码打印_SizeChanged(object sender, EventArgs e)
-        {
-            asc.controlAutoSize(this);
-        }
-
-        private void GenerateBarCode_Click(object sender, EventArgs e)
-        {
-            生成条码 form = new 生成条码(pi_inoutno.Text);
-            form.FormClosed += LoadGridData;
-            BaseUtil.SetFormCenter(form);
-            form.ShowDialog();
-        }
-
-        private void CollectionSetting_Click(object sender, EventArgs e)
-        {
-            采集策略 form = new 采集策略(sg_code.Text);
-            form.FormClosed += sg_code_UserControlTextChanged;
-            BaseUtil.SetFormCenter(form);
-            form.ShowDialog();
-        }
-
-        private void LabelMaintain_Click(object sender, EventArgs e)
-        {
-            客户标签维护 form = new 客户标签维护();
-            BaseUtil.SetFormCenter(form);
-            form.ShowDialog();
-        }
-
-        /// <summary>
-        /// 保存明细
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void SaveGrid_Click(object sender, EventArgs e)
-        {
-            DataTable savedt = LabelInf.DataSource as DataTable;
-            if (LabelInf.DataSource != null && savedt.GetChanges() != null)
-            {
-                dh.UpDateTableByCondition((LabelInf.DataSource as DataTable), "ProdioBarCode", "pib_id");
-                LoadGridData(sender, e);
-                MessageBox.Show("保存成功!");
-            }
-        }
-
-        //放大镜选择后出发的事件
-        private void sg_code_UserControlTextChanged(object sender, EventArgs e)
-        {
-            //取已启用的的按照采集次序排序
-            dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno", "select");
-            BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
-            if (dt.Rows.Count > 0)
-            {
-                sg_separator.Text = dt.Rows[0]["sg_separator"].ToString();
-            }
-            //按DetNo排列之后的采集项
-            ScanData = new ArrayList<ArrayList<string>>();
-            //每个采集项目的子项
-            GetData = new ArrayList<string>();
-            //将数据添加进一个List的二维数组中
-            for (int i = 0; i < Si_ItemDGV.RowCount; i++)
-            {
-                //如果不包含这个则添加进数组
-                if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
-                }
-                //如果和后一个的采集次序相同
-                if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
-                }
-                else
-                {
-                    ScanData.Add(GetData);
-                    //添加完一次数据需要一个新的List
-                    GetData = new ArrayList<string>();
-                }
-            }
-            RemindUser();
-            if (ScanData.ToArray().Length > 0)
-            {
-                object[] arr = (ScanData.ToArray()[0] as ArrayList<string>).ToArray();
-                if (arr.Contains("MPN"))
-                {
-                    AutoMatch.CheckState = CheckState.Checked;
-                    AutoMatch.Enabled = true;
-                }
-                else
-                {
-                    AutoMatch.CheckState = CheckState.Unchecked;
-                    AutoMatch.Enabled = false;
-                }
-            }
-        }
-
-        //输入框Enter事件
-        private void Input_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                if (Input.Text == "")
-                {
-                    BaseUtil.ShowError("采集的数据不能为空");
-                }
-                CollectInputData();
-            }
-        }
-
-        /// <summary>
-        /// 设置自动匹配的数据的行号
-        /// </summary>
-        /// <returns></returns>
-        private void SetAutoMatchRow()
-        {
-            //采集策略的第一组数据
-            string[] arr = new string[ItemData.Length];
-            if (sg_separator.Text == "")
-            {
-                for (int i = 0; i < arr.Length; i++)
-                {
-                    arr[i] = Input.Text;
-                }
-            }
-            else
-            {
-                arr = Input.Text.Split(sg_separator.Text.ToCharArray()).ToArray();
-            }
-            bool FindAutoMatch = false;
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                for (int j = 0; j < arr.Length; j++)
-                {
-                    if (LabelInf.Rows[i].Cells["pr_vendprodcode"].Value.ToString() == MatchStr(arr[j].ToString(), "MPN") && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                    {
-                        CurrentRowIndex = i;
-                        FindAutoMatch = true;
-                        break;
-                    }
-                }
-                if (FindAutoMatch)
-                {
-                    break;
-                }
-            }
-        }
-
-        /// <summary>
-        /// 采集数据
-        /// </summary>
-        private void CollectInputData()
-        {
-            LogManager.DoLog("采集数据【" + Input.Text + "】,使用采集策略编号【" + sg_code.Text + "】");
-            //按DetNo排列之后的采集项
-            ScanData = new ArrayList<ArrayList<string>>();
-            //每个采集项目的子项
-            GetData = new ArrayList<string>();
-            //用于保存采集策略的具体信息
-            SiItem = new Dictionary<string, Dictionary<string, string>>();
-            for (int i = 0; i < Si_ItemDGV.RowCount; i++)
-            {
-                //如果不包含这个则添加进数组
-                if (!GetData.Contains(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString()))
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString());
-                }
-                //如果和后一个的采集次序相同
-                if (((i + 1) < Si_ItemDGV.RowCount) && Si_ItemDGV.Rows[i].Cells["si_detno"].Value.ToString() == Si_ItemDGV.Rows[i + 1].Cells["si_detno"].Value.ToString())
-                {
-                    GetData.Add(Si_ItemDGV.Rows[i + 1].Cells["si_item"].Value.ToString());
-                }
-                else
-                {
-                    ScanData.Add(GetData);
-                    //添加完一次数据需要一个新的List
-                    GetData = new ArrayList<string>();
-                }
-                Dictionary<string, string> item = new Dictionary<string, string>();
-                for (int j = 0; j < Si_ItemDGV.ColumnCount; j++)
-                {
-                    item.Add(Si_ItemDGV.Columns[j].DataPropertyName, Si_ItemDGV.Rows[i].Cells[j].Value.ToString());
-                }
-                SiItem.Add(Si_ItemDGV.Rows[i].Cells["si_item"].Value.ToString().ToUpper(), item);
-            }
-            //采集项目的数组
-            ItemData = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
-            //分隔符不为空的时候  //采集的项和Grid的数目不等
-
-            //用户采集的数据的分割数组
-            CollectData = new Dictionary<string, string>();
-            if (sg_separator.Text == "")
-            {
-                for (int i = 0; i < ItemData.Length; i++)
-                {
-                    CollectData.Add(ItemData[i].ToString().ToUpper(), Input.Text);
-                }
-            }
-            else
-            {
-                for (int i = 0; i < Input.Text.Split(sg_separator.Text.ToCharArray()).Length; i++)
-                {
-                    CollectData.Add(ItemData[i].ToString().ToUpper(), Input.Text.Split(sg_separator.Text.ToCharArray())[i]);
-                }
-            }
-            //首先判断当前采集的个数,如果采集的个数为1则不对数据进行分隔符验证
-            if (ItemData.Length == 1)
-            {
-                CollectData.Clear();
-                CollectData.Add(ItemData[0].ToString().ToUpper(), Input.Text);
-                //勾选了自动匹配调用该函数
-                if (AutoMatch.Checked)
-                {
-                    SetAutoMatchRow();
-                }
-                //将筛选之后的值赋给Cell 
-                SetDataToCell(ref CollectData, ItemData[0].ToString().ToUpper());
-            }
-            //如果本次采集的数据分割后和当前的采集项目个数不一样提示用户错误
-            else if (CollectData.ToArray().Length == ItemData.Length)
-            {
-                for (int i = 0; i < ItemData.Length; i++)
-                {
-                    //勾选了自动匹配调用该函数
-                    if (AutoMatch.Checked)
-                    {
-                        SetAutoMatchRow();
-                    }
-                    //将筛选之后的值赋给Cell
-                    SetDataToCell(ref CollectData, ItemData[i].ToString().ToUpper());
-                }
-            }
-            else
-            {
-                BaseUtil.ShowError("所采集的数据个数和采集项目不符");
-            }
-            //采集项目的索引+1
-            CurrentItemIndex = CurrentItemIndex + 1;
-            //如果已经采集完了最后一个
-            if (CurrentItemIndex == ScanData.ToArray().Length)
-            {
-                //数据校验均已通过则勾选上已采集
-                if (CollectVeProdCodePass && CollectQTYPass)
-                {
-                    //如果按盒号采集,所有的此盒的均更新为
-                    if (CollectionUnit.Text == "盒")
-                    {
-                        string la_id = SingleLabelCombox.SelectedValue.ToString();
-                        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();
-                        //获取打印的标签文件
-                        SingleDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                        try
-                        {
-                            for (int i = 0; i < LabelInf.RowCount; i++)
-                            {
-                                if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
-                                {
-                                    LabelInf.Rows[i].Cells["pib_lotno"].Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
-                                    LabelInf.Rows[i].Cells["pib_datecode"].Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
-                                    //将采集数据正确的Cell添加到键值对中
-                                    if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pr_vendprodcode"]))
-                                    {
-                                        PaintCell.Remove(LabelInf.Rows[i].Cells["pr_vendprodcode"]);
-                                    }
-                                    PaintCell.Add(LabelInf.Rows[i].Cells["pr_vendprodcode"], true);
-                                    if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pib_qty"]))
-                                    {
-                                        PaintCell.Remove(LabelInf.Rows[i].Cells["pib_qty"]);
-                                    }
-                                    PaintCell.Add(LabelInf.Rows[i].Cells["pib_qty"], true);
-                                    LabelInf.Refresh();
-                                    LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
-                                    //当前行的索引随循环增长
-                                    CurrentRowIndex = i;
-                                    if (SingleLabelAutoPrint.Checked)
-                                    {
-                                        AutoPrintSingleLabel(la_id, LabelUrl);
-                                    }
-                                    if (MidLabelAutoPrint.Checked)
-                                    {
-                                        AutoPrintMidLabel();
-                                    }
-                                    SetOutBoxCode2(true);
-                                }
-                            }
-                            SingleDoc.Close();
-                        }
-                        catch (Exception)
-                        {
-                            SingleDoc.Close();
-                        }
-                    }
-                    else if (CollectionUnit.Text == "全部")
-                    {
-                        for (int i = 0; i < LabelInf.RowCount; i++)
-                        {
-                            LabelInf.Rows[i].Cells["pib_lotno"].Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value;
-                            LabelInf.Rows[i].Cells["pib_datecode"].Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value;
-                            CurrentRowIndex = i;
-                            //将采集数据正确的Cell添加到键值对中
-                            if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pr_vendprodcode"]))
-                            {
-                                PaintCell.Remove(LabelInf.Rows[i].Cells["pr_vendprodcode"]);
-                            }
-                            PaintCell.Add(LabelInf.Rows[i].Cells["pr_vendprodcode"], true);
-                            if (PaintCell.ContainsKey(LabelInf.Rows[i].Cells["pib_qty"]))
-                            {
-                                PaintCell.Remove(LabelInf.Rows[i].Cells["pib_qty"]);
-                            }
-                            PaintCell.Add(LabelInf.Rows[i].Cells["pib_qty"], true);
-                            LabelInf.Refresh();
-                            LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
-                          
-                            SetOutBoxCode2(true);
-                        }
-                    }
-                    else
-                    {
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
-                        //勾选了单盘自动打印
-                        if (SingleLabelAutoPrint.Checked)
-                        {
-                            try
-                            {
-                                string la_id = SingleLabelCombox.SelectedValue.ToString();
-                                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();
-                                SingleDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                                AutoPrintSingleLabel(la_id, LabelUrl);
-                                SingleDoc.Close();
-                            }
-                            catch (Exception)
-                            {
-                                SingleDoc.Close();
-                            }
-                        }
-                        //勾选了中盒自动打印
-                        if (MidLabelAutoPrint.Checked)
-                        {
-                            AutoPrintMidLabel();
-                        }
-                        //勾选了外箱自动打印
-                        if (OutBoxLabelAutoPrint.Checked)
-                        {
-
-                        }
-                    }
-                }
-                //采集未通过的时候
-                else
-                {
-                    //如果自动采集采集未成功需要移动到下一行
-                    if (!AutoMatch.Checked)
-                    {
-                        SetRowIndexToCollectRow();
-                    }
-                }
-                //当前项目已采集完成,重置采集项目
-                CurrentItemIndex = 0;
-                //未勾选自动匹配,设置到下一个未采集的行
-                if (!AutoMatch.Checked)
-                {
-                    SetRowIndexToCollectRow();
-                }
-                //采集完了一行后Index+1
-                //CurrentRowIndex = (CurrentRowIndex + 1 == LabelInf.RowCount) ? CurrentRowIndex : CurrentRowIndex + 1;
-            }
-            //提醒用户需要采集的数据
-            RemindUser();
-            RefreshProcessData();
-            MessageLog.AppendText(">>扫描到数据" + Input.Text + "\n", Color.Blue);
-            if (CleanInputAfterCollect.Checked)
-            {
-                Input.Text = "";
-            }
-        }
-        //设置行的索引到当前需要采集的行
-        private void SetRowIndexToCollectRow()
-        {
-            //获取当前需要采集的行
-            for (int i = CurrentRowIndex; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                {
-                    griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
-                    pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
-                    CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
-                    break;
-                }
-            }
-        }
-
-        private void AutoPrintSingleLabel(string la_id, string LabelUrl)
-        {
-            //获取维护的变量名称和SQL
-            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");
-            //用标签本身的变量作为最外层的循环条件去匹配
-            for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
-            {
-                Console.WriteLine(j);
-                Console.WriteLine(SingleDoc.Variables.FreeVariables.Item(j + 1).Name);
-                Console.WriteLine(SingleDoc.Variables.FreeVariables.Item(j + 1).DisplayValue);
-                //将维护的模板参数和模板本身的参数名称进行比对
-                for (int k = 0; k < dt.Rows.Count; k++)
-                {
-                    //名称相等的时候,取SQL进行值的查询
-                    if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                    {
-                    
-                        //获取打印执行的SQL
-                        string sql = dt.Rows[k]["lp_sql"].ToString();
-                        if (sql.IndexOf("{") == 0)
-                        {
-                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
-                            LogManager.DoLog("打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                        }
-                        else
-                        {
-                            sql = sql.Substring(0, sql.IndexOf("{"));
-                            //获取对应行的pib_id
-                            string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
-                            if (sql.ToLower().Contains("pib_lotno"))
-                            {
-                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                            }
-                            else if (sql.ToLower().Contains("pib_datecode"))
-                            {
-                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
-                            }
-                            else
-                            {
-                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql + pib_id).ToString();
-                            }
-                            LogManager.DoLog("打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + pib_id + ",取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                        }
-                    }
-                    else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                    {
-                        if (LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value != null)
-                        {
-                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value.ToString();
-                        }
-                    }
-                }
-            }
-            //保存参数打印
-            SingleDoc.Save();
-            SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
-            SingleDoc.PrintDocument();
-            LogManager.DoLog("执行打印单盘,pib_id:" + LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString() + ",标签地址" + LabelUrl);
-            LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
-            LogManager.DoLog("打印文件" + SingleDoc.Name + "关闭");
-        }
-
-        /// <summary>
-        /// 提醒用户当前采集的项目
-        /// </summary>
-        private void RemindUser()
-        {
-            SetRowIndexToCollectRow();
-
-            if (ScanData.ToArray().Length > 0)
-            {
-                object[] arr = (ScanData.ToArray()[CurrentItemIndex] as ArrayList<string>).ToArray();
-                string Inf = "";
-                for (int i = 0; i < arr.Length; i++)
-                {
-                    Inf += arr[i] + "  ";
-                }
-                MessageLog.AppendText(">>当前采集行" + (CurrentRowIndex + 1) + ",请采集" + Inf + "\n", Color.Green);
-            }
-        }
-
-        /// <summary>
-        /// 自定义函数 将匹配之后的值设置到Cell中,传递引用,每次赋值之后从List中移除已使用过的
-        /// </summary>
-        /// <param name="data"></param>
-        /// <param name="kind"></param>
-        private void SetDataToCell(ref Dictionary<string, string> setdata, string kind)
-        {
-            int length = setdata.Count;
-            for (int j = 0; j < length; j++)
-            {
-                string[] data = new string[setdata.Count];
-                for (int i = 0; i < length; i++)
-                {
-                    data[i] = setdata[kind];
-                }
-                for (int i = 0; i < data.Length; i++)
-                {
-                    DataGridViewCell cell = null;
-                    string Matchstr = "";
-                    switch (kind.ToString().ToUpper())
-                    {
-                        case "DATECODE":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"];
-                            Matchstr = MatchStr(data[j], "DATECODE");
-                            setdata.Remove("DATECODE");
-                            length--;
-                            break;
-                        case "LOTNO":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"];
-                            Matchstr = MatchStr(data[j], "LOTNO");
-                            setdata.Remove("LOTNO");
-                            length--;
-                            break;
-                        case "MPN":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_vendprodcode"];
-                            Matchstr = MatchStr(data[j], "MPN");
-                            //采集的供应商号不匹配的话
-                            if (cell.Value.ToString() != Matchstr)
-                            {
-                                CollectVeProdCodePass = false;
-                                //添加需要重绘的Cell
-                                if (PaintCell.ContainsKey(cell))
-                                {
-                                    PaintCell.Remove(cell);
-                                }
-                                PaintCell.Add(cell, false);
-                                LabelInf.Refresh();
-                                MessageLog.AppendText(">>供应商物料编号不匹配\n", Color.Red);
-                            }
-                            else
-                            {
-                                if (PaintCell.ContainsKey(cell))
-                                {
-                                    PaintCell.Remove(cell);
-                                }
-                                PaintCell.Add(cell, true);
-                                LabelInf.Refresh();
-                                CollectVeProdCodePass = true;
-                            }
-                            setdata.Remove("MPN");
-                            length--;
-                            break;
-                        case "QTY":
-                            cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_qty"];
-                            Matchstr = MatchStr(data[j], "QTY");
-                            //如果采集的数量不相等的话
-                            if (cell.Value.ToString() != Matchstr)
-                            {
-                                CollectQTYPass = false;
-                                //添加需要重绘的Cell
-                                if (PaintCell.ContainsKey(cell))
-                                {
-                                    PaintCell.Remove(cell);
-                                }
-                                PaintCell.Add(cell, false);
-                                LabelInf.Refresh();
-                                MessageLog.AppendText(">>数量不匹配\n", Color.Red);
-                            }
-                            else
-                            {
-                                if (PaintCell.ContainsKey(cell))
-                                {
-                                    PaintCell.Remove(cell);
-                                }
-                                PaintCell.Add(cell, true);
-                                LabelInf.Refresh();
-                                CollectQTYPass = true;
-                            }
-                            setdata.Remove("QTY");
-                            length--;
-                            break;
-                        default:
-                            break;
-                    }
-                    //如果数据为空或者数据不为空的时候但是和需要采集的数据不相等的情况下进行采集
-                    //MPN和QTY只做比较不需要赋值
-                    if (cell.Value.ToString() == "" || cell.Value.ToString() != Matchstr)
-                    {
-                        string MatchResult = "";
-                        if (kind != "MPN" && kind != "QTY")
-                        {
-                            cell.Value = Matchstr;
-                            MatchResult = "成功";
-                        }
-                        else
-                        {
-                            MatchResult = "失败";
-                        }
-                        switch (SiItem[kind]["si_kind"])
-                        {
-                            case "索引字符":
-                                LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",使用字符" + SiItem[kind]["si_indexstring"] + ",匹配后字符串" + Matchstr);
-                                break;
-                            case "起始位置":
-                                LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",从第" + SiItem[kind]["si_index"] + "位开始匹配,匹配后字符串" + Matchstr);
-                                break;
-                            case "二次解析":
-                                LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",匹配后字符串" + Matchstr);
-                                break;
-                            case "全部":
-                                LogManager.DoLog("采集项" + kind + ",匹配结果:【" + MatchResult + "】,匹配方式:" + SiItem[kind]["si_kind"] + ",匹配后字符串" + Matchstr);
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-                    else
-                    {
-                        LogManager.DoLog("采集项" + kind + ",匹配结果:【成功】,匹配方式:" + SiItem[kind]["si_kind"] + ",,匹配后字符串" + Matchstr);
-                    }
-                }
-            }
-            //添加外箱号,如果外箱号的箱内容量不为0并且已经采集完成
-            SetOutBoxCode2(false);
-        }
-
-        //
-        /// <summary>
-        /// 设置外箱号
-        /// </summary>
-        /// <param name="BatchCollect">是否批量采集</param>
-        private void SetOutBoxCode2(bool BatchCollect)
-        {
-            if (OutboxCapacity.Value != 0)
-            {
-                //获取当前出入口单最大的外箱号
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    string outboxcode = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
-                    if (outboxcode.Contains("-"))
-                    {
-                        if (int.Parse(outboxcode.Split('-')[0] == "" ? "1" : outboxcode.Split('-')[0]) > MaxOutBoxCode)
-                        {
-                            MaxOutBoxCode = int.Parse(outboxcode.Split('-')[0]);
-                        }
-                    }
-                    else
-                    {
-                        if (int.Parse(outboxcode == "" ? "0" : outboxcode) > MaxOutBoxCode)
-                        {
-                            MaxOutBoxCode = int.Parse(outboxcode);
-                        }
-                    }
-                }
-                //统计最大的箱号存在多少
-                int MaxOutBoxCodeCount = 0;
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString() == MaxOutBoxCode.ToString())
-                    {
-                        MaxOutBoxCodeCount = MaxOutBoxCodeCount + 1;
-                    }
-                }
-                //如果箱内的盒数量小于容量,继续使用此箱号赋值,否则箱号+1
-                if (BatchCollect)
-                {
-                    if (MaxOutBoxCodeCount < OutboxCapacity.Value)
-                    {
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = MaxOutBoxCode;
-                    }
-                    else
-                    {
-                        MaxOutBoxCode = MaxOutBoxCode + 1;
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = MaxOutBoxCode;
-                    }
-                }
-                else
-                {
-                    if (MaxOutBoxCodeCount <= OutboxCapacity.Value)
-                    {
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = MaxOutBoxCode;
-                    }
-                    else
-                    {
-                        MaxOutBoxCode = MaxOutBoxCode + 1;
-                        LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = MaxOutBoxCode;
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// 自定义函数 根据匹配规则
-        /// si_item的二维数组,str是需要赋值的字符串,item表示DateCode,LotNo等
-        /// </summary>
-        /// <param name="SiItem"></param>
-        /// <param name="str"></param>
-        /// <param name="item"></param>
-        /// <returns></returns>
-        private string MatchStr(string str, string item)
-        {
-            string kind = SiItem[item]["si_kind"];
-            //起始字符不为空的时候
-            switch (kind)
-            {
-                case "起始位置":
-                    if (SiItem[item]["si_index"] != "")
-                    {
-                        try
-                        {
-                            //长度不为空的时候按照指定的长度去取数据
-                            if (SiItem[item]["si_length"] != "")
-                            {
-                                str = str.Substring(int.Parse(SiItem[item]["si_index"]), int.Parse(SiItem[item]["si_length"]));
-                            }
-                            //长度为空的时候取index之后的全部数据
-                            else
-                            {
-                                str = str.Substring(int.Parse(SiItem[item]["si_index"]));
-                            }
-                        }
-                        catch (Exception e)
-                        {
-                            LogManager.DoLog(e.Message);
-                        }
-                    }
-                    break;
-                case "索引字符":
-                    try
-                    {
-                        if (SiItem[item]["si_indexstring"] != "")
-                        {
-                            //长度不为空的时候按照指定的长度去取数据
-                            if (SiItem[item]["si_length"] != "")
-                            {
-                                str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1, int.Parse(SiItem[item]["si_length"]));
-                            }
-                            //长度为空的时候取index之后的全部数据
-                            else
-                            {
-                                str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1);
-                            }
-                        }
-                    }
-                    catch (Exception e)
-                    {
-                        LogManager.DoLog(e.Message);
-                    }
-                    break;
-                case "二次解析":
-                    str = Analysis.AnalysisData(Brand, item, str);
-                    break;
-                case "全部":
-                    break;
-                default:
-                    break;
-            }
-            if (SiItem[item]["si_expression"] != "")
-            {
-                string log = "使用正则表达式" + SiItem[item]["si_expression"] + "匹配数据" + str;
-                reg = new Regex(SiItem[item]["si_expression"]);
-                str = reg.Match(str).Value;
-                log += ",匹配后数据" + str;
-                LogManager.DoLog(log);
-            }
-            return str;
-        }
-
-        //关闭窗口前提示用户确认
-        private void 贴标机条码打印_FormClosing(object sender, FormClosingEventArgs e)
-        {
-            //如果不是注销的话
-            if (!logout)
-            {
-                string close = MessageBox.Show(this.ParentForm, "是否关闭", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                if (close.ToString() != "Yes")
-                {
-                    e.Cancel = true;
-                }
-                else
-                {
-                    //防止未安装打印程序时报错导致窗体无法关闭
-                    try
-                    {
-                        lbl.Application.Quit();
-                        LogManager.DoLog("关闭程序");
-                        //  System.Windows.Forms.Application.Exit();
-                    }
-                    catch
-                    {
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// 出入库单录入框的回车事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void pi_inoutno_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyCode == Keys.Enter)
-            {
-                sql.Clear();
-                sql.Append("select pi_id,pi_cardcode from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                if (dt.Rows.Count > 0)
-                {
-                    pi_cardcode.Text = dt.Rows[0]["pi_cardcode"].ToString();
-                    PI_ID = dt.Rows[0]["pi_id"].ToString();
-                    LoadGridData(sender, e);
-                    //刷新采集进度
-                    RefreshProcessData();
-                    //设置当前的最大箱号
-                    for (int i = 0; i < LabelInf.RowCount; i++)
-                    {
-                        string outboxcode = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
-                        //如果包含有-,则需要解析
-                        if (outboxcode.Contains("-"))
-                        {
-                            if (int.Parse(outboxcode.Split('-')[0] == "" ? "1" : outboxcode.Split('-')[0]) > MaxOutBoxCode)
-                            {
-                                MaxOutBoxCode = int.Parse(outboxcode.Split('-')[0]);
-                            }
-                        }
-                        else
-                        {
-                            if (int.Parse(outboxcode == "" ? "1" : outboxcode) > MaxOutBoxCode)
-                            {
-                                MaxOutBoxCode = int.Parse(outboxcode);
-                            }
-                        }
-                    }
-                    sql.Clear();
-                    sql.Append("select cl_labelname,cl_isdefault,la_id from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-                    sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-                    sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode='共用')) and cl_labeltype='单盘'");
-                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                    SingleLabelCombox.DataSource = dt;
-                    SingleLabelCombox.DisplayMember = "cl_labelname";
-                    SingleLabelCombox.ValueMember = "la_id";
-
-                    sql.Clear();
-                    sql.Append("select cl_labelname,cl_isdefault,la_id from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-                    sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-                    sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode='共用')) and cl_labeltype='中盒'");
-                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                    MidLabelCombox.DataSource = dt.Copy();
-                    MidLabelCombox.DisplayMember = "cl_labelname";
-                    MidLabelCombox.ValueMember = "la_id";
-
-                    sql.Clear();
-                    sql.Append("select cl_labelname,cl_isdefault,la_id from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-                    sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-                    sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode='共用')) and cl_labeltype='外箱'");
-                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                    OutBoxCombox.DataSource = dt.Copy();
-                    OutBoxCombox.DisplayMember = "cl_labelname";
-                    OutBoxCombox.ValueMember = "la_id";
-                    //重置采集项次
-                    CurrentItemIndex = 0;
-                    LogManager.DoLog("输入单号【" + pi_inoutno.Text + "】");
-                }
-                else
-                {
-                    MessageBox.Show("当前出入库单号不存在!");
-                }
-            }
-        }
-
-        private void SingleBoxPrint()
-        {
-            try
-            {
-                string la_id = SingleLabelCombox.SelectedValue.ToString();
-                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();
-                SingleDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                //查询该模板维护的所有参数
-                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");
-                if (dt.Rows.Count > 0)
-                {
-                    //获取全部的中盒号
-                    Dictionary<string, bool> outboxcode1 = new Dictionary<string, bool>();
-                    //判断所有盒号为该盒的是否勾选已采集
-                    outboxcode1.Add(LabelInf.Rows[0].Cells["pib_outboxcode1"].Value.ToString(), true);
-                    for (int i = 0; i < LabelInf.RowCount; i++)
-                    {
-                        if (i + 1 < LabelInf.RowCount)
-                        {
-                            //如果本行的中盒数量和下一行相等的话
-                            if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString())
-                            {
-                                if (!outboxcode1.ContainsKey(LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString()))
-                                {
-                                    outboxcode1.Add(LabelInf.Rows[i + 1].Cells["pib_outboxcode1"].Value.ToString(), true);
-                                }
-                            }
-                        }
-                        if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
-                        {
-                            if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                            {
-                                outboxcode1[LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()] = false;
-                            }
-                        }
-                    }
-                    //用于判断用户是否勾选了行
-                    int CheckedRowCount=0;
-                    //打印所有的选中行
-                    for (int i = 0; i < LabelInf.RowCount; i++)
-                    {
-                        //勾选了并且未打印
-                        if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True" && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
-                        {
-                            CheckedRowCount = CheckedRowCount + 1;
-                            CurrentRowIndex = i;
-                            //以标签模板的参数为基准,循环取数
-                            for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
-                            {
-                                //将维护的模板参数和模板本身的参数名称进行比对
-                                for (int k = 0; k < dt.Rows.Count; k++)
-                                {
-                                    //名称相等的时候,取SQL进行值的查询
-                                    if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                    {
-                                        //获取打印执行的SQL
-                                        string sql = dt.Rows[k]["lp_sql"].ToString();
-                                        if (sql.IndexOf("{") == 0)
-                                        {
-                                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql).ToString();
-                                            LogManager.DoLog("打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + dt.Rows[k]["lp_sql"].ToString() + ",取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                        }
-                                        else
-                                        {
-                                            sql = sql.Substring(0, sql.IndexOf("{"));
-                                            //获取对应行的pib_id
-                                            string pib_id = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
-                                            if (sql.ToLower().Contains("pib_lotno"))
-                                            {
-                                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["pib_lotno"].Value.ToString();
-                                            }
-                                            else if (sql.ToLower().Contains("pib_datecode"))
-                                            {
-                                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["pib_datecode"].Value.ToString();
-                                            }
-                                            else
-                                            {
-                                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(sql + pib_id).ToString();
-                                            }
-                                            LogManager.DoLog("打印参数【" + SingleDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + sql + pib_id + ",取到值" + SingleDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                        }
-                                    }
-                                    else if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                    {
-                                        if (LabelInf.Rows[i].Cells["DateCode1"].Value != null)
-                                        {
-                                            SingleDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["DateCode1"].Value.ToString();
-                                        }
-                                    }
-                                }
-                            }
-                            //保存参数打印
-                            SingleDoc.Save();
-                            SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
-                            SingleDoc.PrintDocument();
-                            LogManager.DoLog("执行打印单盘,pib_id:" + LabelInf.Rows[i].Cells["pib_id1"].Value.ToString() + ",标签地址" + LabelUrl);
-                            //勾选为已打印
-                            LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
-                        }
-                        if (MidLabelAutoPrint.Checked)
-                        {
-                            //判断当前行的盒号和下一行不相等或者已经是最后一行了
-                            if (i + 1 == LabelInf.RowCount || LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() != LabelInf.Rows[i + 1 == LabelInf.RowCount ? i : i + 1].Cells["pib_outboxcode1"].Value.ToString())
-                            {
-                                if (outboxcode1[LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()])
-                                {
-                                    if (MidLabelCombox.SelectedValue != null)
-                                    {
-                                        string la_id_mid = MidLabelCombox.SelectedValue.ToString();
-                                        string cl_labelname_mid = MidLabelCombox.Text;
-                                        string LabelUrl_mid = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id_mid + "' and cl_labelname='" + cl_labelname_mid + "'").ToString();
-                                        MidDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl_mid, cl_labelname_mid));
-                                        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_mid, "select");
-                                        for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
-                                        {
-                                            //将维护的模板参数和模板本身的参数名称进行比对
-                                            for (int k = 0; k < dt.Rows.Count; k++)
-                                            {
-                                                //名称相等的时候,取SQL进行值的查询
-                                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                                {
-                                                    //获取对应行的pib_id
-                                                    string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
-                                                    string pib_outboxcode1 = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                                                    //获取打印执行的SQL
-                                                    string sql = dt.Rows[k]["lp_sql"].ToString();
-                                                    //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                                                    try
-                                                    {
-                                                        string ExeSQL = "";
-                                                        if (sql.Contains("pib_lotno"))
-                                                        {
-                                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                                                        }
-                                                        else if (sql.Contains("pib_datecode"))
-                                                        {
-                                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
-                                                        }
-                                                        else
-                                                        {
-                                                            ExeSQL = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                                            ExeSQL = ExeSQL.Substring(0, ExeSQL.IndexOf("{")) + pib_outboxcode1;
-                                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                                        }
-                                                        LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                                    }
-                                                    catch (Exception)
-                                                    {
-                                                        BaseUtil.ShowError("SQL维护不正确,请检查SQL语句");
-                                                    }
-                                                }
-                                                else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                                {
-                                                    if (LabelInf.Rows[i].Cells["DateCode1"].Value != null)
-                                                    {
-                                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[i].Cells["DateCode1"].Value.ToString();
-                                                    }
-                                                }
-                                            }
-                                        }
-                                        //保存参数打印
-                                        MidDoc.Save();
-                                        MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
-                                        MidDoc.PrintDocument();
-                                        LogManager.DoLog("执行打印中盒,pib_id:" + LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString());
-                                        lbl.ActiveDocument.Close();
-                                        LogManager.DoLog("打印文件" + MidDoc.Name + "关闭");
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    if (CheckedRowCount == 0) {
-                        MessageBox.Show("未勾选打印明细!");
-                    }
-                    if (SingleDoc != null)
-                    {
-                        SingleDoc.Close();
-                        LogManager.DoLog("打印文件" + SingleDoc.Name + "关闭");
-                    }  
-                    if (MidDoc != null)
-                    {
-                        MidDoc.Close();
-                        LogManager.DoLog("打印文件" + MidDoc.Name + "关闭");
-                    }
-                    outboxcode1.Clear();
-                }
-                else
-                {
-                    BaseUtil.ShowError("此模板尚未维护参数");
-                }
-            }
-            catch (Exception ex)
-            {
-                if (SingleDoc != null)
-                {
-                    SingleDoc.Close();
-                }
-                if (MidDoc != null)
-                {
-                    MidDoc.Close();
-                }
-                LogManager.DoLog(ex.Message);
-            }
-        }
-
-
-        private void SingleLabelPrint_Click(object sender, EventArgs e)
-        {
-            thread = new Thread(SingleBoxPrint);
-            stw = new SetLoadingWindow(thread, "正在打印单盘");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
-        }
-
-        private void MidLabelPrint_Click(object sender, EventArgs e)
-        {
-            if (MidLabelNum.Text == "")
-            {
-                BaseUtil.ShowError("手动打印必须填写盒号");
-            }
-            bool FindMidLabel = false;
-
-            if (MidLabelCombox.SelectedValue != null)
-            {
-                string la_id = MidLabelCombox.SelectedValue.ToString();
-                string cl_labelname = MidLabelCombox.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();
-                MidDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                //中盒号所在的行
-                int MidLabelRowIndex = 0;
-                //查找是否存在该中盒号
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (MidLabelNum.Text == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                    {
-                        //找到了输入的中盒号停止循环
-                        FindMidLabel = true;
-                        MidLabelRowIndex = i;
-                        break;
-                    }
-                }
-                //找到了指定的盒号
-                if (FindMidLabel)
-                {
-                    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");
-                    try
-                    {
-                        for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
-                        {
-                            //将维护的模板参数和模板本身的参数名称进行比对
-                            for (int k = 0; k < dt.Rows.Count; k++)
-                            {
-                                //名称相等的时候,取SQL进行值的查询
-                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                {
-                                    //获取对应行的pib_id
-                                    string pib_id = LabelInf.Rows[MidLabelRowIndex].Cells["pib_id1"].Value.ToString();
-                                    string pib_outboxcode1 = LabelInf.Rows[MidLabelRowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                                    //获取打印执行的SQL
-                                    string sql = dt.Rows[k]["lp_sql"].ToString();
-                                    //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                                    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
-                                        {
-                                            string ExeSQL = "";
-                                            if (sql.Contains("pib_lotno"))
-                                            {
-                                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[MidLabelRowIndex].Cells["pib_lotno"].Value.ToString();
-                                            }
-                                            else if (sql.Contains("pib_datecode"))
-                                            {
-                                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[MidLabelRowIndex].Cells["pib_datecode"].Value.ToString();
-                                            }
-                                            else
-                                            {
-                                                ExeSQL = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                                ExeSQL = ExeSQL.Substring(0, ExeSQL.IndexOf("{")) + pib_outboxcode1;
-                                                MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                            }
-                                            LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                        }
-                                    }
-                                    catch (Exception)
-                                    {
-                                        BaseUtil.ShowError("SQL维护不正确,请检查SQL语句\n" + sql);
-                                    }
-                                }
-                                else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                {
-                                    if (LabelInf.Rows[MidLabelRowIndex].Cells["DateCode1"].Value != null)
-                                    {
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[MidLabelRowIndex].Cells["DateCode1"].Value.ToString();
-                                    }
-                                }
-                            }
-                        }
-                        //保存参数打印
-                        MidDoc.Save();
-                        MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
-                        MidDoc.PrintDocument();
-                        LogManager.DoLog("执行打印中盒,pib_id:" + LabelInf.Rows[MidLabelRowIndex].Cells["pib_id1"].Value.ToString() + ",标签地址" + LabelUrl);
-                        MidDoc.Close();
-                        LogManager.DoLog("打印文件" + MidDoc.Name + "关闭");
-                    }
-                    catch (Exception)
-                    {
-                        MidDoc.Close();
-                    }
-                }
-                else
-                {
-                    BaseUtil.ShowError("该出入库单未找到该中盒号!");
-                }
-            }
-            else
-            {
-                MessageBox.Show("未维护中盒模板");
-            }
-        }
-
-        private void OutBoxPrint()
-        {
-            List<string> Outboxcode = new List<string>();
-            //如果未勾选箱号则对勾选的数据的箱号进行整合
-            if (OutBoxNum.Text == "")
-            {
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
-                    {
-                        string outboxcode2 = LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString();
-                        //富为使用包装单的逻辑
-                        if (outboxcode2.Contains("-")&& !Outboxcode.Contains(outboxcode2))
-                        {
-                            int small = int.Parse(outboxcode2.Split('-')[0]);
-                            int big = int.Parse(outboxcode2.Split('-')[1]);
-                            for (int n = 0; n < big-small+1; n++)
-                            {
-                                Outboxcode.Add(outboxcode2);
-                            }
-                        }
-                        //如果不包含该箱号则进行添加
-                        if (!Outboxcode.Contains(outboxcode2))
-                        {
-                            Outboxcode.Add(outboxcode2);
-                        }
-                    }
-                }
-                if (Outboxcode.ToArray().Length > 0)
-                {
-                    string la_id = OutBoxCombox.SelectedValue.ToString();
-                    string cl_labelname = OutBoxCombox.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();
-                    OutBoxDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                    try
-                    {
-                        // 循环打印外箱号
-                        for (int i = 0; i < Outboxcode.ToArray().Length; i++)
-                        {
-                            for (int h = 0; h < LabelInf.RowCount; h++)
-                            {
-                                //try
-                                //{
-                                if (LabelInf.Rows[h].Cells["pib_outboxcode2"].Value.ToString() == Outboxcode.ToArray()[i])
-                                {
-                                    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");
-                                    for (int j = 0; j < OutBoxDoc.Variables.FreeVariables.Count; j++)
-                                    {
-                                        //将维护的模板参数和模板本身的参数名称进行比对
-                                        for (int k = 0; k < dt.Rows.Count; k++)
-                                        {
-                                            //名称相等的时候,取SQL进行值的查询
-                                            if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                            {
-                                                //如果毛重填写的是毛重或者净重
-                                                if (dt.Rows[k]["lp_valuetype"].ToString() == "字符串" && dt.Rows[k]["lp_sql"].ToString() == "GW")
-                                                {
-                                                    OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightGross.Text;
-                                                    LogManager.DoLog("打印参数【毛重】赋值," + WeightGross.Text);
-                                                }
-                                                else if (dt.Rows[k]["lp_valuetype"].ToString() == "字符串" && dt.Rows[k]["lp_sql"].ToString() == "NW")
-                                                {
-                                                    OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightNet.Text;
-                                                    LogManager.DoLog("打印参数【净重】赋值," + WeightNet.Text);
-                                                }
-                                                else
-                                                {
-                                                    //获取对应行的pib_id
-                                                    string pib_id = LabelInf.Rows[h].Cells["pib_id1"].Value.ToString();
-                                                    string pib_outboxcode2 = LabelInf.Rows[h].Cells["pib_outboxcode2"].Value.ToString();
-                                                    string ExeSQL = "";
-                                                    //获取打印执行的SQL
-                                                    string sql = dt.Rows[k]["lp_sql"].ToString();
-                                                    //try
-                                                    //{
-                                                    if (sql.Contains("pib_lotno"))
-                                                    {
-                                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[h].Cells["pib_lotno"].Value.ToString();
-                                                    }
-                                                    else if (sql.Contains("pib_datecode"))
-                                                    {
-                                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[h].Cells["pib_datecode"].Value.ToString();
-                                                    }
-                                                    else
-                                                    {
-                                                        ExeSQL = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                                        ExeSQL = ExeSQL.Substring(0, ExeSQL.IndexOf("{")) + "'" + pib_outboxcode2 + "'";
-                                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                                    }
-                                                    LogManager.DoLog("打印参数【" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                                }
-                                            }
-                                            else if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                            {
-                                                if (LabelInf.Rows[h].Cells["DateCode1"].Value != null)
-                                                {
-                                                    OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[h].Cells["DateCode1"].Value.ToString();
-                                                }
-                                            }
-                                        }
-                                    }
-                                    //保存参数打印
-                                    OutBoxDoc.Save();
-                                    OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
-                                    OutBoxDoc.PrintDocument();
-                                    LogManager.DoLog("执行打印外箱,pib_id:" + LabelInf.Rows[i].Cells["pib_id1"].Value.ToString() + ",标签地址" + LabelUrl);
-                                    break;
-                                }
-                            }
-                        }
-                        OutBoxDoc.Close();
-                        LogManager.DoLog("打印文件" + OutBoxDoc.Name + "关闭");
-                    }
-                    catch
-                    {
-                        if (OutBoxDoc != null) {
-                            OutBoxDoc.Close();
-                        }
-                        LogManager.DoLog("打印文件" + OutBoxDoc.Name + "关闭");
-                    }
-                }
-            }
-            else
-            {
-                bool FindMidLabel = false;
-                string la_id = OutBoxCombox.SelectedValue.ToString();
-                string cl_labelname = OutBoxCombox.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();
-                OutBoxDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                try
-                {
-                    int OutBoxLabelRowIndex = 0;
-                    //查找是否存在该中盒号
-                    for (int i = 0; i < LabelInf.RowCount; i++)
-                    {
-                        if (OutBoxNum.Text == LabelInf.Rows[i].Cells["pib_outboxcode2"].Value.ToString())
-                        {
-                            //找到了输入的中盒号停止循环
-                            FindMidLabel = true;
-                            OutBoxLabelRowIndex = i;
-                            break;
-                        }
-                    }
-                    //找到了指定的盒号
-                    if (FindMidLabel)
-                    {
-                        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");
-                        for (int j = 0; j < OutBoxDoc.Variables.FreeVariables.Count; j++)
-                        {
-                            //将维护的模板参数和模板本身的参数名称进行比对
-                            for (int k = 0; k < dt.Rows.Count; k++)
-                            {
-                                //名称相等的时候,取SQL进行值的查询
-                                if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                {
-                                    //如果毛重填写的是毛重或者净重
-                                    if (dt.Rows[k]["lp_valuetype"].ToString() == "字符串" && dt.Rows[k]["lp_sql"].ToString() == "GW")
-                                    {
-                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightGross.Text;
-                                        LogManager.DoLog("打印参数【毛重】赋值," + WeightGross.Text);
-                                    }
-                                    else if (dt.Rows[k]["lp_valuetype"].ToString() == "字符串" && dt.Rows[k]["lp_sql"].ToString() == "NW")
-                                    {
-                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = WeightNet.Text;
-                                        LogManager.DoLog("打印参数【净重】赋值," + WeightNet.Text);
-                                    }
-                                    else
-                                    {
-                                        //获取对应行的pib_id
-                                        string pib_id = LabelInf.Rows[OutBoxLabelRowIndex].Cells["pib_id1"].Value.ToString();
-                                        string pib_outboxcode2 = LabelInf.Rows[OutBoxLabelRowIndex].Cells["pib_outboxcode2"].Value.ToString();
-                                        //获取打印执行的SQL
-                                        string sql = dt.Rows[k]["lp_sql"].ToString();
-                                        //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                                        try
-                                        {
-                                            string ExeSQL = "";
-                                            if (sql.Contains("pib_lotno"))
-                                            {
-                                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[OutBoxLabelRowIndex].Cells["pib_lotno"].Value.ToString();
-                                            }
-                                            else if (sql.Contains("pib_datecode"))
-                                            {
-                                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[OutBoxLabelRowIndex].Cells["pib_datecode"].Value.ToString();
-                                            }
-                                            else
-                                            {
-                                                ExeSQL = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                                ExeSQL = ExeSQL.Substring(0, ExeSQL.IndexOf("{")) + "'" + pib_outboxcode2 + "'";
-                                                OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).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);
-                                            BaseUtil.ShowError("SQL维护不正确,请检查SQL语句\n" + sql);
-                                        }
-                                    }
-                                }
-                                else if (OutBoxDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                {
-                                    if (LabelInf.Rows[OutBoxLabelRowIndex].Cells["DateCode1"].Value != null)
-                                    {
-                                        OutBoxDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[OutBoxLabelRowIndex].Cells["DateCode1"].Value.ToString();
-                                    }
-                                }
-                            }
-                        }
-                        //保存参数打印
-                        OutBoxDoc.Save();
-                        OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
-                        OutBoxDoc.PrintDocument();
-                        LogManager.DoLog("执行打印外箱,pib_id:" + LabelInf.Rows[OutBoxLabelRowIndex].Cells["pib_id1"].Value.ToString() + ",标签地址" + LabelUrl);
-                        OutBoxDoc.Close();
-                        LogManager.DoLog("打印文件" + OutBoxDoc.Name + "关闭");
-                    }
-                    else
-                    {
-                        BaseUtil.ShowError("该出入库单未找到该外箱号!");
-                    }
-                }
-                catch (Exception)
-                {
-                    OutBoxDoc.Close();
-                    LogManager.DoLog("打印文件" + OutBoxDoc.Name + "关闭");
-                }
-            }
-            Outboxcode.Clear();
-        }
-
-        private void CleanDetail_Click(object sender, EventArgs e)
-        {
-            ArrayList<string> DeleteID = new ArrayList<string>();
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
-                {
-                    DeleteID.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString());
-                }
-            }
-            //勾选了删除的明细之后
-            if (DeleteID.ToArray().Length > 0)
-            {
-                string close = MessageBox.Show(this.ParentForm, "删除后不可恢复,是否确认删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                if (close.ToString() == "Yes")
-                {
-                    dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
-                    MessageBox.Show("删除成功");
-                    LoadGridData(sender, e);
-                    RefreshProcessData();
-                }
-            }
-            else
-            {
-                MessageBox.Show("尚未勾选需要删除的明细");
-            }
-        }
-
-        private void OutBoxLabelPrint_Click(object sender, EventArgs e)
-        {
-            thread = new Thread(OutBoxPrint);
-            stw = new SetLoadingWindow(thread, "正在打印外箱");
-            BaseUtil.SetFormCenter(stw);
-            stw.ShowDialog();
-        }
-
-        /// <summary>
-        /// 刷新采集进度
-        /// </summary>
-        private void RefreshProcessData()
-        {
-            if (LabelInf.Rows.Count > 0)
-            {
-                //设置初始化的采集进度
-                int Count = 0;
-                int CurrentMidBoxCollectedCount = 0;
-                //当前盒号的总盘数
-                int CurrentMidBoxTotalCount = 0;
-                //未超出当前范围的时候
-
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
-                    {
-                        Count++;
-                    }
-                    //和当前编辑箱号相等行
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True" && LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                    {
-                        CurrentMidBoxCollectedCount++;
-                    }
-                    //当前盒号一共有几盘
-                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())
-                    {
-                        CurrentMidBoxTotalCount++;
-                    }
-                }
-                Capacity.Text = "可装" + CurrentMidBoxTotalCount.ToString() + "盘";
-                Installed.Text = "已装" + CurrentMidBoxCollectedCount.ToString() + "盘";
-                //设置当前的箱号和盒号
-                Process_outboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value.ToString();
-                Process_midboxcode.Text = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                //设置当前总数和已采集数量
-                TotalCount.Text = LabelInf.RowCount.ToString();
-                CollectedCount.Text = Count.ToString();
-
-            }
-        }
-
-        /// <summary>
-        /// 自定义函数  加载明细行的数据,多处使用添加进函数
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void LoadGridData(object sender, EventArgs e)
-        {
-            //如果是富为则使用特殊的查询语句                                
-            if (DataHelper.DBConnectionString.Contains("richwell") || DataHelper.DBConnectionString.Contains("192.168.0.88"))
-            {
-                sql.Clear();
-                sql.Append("select pd_pocode,pd_inoutno,pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pr_brand,pr_vendprodcode,");
-                sql.Append("pib_lotno,pib_datecode,pib_qty,pib_barcode,pib_outboxcode1,pib_outboxcode2,pib_ifpick,pib_ifprint,");
-                sql.Append("pr_spec,pd_prodcode,pd_pocode from prodiobarcode  left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno ");
-                sql.Append("and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join (select pd_prodcode ");
-                sql.Append("prcode,pd_pocode pocode,max(pd_detno) pd_detno from  prodinout left join packing on packing.pi_code=prodinout.pi_packingcode ");
-                sql.Append("left join packingdetail on packing.pi_id=pd_piid where prodinout.pi_id='" + PI_ID + "' group by pd_prodcode,pd_pocode");
-                sql.Append(")A on pd_pocode=A.pocode and pd_prodcode=A.PRCODE where pd_piid='" + PI_ID + "' order by a.pd_detno,pib_id");
-                GetOutBoxCode.Visible = true;
-            }
-            else
-            {
-                sql.Clear();
-                sql.Append("select pd_pocode,pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,pr_brand,pr_vendprodcode,");
-                sql.Append("pib_lotno,pib_datecode,pib_qty,pib_barcode,pib_outboxcode1,pib_outboxcode2,pib_ifpick,pib_ifprint");
-                sql.Append(",sa_pocode from prodiobarcode left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
-                sql.Append(" pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode ");
-                sql.Append("where pd_piid='" + PI_ID + "' order by pr_spec,pd_prodcode,pib_id");
-            }
-            dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            BaseUtil.FillDgvWithDataTable(LabelInf, dt);
-            //有数据的话默认取第一条的品牌去取采集策略
-            TotalCount.Text = LabelInf.RowCount.ToString();
-            if (LabelInf.RowCount > 0)
-            {
-                Brand = LabelInf.Rows[0].Cells["pr_brand"].FormattedValue.ToString();
-                if (Brand != "")
-                    sg_code.Text = dh.getFieldDataByCondition("scangroup", "sg_code", "sg_brand='" + Brand + "'").ToString();
-            }
-            //绑定数据之后往下找到未采集的数据显示在当前采集的栏目
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                {
-                    griddetno.Text = LabelInf.Rows[i].Cells["pib_pdno"].FormattedValue.ToString();
-                    pr_code.Text = LabelInf.Rows[i].Cells["pib_prodcode"].FormattedValue.ToString();
-                    pib_id.Text = LabelInf.Rows[i].Cells["pib_id1"].FormattedValue.ToString();
-                    CurrentRowIndex = LabelInf.Rows[i].Cells["pib_prodcode"].RowIndex;
-                    break;
-                }
-            }
-        }
-
-        /// <summary>
-        /// 重绘Cell的颜色
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void LabelInf_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
-        {
-            bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
-            if (e.ColumnIndex > 0)
-            {
-                if (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")
-                {
-                    SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                    e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
-                    Rectangle border = e.CellBounds;
-                    border.Width -= 1;
-                    e.Graphics.DrawRectangle(Pens.White, border);
-                    e.PaintContent(e.CellBounds);
-                    e.Handled = true;
-                }
-                if (e.RowIndex >= 0)
-                {
-                    //重绘制定的Cell,表示采集的数量不匹配
-                    if (LabelInf.Columns[e.ColumnIndex].Name == "pib_qty" && PaintCell.ContainsKey(LabelInf.Rows[e.RowIndex].Cells["pib_qty"]))
-                    {
-                        SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                        e.Graphics.FillRectangle(PaintCell[LabelInf.Rows[e.RowIndex].Cells["pib_qty"]] ? Brushes.ForestGreen : Brushes.Red, e.CellBounds);
-                        Rectangle border = e.CellBounds;
-                        border.Width -= 1;
-                        e.Graphics.DrawRectangle(Pens.Black, border);
-                        e.PaintContent(e.CellBounds);
-                        e.Handled = true;
-                    }
-                    //表示采集的供应商物料编号不匹配
-                    if (LabelInf.Columns[e.ColumnIndex].Name == "pr_vendprodcode" && PaintCell.ContainsKey(LabelInf.Rows[e.RowIndex].Cells["pr_vendprodcode"]))
-                    {
-                        SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                        e.Graphics.FillRectangle(PaintCell[LabelInf.Rows[e.RowIndex].Cells["pr_vendprodcode"]] ? Brushes.ForestGreen : Brushes.Red, e.CellBounds);
-                        Rectangle border = e.CellBounds;
-                        border.Width -= 1;
-                        e.Graphics.DrawRectangle(Pens.Black, border);
-                        e.PaintContent(e.CellBounds);
-                        e.Handled = true;
-                    }
-                }
-            }
-        }
-
-        private void pr_code_SearchIconClick(object sender, EventArgs e)
-        {
-            pr_code.Condition = "  pd_inoutno='" + pi_inoutno.Text + "'";
-        }
-
-        private void OutBoxLabelPackage_Click(object sender, EventArgs e)
-        {
-            MaxOutBoxCode = MaxOutBoxCode + 1;
-        }
-
-        private void pr_code_UserControlTextChanged(object sender, EventArgs e)
-        {
-            //用户在重新勾选后重置采集项目的索引
-            CurrentItemIndex = 0;
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (pr_code.Text == LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                {
-                    CurrentRowIndex = i;
-                    break;
-                }
-            }
-        }
-
-        private void Refresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            KeyEventArgs e2 = new KeyEventArgs(Keys.Enter);
-            pi_inoutno_KeyDown(sender, e2);
-        }
-
-        /// <summary>
-        /// 采集明细切换
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void griddetno_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (Keys.Enter == e.KeyData)
-            {
-                bool FindDetno = false;
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_pdno"].Value.ToString() == griddetno.Text && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                    {
-                        FindDetno = true;
-                        CurrentItemIndex = 0;
-                        CurrentRowIndex = i;
-                        RemindUser();
-                        break;
-                    }
-                }
-                if (!FindDetno)
-                {
-                    BaseUtil.ShowError("不存在未采集的明细序号" + griddetno.Text);
-                }
-            }
-        }
-
-        private void AutoPrintMidLabel()
-        {
-            bool FullBox = true;
-            //判断所有盒号未该盒的是否勾选已采集
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                    {
-                        FullBox = false;
-                    }
-                }
-            }
-            //如果当前箱号已经装满了
-            if (FullBox)
-            {
-                if (MidLabelCombox.SelectedValue != null)
-                {
-                    try
-                    {
-                        string la_id = MidLabelCombox.SelectedValue.ToString();
-                        string cl_labelname = MidLabelCombox.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();
-                        MidDoc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelUrl, cl_labelname));
-                        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");
-                        for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
-                        {
-                            //将维护的模板参数和模板本身的参数名称进行比对
-                            for (int k = 0; k < dt.Rows.Count; k++)
-                            {
-                                //名称相等的时候,取SQL进行值的查询
-                                if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == dt.Rows[k]["lp_name"].ToString())
-                                {
-                                    //获取对应行的pib_id
-                                    string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
-                                    string pib_outboxcode1 = LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString();
-                                    //获取打印执行的SQL
-                                    string sql = dt.Rows[k]["lp_sql"].ToString();
-                                    //select * from productiobarcode where pib_id={pib_id} and pib_outboxcode1={pib_outboxcode1}
-                                    try
-                                    {
-                                        string ExeSQL = "";
-                                        if (sql.Contains("pib_lotno"))
-                                        {
-                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                                        }
-                                        else if (sql.Contains("pib_datecode"))
-                                        {
-                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
-                                        }
-                                        else
-                                        {
-                                            ExeSQL = sql.Substring(0, sql.IndexOf("{")) + pib_id + sql.Substring(sql.IndexOf("}") + 1);
-                                            ExeSQL = ExeSQL.Substring(0, ExeSQL.IndexOf("{")) + pib_outboxcode1;
-                                            MidDoc.Variables.FreeVariables.Item(j + 1).Value = dh.GetLabelParam(ExeSQL).ToString();
-                                        }
-                                        LogManager.DoLog("打印参数【" + MidDoc.Variables.FreeVariables.Item(j + 1).Name + "】赋值," + "取值SQL:" + ExeSQL + ",取到值" + MidDoc.Variables.FreeVariables.Item(j + 1).Value);
-                                    }
-                                    catch (Exception)
-                                    {
-                                        BaseUtil.ShowError("SQL维护不正确,请检查SQL语句");
-                                    }
-                                }
-                                else if (MidDoc.Variables.FreeVariables.Item(j + 1).Name == "DateCode1")
-                                {
-                                    if (LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value != null)
-                                    {
-                                        MidDoc.Variables.FreeVariables.Item(j + 1).Value = LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value.ToString();
-                                    }
-                                }
-                            }
-                        }
-                        //保存参数打印
-                        MidDoc.Save();
-                        MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
-                        MidDoc.PrintDocument();
-                        LogManager.DoLog("执行打印中盒,pib_id:" + LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString());
-                        MidDoc.Close();
-                        LogManager.DoLog("打印文件" + MidDoc.Name + "关闭");
-                    }
-                    catch (Exception)
-                    {
-                        MidDoc.Close();
-                    }
-                }
-                else
-                {
-                    MessageBox.Show("未维护中盒模板");
-                }
-            }
-        }
-
-        private void LoginOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            Login login = new Login();
-            logout = true;
-            Hide();
-            login.ShowDialog();
-            Close();
-        }
-
-        /// <summary>
-        /// 勾选的时候自动打印
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void LabelInf_CellValueChanged(object sender, DataGridViewCellEventArgs e)
-        {
-            if (LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
-            {
-                string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
-                try
-                {
-                    System.DateTime dt = System.DateTime.ParseExact(datecode, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);
-                    GregorianCalendar gc = new GregorianCalendar();
-                    int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
-                    if (weekOfYear < 10)
-                    {
-                        LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value = dt.Year.ToString().Substring(2, 2) + "0" + weekOfYear;
-                    }
-                    else
-                    {
-                        LabelInf.Rows[CurrentRowIndex].Cells["DateCode1"].Value = dt.Year.ToString().Substring(2, 2) + weekOfYear;
-                    }
-                }
-                catch (Exception ex)
-                {
-                    Console.WriteLine(ex.Message);
-                }
-            }
-        }
-
-        private void AllCollected_Click(object sender, EventArgs e)
-        {
-            if (AllCollect == false)
-            {
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "False")
-                    {
-                        LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
-                        AllCollect = true;
-                        CurrentRowIndex = i;
-                    }
-                }
-            }
-            else
-            {
-                for (int i = 0; i < LabelInf.RowCount; i++)
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
-                    {
-                        LabelInf.Rows[i].Cells["pib_ifpick"].Value = false;
-                        AllCollect = false;
-                    }
-                }
-            }
-        }
-
-        private void PowerSetting_Click(object sender, EventArgs e)
-        {
-            PowerSetting pw = new PowerSetting();
-            BaseUtil.SetFormCenter(pw);
-            pw.ShowDialog();
-        }
-
-        private void GetOutBoxCode_Click(object sender, EventArgs e)
-        {
-            int Current = 0;
-            sql.Clear();
-            sql.Append("select pd_qty,pd_cartonno,pr_zxbzs,pd_cartons from packingdetail left join packing on pd_piid=pi_id left join prodinout on ");
-            sql.Append("pi_packingcode=packing.pi_code left join product on pd_prodcode=pr_code where pi_inoutno='" + pi_inoutno.Text + "' order by pd_detno");
-            dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                int pd_qty = int.Parse(dt.Rows[i]["pd_qty"].ToString());
-                int pr_zxbzs = int.Parse(dt.Rows[i]["pr_zxbzs"].ToString());
-                int pd_cartons = int.Parse(dt.Rows[i]["pd_cartons"].ToString());
-                for (int j = 0; j < pd_qty * pd_cartons / pr_zxbzs; j++)
-                {
-                    LabelInf.Rows[Current].Cells["pib_outboxcode2"].Value = dt.Rows[i]["pd_cartonno"].ToString();
-                    Current++;
-                }
-            }
-            SaveGrid_Click(sender, e);
-        }
-
-        private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (close.ToString() == "Yes")
-            {
-                Login login = new Login();
-                //注销的时候需要将拼接的连接字符串置空
-                DataHelper.DBConnectionString = null;
-                this.Hide();
-                login.ShowDialog();
-                this.Close();
-            }
-        }
-
-        private void LabelInf_DataError(object sender, DataGridViewDataErrorEventArgs e)
-        {
-
-        }
-    }
-}