Bladeren bron

外箱号BUG修改

章政 7 jaren geleden
bovenliggende
commit
6deea78ee6

+ 6 - 0
UAS-出货标签管理/App.config

@@ -53,6 +53,12 @@
       <setting name="FTPAddress" serializeAs="String">
         <value>ftp://218.18.115.198:21|Print|Administrator1@#</value>
       </setting>
+      <setting name="MidBoxCapacity" serializeAs="String">
+        <value>0</value>
+      </setting>
+      <setting name="OutboxCapacity" serializeAs="String">
+        <value>0</value>
+      </setting>
     </UAS_LabelMachine.Properties.Settings>
   </userSettings>
 </configuration>

+ 6 - 0
UAS-出货标签管理/Properties/Settings.settings

@@ -17,5 +17,11 @@
     <Setting Name="FTPAddress" Type="System.String" Scope="User">
       <Value Profile="(Default)">ftp://218.18.115.198:21|Print|Administrator1@#</Value>
     </Setting>
+    <Setting Name="MidBoxCapacity" Type="System.Decimal" Scope="User">
+      <Value Profile="(Default)">0</Value>
+    </Setting>
+    <Setting Name="OutboxCapacity" Type="System.Decimal" Scope="User">
+      <Value Profile="(Default)">0</Value>
+    </Setting>
   </Settings>
 </SettingsFile>

+ 24 - 0
UAS-出货标签管理/Properties/Settings1.Designer.cs

@@ -82,5 +82,29 @@ namespace UAS_LabelMachine.Properties {
                 this["FTPAddress"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        public decimal MidBoxCapacity {
+            get {
+                return ((decimal)(this["MidBoxCapacity"]));
+            }
+            set {
+                this["MidBoxCapacity"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]
+        public decimal OutboxCapacity {
+            get {
+                return ((decimal)(this["OutboxCapacity"]));
+            }
+            set {
+                this["OutboxCapacity"] = value;
+            }
+        }
     }
 }

File diff suppressed because it is too large
+ 399 - 174
UAS-出货标签管理/UAS_出货标签管理.Designer.cs


+ 26 - 6
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -192,6 +192,8 @@ namespace UAS_LabelMachine
             Left = 0;
             Width = ScreenArea.Width;
             Height = ScreenArea.Height;
+            MidBoxCapacity.Value = Properties.Settings.Default.MidBoxCapacity;
+            OutboxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
             //怡海能达添加的特殊字段
             if (DataHelper.DBConnectionString.Contains("sz.hi-mantech.com") || DataHelper.DBConnectionString.Contains("192.168.1.200"))
             {
@@ -628,8 +630,8 @@ namespace UAS_LabelMachine
             DataTable temp = (DataTable)dh.ExecuteSql("select pr_qtyperplace,pr_zxbzs from product where pr_code='" + pr_code + "'", "select");
             if (temp.Rows.Count > 0)
             {
-                try { OutboxCapacity.Value = (decimal)temp.Rows[0]["pr_qtyperplace"] / (decimal)temp.Rows[0]["pr_zxbzs"]; }
-                catch (Exception) { }
+                //try { OutboxCapacity.Value = (decimal)temp.Rows[0]["pr_qtyperplace"] / (decimal)temp.Rows[0]["pr_zxbzs"]; }
+                //catch (Exception) { }
             }
         }
 
@@ -2312,14 +2314,14 @@ namespace UAS_LabelMachine
             }
             else
             {
-                int BoxCode = 0;
+                int BoxCode = 1;
                 for (int i = 0; i < LabelInf.Rows.Count; i++)
                 {
-                    if (i % OutboxCapacity.Value == 0)
+                    LabelInf.Rows[i].Cells["pib_outboxcode2"].Value = BoxCode;
+                    if (int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()) % OutboxCapacity.Value == 0)
                     {
                         BoxCode = BoxCode + 1;
                     }
-                    LabelInf.Rows[i].Cells["pib_outboxcode2"].Value = BoxCode;
                 }
             }
             SaveGrid_Click(sender, e);
@@ -2539,7 +2541,7 @@ namespace UAS_LabelMachine
                     for (int j = 0; j < LabelInf.Columns.Count; j++)
                     {
                         //去除ID列
-                        if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower()=="pib_ifpick"|| dt.Columns[i].ColumnName.ToLower()=="pib_ifprint"|| dt.Columns[i].ColumnName.ToLower() == "pib_datecode1"|| dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
+                        if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
                         {
                             dt.Columns.RemoveAt(i);
                             break;
@@ -2581,5 +2583,23 @@ namespace UAS_LabelMachine
             }
             else MessageBox.Show("请先获取出库单信息");
         }
+
+        private void MidBoxCapacity_Leave(object sender, EventArgs e)
+        {
+            NumericUpDown nup = (NumericUpDown)sender;
+            switch (nup.Name)
+            {
+                case "MidBoxCapacity":
+                    Properties.Settings.Default.MidBoxCapacity = nup.Value;
+                    Properties.Settings.Default.Save();
+                    break;
+                case "OutboxCapacity":
+                    Properties.Settings.Default.OutboxCapacity = nup.Value;
+                    Properties.Settings.Default.Save();
+                    break;
+                default:
+                    break;
+            }
+        }
     }
 }

Some files were not shown because too many files changed in this diff