ソースを参照

FTP站点内外网可配置

章政 6 年 前
コミット
52c37dd43a

+ 3 - 0
UAS-出货标签管理(贸易版)/App.config

@@ -68,6 +68,9 @@
       <setting name="OutPrinter" serializeAs="String">
         <value />
       </setting>
+      <setting name="FTPNET" serializeAs="String">
+        <value>False</value>
+      </setting>
     </UAS_LabelMachine.Properties.Settings>
   </userSettings>
 </configuration>

+ 15 - 0
UAS-出货标签管理(贸易版)/Login.Designer.cs

@@ -41,6 +41,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.IP = new System.Windows.Forms.TextBox();
             this.ComData = new System.Windows.Forms.BindingSource(this.components);
+            this.FTPNet = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LoginIcon)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComData)).BeginInit();
@@ -160,12 +161,25 @@
             this.IP.Size = new System.Drawing.Size(196, 29);
             this.IP.TabIndex = 9;
             // 
+            // FTPNet
+            // 
+            this.FTPNet.AutoSize = true;
+            this.FTPNet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.FTPNet.Location = new System.Drawing.Point(584, 168);
+            this.FTPNet.Name = "FTPNet";
+            this.FTPNet.Size = new System.Drawing.Size(80, 24);
+            this.FTPNet.TabIndex = 11;
+            this.FTPNet.Text = "FTP内网";
+            this.FTPNet.UseVisualStyleBackColor = true;
+            this.FTPNet.Visible = false;
+            // 
             // Login
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackgroundImage = global::UAS_LabelMachine.Properties.Resources.timg;
             this.ClientSize = new System.Drawing.Size(884, 461);
+            this.Controls.Add(this.FTPNet);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.IP);
             this.Controls.Add(this.Master);
@@ -205,5 +219,6 @@
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.TextBox IP;
         private System.Windows.Forms.BindingSource ComData;
+        private System.Windows.Forms.CheckBox FTPNet;
     }
 }

+ 7 - 0
UAS-出货标签管理(贸易版)/Login.cs

@@ -33,6 +33,10 @@ namespace UAS_LabelMachine
         {
             SystemInf.dh = dh = new DataHelper();
             SystemInf.sdh = sdh = new SqliteDBHelper("LabelPrint.db3");
+            if (dh.GetConfig("FTPNET", "FTPNET").ToString() != "")
+            {
+                FTPNet.Visible = true;
+            }
             //获取账套信息
             Masterdt = (DataTable)dh.ExecuteSql("select ma_function,ms_pwd,ma_user from master ", "select");
             DataTable MasterDB = Masterdt.Clone();
@@ -52,6 +56,7 @@ namespace UAS_LabelMachine
             //读取上次登陆时的用户名和选择的账套
             UserName.Text = Properties.Settings.Default.LastLoginUser;
             MasterCombox.Text = Properties.Settings.Default.LastLoginMaster;
+            FTPNet.Checked = Properties.Settings.Default.FTPNET;
             IP.Text = Properties.Settings.Default.IPAddress;
             //如果上次的用户名不为空则直接跳到密码输入框
             if (UserName.Text != "")
@@ -89,7 +94,9 @@ namespace UAS_LabelMachine
                 Properties.Settings.Default.LastLoginUser = UserName.Text;
                 Properties.Settings.Default.LastLoginMaster = MasterCombox.Text;
                 Properties.Settings.Default.IPAddress = IP.Text;
+                Properties.Settings.Default.FTPNET = FTPNet.Checked;
                 Properties.Settings.Default.Save();
+                ftpOperater.Inner = FTPNet.Checked;
                 //弹出标签打印的主界面
                 UAS_出货标签打印 main = new UAS_出货标签打印(MasterCombox.Text);
                 main.StartPosition = FormStartPosition.CenterScreen;

+ 27 - 24
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -11,35 +11,38 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        ////海创外网地址
-        //private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
-        ////海创ERP地址
-        //public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
-        ////海创FTP
-        //public static readonly string FTPAdress = "ftp://" + Properties.Settings.Default.IPAddress + "|HCFTP|Admin1@#";
+        //海创外网地址
+        private readonly string ConnectionStrings = "Data Source=cmityj.gicp.net/orcl;User ID=HC_TEST;PassWord=select!#%*(";
+        //海创ERP地址
+        public static readonly string ERPAddesss = "http://cmityj.gicp.net:8099/ERP/";
+        //海创FTP
+        public static readonly string FTPAddress = "ftp://cmityj.gicp.net|HCFTP|Admin1@#";
 
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "HC_TEST";
-
-        //凯而高地址
-        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        //凯而高ERP地址
-        public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
-        //凯而高FTP
-        public static readonly string FTPAdress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+        public static readonly string InnerFTPAddress = "ftp://192.168.1.8|HCFTP|Admin1@#";
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "GOLDEN";
+        public static readonly string Masters = "HC_TEST";
+
+        ////凯而高地址
+        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=112.25.154.186)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////凯而高ERP地址
+        //public static readonly string ERPAddesss = "http://112.25.154.186:8099/ERP/";
+        ////凯而高FTP
+        //public static readonly string FTPAddress = "ftp://112.25.154.186:21|KEGFTP|Admin1@#";
+
+        //public static readonly string InnerFTPAddress = "ftp://112.25.154.186:21|HCFTP|Admin1@#";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "GOLDEN";
 
         ////凯而高
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=KRG_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.12)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         ////凯而高ERP地址
         //public static readonly string ERPAddesss = "http://192.168.100.11:8099/ERP/";
         ////凯而高FTP
-        //public static readonly string FTPAdress = "ftp://192.168.100.11:21|KEGFTP|Admin1@#";
+        //public static readonly string FTPAddress = "ftp://192.168.100.11:21|KEGFTP|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套
@@ -50,8 +53,8 @@ namespace UAS_LabelMachine
         ////高登ERP地址
         //public static readonly string ERPAddesss = "http://183.238.39.179:8099/ERP/";
         ////高登TP
-        //public static readonly string FTPAdress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
-        ////public static readonly string FTPAdress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
+        //public static readonly string FTPAddress = "ftp://192.168.0.158:21|GOLDENMES|Admin1@#";
+        ////public static readonly string FTPAddress = "ftp://183.238.39.179:21|GOLDENMES|Admin1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套
@@ -62,7 +65,7 @@ namespace UAS_LabelMachine
         ////怡海能达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";
+        //public static readonly string FTPAddress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套
@@ -73,7 +76,7 @@ namespace UAS_LabelMachine
         ////华商龙ERP地址
         //public static readonly string ERPAddesss = "http://218.18.115.198:8888/ERP/";
         ////华商龙FTP
-        //public static readonly string FTPAdress = "ftp://218.18.115.198:21|Print|Administrator1@#";
+        //public static readonly string FTPAddress = "ftp://218.18.115.198:21|Print|Administrator1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1523";
         ////需要显示的账套
@@ -84,7 +87,7 @@ namespace UAS_LabelMachine
         ////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@#";
+        //public static readonly string FTPAddress = "ftp://192.168.253.9/PrintFile|mesconfig|Administrator1@#";
         ////Oracle端口
         //public static readonly string OraclePort = "1521";
         ////需要显示的账套

+ 12 - 2
UAS-出货标签管理(贸易版)/PublicMethod/ftpOperater.cs

@@ -8,7 +8,9 @@ namespace UAS_LabelMachine
 {
     class ftpOperater
     {
-        public static string FTPAddress = DataHelper.FTPAdress.Split('|')[0];
+        public static string FTPAddress = DataHelper.FTPAddress.Split('|')[0];
+
+        public static bool Inner = false;
 
         public static string DownLoadTo = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"打印标签\";
 
@@ -18,7 +20,15 @@ namespace UAS_LabelMachine
 
         public ftpOperater(bool PortModel)
         {
-            string[] FTPInf = DataHelper.FTPAdress.Split('|');
+            string[] FTPInf;
+            if (!Inner)
+            {
+                FTPInf = DataHelper.FTPAddress.Split('|');
+            }
+            else
+            {
+                FTPInf = DataHelper.InnerFTPAddress.Split('|');
+            }
             this.ftpServerIP = FTPInf[0];
             this.ftpUser = FTPInf[1];
             this.ftpPwd = FTPInf[2];

+ 100 - 21
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -100,6 +100,7 @@
             this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
             this.下载模板ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.ImportExcel = new System.Windows.Forms.OpenFileDialog();
+            this.pi_class = new System.Windows.Forms.Label();
             this.cu_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.label18 = new System.Windows.Forms.Label();
@@ -173,6 +174,11 @@
             this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.MidLabelCombox = new System.Windows.Forms.ComboBox();
             this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.groupBoxWithBorder2 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.cu_print_outpo = new System.Windows.Forms.CheckBox();
+            this.cu_print_outdc = new System.Windows.Forms.CheckBox();
+            this.cu_print_outlotno = new System.Windows.Forms.CheckBox();
+            this.cu_print_outprod = new System.Windows.Forms.CheckBox();
             this.label19 = new System.Windows.Forms.Label();
             this.OutDocRefresh = new System.Windows.Forms.LinkLabel();
             this.LogingOut = new System.Windows.Forms.LinkLabel();
@@ -185,7 +191,6 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.pi_class = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -196,6 +201,7 @@
             this.MidLabel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).BeginInit();
             this.OutBoxLabel.SuspendLayout();
+            this.groupBoxWithBorder2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).BeginInit();
             this.SuspendLayout();
             // 
@@ -813,6 +819,16 @@
             // 
             this.ImportExcel.FileName = "ImportExcel";
             // 
+            // pi_class
+            // 
+            this.pi_class.AutoSize = true;
+            this.pi_class.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_class.Location = new System.Drawing.Point(100, 255);
+            this.pi_class.Name = "pi_class";
+            this.pi_class.Size = new System.Drawing.Size(0, 20);
+            this.pi_class.TabIndex = 90;
+            this.pi_class.Visible = false;
+            // 
             // cu_code
             // 
             this.cu_code.AllPower = null;
@@ -1196,7 +1212,7 @@
             this.LabelInf.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.LabelInf.Name = "LabelInf";
             this.LabelInf.RowTemplate.Height = 23;
-            this.LabelInf.Size = new System.Drawing.Size(1251, 326);
+            this.LabelInf.Size = new System.Drawing.Size(1251, 333);
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellEndEdit);
             this.LabelInf.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.LabelInf_CellMouseClick);
@@ -1632,6 +1648,7 @@
             // 
             // OutBoxLabel
             // 
+            this.OutBoxLabel.Controls.Add(this.groupBoxWithBorder2);
             this.OutBoxLabel.Controls.Add(this.label19);
             this.OutBoxLabel.Controls.Add(this.OutDocRefresh);
             this.OutBoxLabel.Controls.Add(this.LogingOut);
@@ -1649,11 +1666,75 @@
             this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2);
             this.OutBoxLabel.Name = "OutBoxLabel";
             this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2);
-            this.OutBoxLabel.Size = new System.Drawing.Size(172, 238);
+            this.OutBoxLabel.Size = new System.Drawing.Size(178, 238);
             this.OutBoxLabel.TabIndex = 79;
             this.OutBoxLabel.TabStop = false;
             this.OutBoxLabel.Text = "外箱标签";
             // 
+            // groupBoxWithBorder2
+            // 
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_outpo);
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_outdc);
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_outlotno);
+            this.groupBoxWithBorder2.Controls.Add(this.cu_print_outprod);
+            this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(5, 108);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(87, 124);
+            this.groupBoxWithBorder2.TabIndex = 91;
+            this.groupBoxWithBorder2.TabStop = false;
+            this.groupBoxWithBorder2.Text = "合并条件";
+            // 
+            // cu_print_outpo
+            // 
+            this.cu_print_outpo.AutoSize = true;
+            this.cu_print_outpo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_outpo.Location = new System.Drawing.Point(7, 47);
+            this.cu_print_outpo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_outpo.Name = "cu_print_outpo";
+            this.cu_print_outpo.Size = new System.Drawing.Size(75, 21);
+            this.cu_print_outpo.TabIndex = 94;
+            this.cu_print_outpo.Text = "客户合同";
+            this.cu_print_outpo.UseVisualStyleBackColor = true;
+            // 
+            // cu_print_outdc
+            // 
+            this.cu_print_outdc.AutoSize = true;
+            this.cu_print_outdc.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_outdc.Location = new System.Drawing.Point(7, 97);
+            this.cu_print_outdc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_outdc.Name = "cu_print_outdc";
+            this.cu_print_outdc.Size = new System.Drawing.Size(44, 21);
+            this.cu_print_outdc.TabIndex = 93;
+            this.cu_print_outdc.Text = "DC";
+            this.cu_print_outdc.UseVisualStyleBackColor = true;
+            // 
+            // cu_print_outlotno
+            // 
+            this.cu_print_outlotno.AutoSize = true;
+            this.cu_print_outlotno.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_outlotno.Location = new System.Drawing.Point(7, 72);
+            this.cu_print_outlotno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_outlotno.Name = "cu_print_outlotno";
+            this.cu_print_outlotno.Size = new System.Drawing.Size(63, 21);
+            this.cu_print_outlotno.TabIndex = 92;
+            this.cu_print_outlotno.Text = "LotNo";
+            this.cu_print_outlotno.UseVisualStyleBackColor = true;
+            // 
+            // cu_print_outprod
+            // 
+            this.cu_print_outprod.AutoSize = true;
+            this.cu_print_outprod.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_outprod.Location = new System.Drawing.Point(7, 22);
+            this.cu_print_outprod.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.cu_print_outprod.Name = "cu_print_outprod";
+            this.cu_print_outprod.Size = new System.Drawing.Size(75, 21);
+            this.cu_print_outprod.TabIndex = 91;
+            this.cu_print_outprod.Text = "客户料号";
+            this.cu_print_outprod.UseVisualStyleBackColor = true;
+            // 
             // label19
             // 
             this.label19.AutoSize = true;
@@ -1689,7 +1770,7 @@
             // 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(91, 167);
+            this.GetOutBoxCode.Location = new System.Drawing.Point(101, 167);
             this.GetOutBoxCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.GetOutBoxCode.Name = "GetOutBoxCode";
             this.GetOutBoxCode.Size = new System.Drawing.Size(68, 26);
@@ -1702,7 +1783,7 @@
             // 
             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(47, 205);
+            this.OutBoxNum.Location = new System.Drawing.Point(130, 136);
             this.OutBoxNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(37, 23);
@@ -1715,7 +1796,7 @@
             // 
             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(6, 208);
+            this.label10.Location = new System.Drawing.Point(91, 139);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1725,7 +1806,7 @@
             // 
             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(6, 172);
+            this.label6.Location = new System.Drawing.Point(91, 112);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1744,7 +1825,7 @@
             // 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(46, 168);
+            this.OutboxCapacity.Location = new System.Drawing.Point(128, 109);
             this.OutboxCapacity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutboxCapacity.Name = "OutboxCapacity";
             this.OutboxCapacity.Size = new System.Drawing.Size(38, 23);
@@ -1759,7 +1840,7 @@
             // 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(91, 202);
+            this.OutBoxLabelPrint.Location = new System.Drawing.Point(101, 202);
             this.OutBoxLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelPrint.Name = "OutBoxLabelPrint";
             this.OutBoxLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1772,13 +1853,14 @@
             // 
             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(10, 110);
+            this.OutBoxLabelAutoPrint.Location = new System.Drawing.Point(9, 106);
             this.OutBoxLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelAutoPrint.Name = "OutBoxLabelAutoPrint";
             this.OutBoxLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
             this.OutBoxLabelAutoPrint.TabIndex = 79;
             this.OutBoxLabelAutoPrint.Text = "自动打印";
             this.OutBoxLabelAutoPrint.UseVisualStyleBackColor = true;
+            this.OutBoxLabelAutoPrint.Visible = false;
             // 
             // OutBoxCombox
             // 
@@ -1792,22 +1874,12 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // pi_class
-            // 
-            this.pi_class.AutoSize = true;
-            this.pi_class.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_class.Location = new System.Drawing.Point(100, 255);
-            this.pi_class.Name = "pi_class";
-            this.pi_class.Size = new System.Drawing.Size(0, 20);
-            this.pi_class.TabIndex = 90;
-            this.pi_class.Visible = false;
-            // 
             // 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(1258, 530);
+            this.ClientSize = new System.Drawing.Size(1258, 715);
             this.Controls.Add(this.pi_class);
             this.Controls.Add(this.MenuSetting);
             this.Controls.Add(this.cu_code);
@@ -1872,6 +1944,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidBoxCapacity)).EndInit();
             this.OutBoxLabel.ResumeLayout(false);
             this.OutBoxLabel.PerformLayout();
+            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
@@ -2035,5 +2109,10 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.Label pi_class;
         private System.Windows.Forms.ToolStripMenuItem 下载模板ToolStripMenuItem;
+        private System.Windows.Forms.CheckBox cu_print_outprod;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private System.Windows.Forms.CheckBox cu_print_outdc;
+        private System.Windows.Forms.CheckBox cu_print_outlotno;
+        private System.Windows.Forms.CheckBox cu_print_outpo;
     }
 }

+ 31 - 4
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -307,8 +307,11 @@ namespace UAS_LabelMachine
         private void SaveGrid_Click(object sender, EventArgs e)
         {
             DataTable dt = (DataTable)sdh.ExecuteSql("select pib_id,pib_outboxcode1,pib_outboxcode2,pib_custmidboxcode,pib_custoutboxcode,pib_lotno,pib_datecode,pib_ifupload,pib_ifpick,pib_ifprint from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_ifpick=-1   ", "select");
-            dh.CallProcedure("sp_uploadbarcode", dt);
-            MessageBox.Show("保存成功!");
+            if (dt.Rows.Count > 0)
+            {
+                dh.CallProcedure("sp_uploadbarcode", dt);
+                MessageBox.Show("保存成功!");
+            }
         }
 
         //放大镜选择后出发的事件
@@ -1830,9 +1833,33 @@ namespace UAS_LabelMachine
                         {
                             BoxCode = BoxCode + 1;
                         }
-                        else if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_prodcode"].Value.ToString())
+                        else if (cu_print_outdc.Checked)
                         {
-                            BoxCode = BoxCode + 1;
+                            if (LabelInf.Rows[i].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_datecode"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
+                        }
+                        else if (cu_print_outlotno.Checked)
+                        {
+                            if (LabelInf.Rows[i].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_lotno"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
+                        }
+                        else if (cu_print_outpo.Checked)
+                        {
+                            if (LabelInf.Rows[i].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pd_pocode"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
+                        }
+                        else if (cu_print_outprod.Checked)
+                        {
+                            if (LabelInf.Rows[i].Cells["pib_custprodcode"].Value.ToString() != LabelInf.Rows[i + 1].Cells["pib_custprodcode"].Value.ToString())
+                            {
+                                BoxCode = BoxCode + 1;
+                            }
                         }
                     }
                 }