Browse Source

修改BUG,新增箱号问题

章政 7 năm trước cách đây
mục cha
commit
53ecb2c9e0
1 tập tin đã thay đổi với 8 bổ sung4 xóa
  1. 8 4
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 8 - 4
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -370,7 +370,7 @@ namespace UAS_LabelMachine
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
             //更新流水号
-            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + CodeCount) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
+            dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
             LoadGridData(new object(), new EventArgs());
             //加载完数据之后进行容量的判断
             int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
@@ -918,6 +918,7 @@ namespace UAS_LabelMachine
                 DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiobarcode where pib_id=" + pib_id, "select");
                 MidReport.RegisterData(dt, "Prodiobarcode");
                 MidReport.GetDataSource("Prodiobarcode").Enabled = true;
+                MidReport.PrintSettings.ShowDialog = false;
                 MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
                 MidReport.Print();
                 Properties.Settings.Default.MPrinter = MidLabelPrinter.Text;
@@ -934,6 +935,7 @@ namespace UAS_LabelMachine
                 DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiobarcode where pib_id=" + pib_id, "select");
                 MidReport.RegisterData(dt, "Prodiobarcode");
                 MidReport.GetDataSource("Prodiobarcode").Enabled = true;
+                MidReport.PrintSettings.ShowDialog = false;
                 MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
                 MidReport.Print();
                 Properties.Settings.Default.MPrinter = MidLabelPrinter.Text;
@@ -957,6 +959,7 @@ namespace UAS_LabelMachine
                     MidReport.RegisterData(dt, "Prodiobarcode");
                     MidReport.GetDataSource("Prodiobarcode").Enabled = true;
                     //保存参数打印
+                    OutReport.PrintSettings.ShowDialog = false;
                     OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
                     OutReport.Print();
                     Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
@@ -1518,6 +1521,7 @@ namespace UAS_LabelMachine
             {
                 //生成中盒条码
                 int pib_outboxcode1 = 0;
+                CurrentMaxNum = CurrentMaxNum - 1;
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     List<string> MidBoxCode = new List<string>();
@@ -1527,7 +1531,7 @@ namespace UAS_LabelMachine
                     //如果不是10的整数倍则为尾盒
                     for (int j = 0; j < dt1.Rows.Count; j++)
                     {
-                        if (j % 10 == 0 && j != 0)
+                        if (j % 10 == 0)
                         {
                             pib_outboxcode1 = pib_outboxcode1 + 1;
                             CurrentMaxNum = CurrentMaxNum + 1;
@@ -1549,14 +1553,14 @@ namespace UAS_LabelMachine
                 {
                     List<string> OutBoxCode = new List<string>();
                     List<string> PIBOUTBOXCODE2 = new List<string>();
-                    string serialcode = BaseUtil.DToAny(MaxNum, Radix);
+                    string serialcode = BaseUtil.DToAny(CurrentMaxNum, Radix);
                     for (int k = serialcode.ToString().Length; k < NumLength; k++)
                     {
                         serialcode = "0" + serialcode;
                     }
                     OutBoxCode.Add(Prefix + serialcode + Suffix);
                     PIBOUTBOXCODE2.Add(dt.Rows[i]["pib_outboxcode2"].ToString());
-                    MaxNum = MaxNum + 1;
+                    CurrentMaxNum = CurrentMaxNum + 1;
                     dh.BatchInsert("update prodiobarcode set pib_custoutboxcode=:pib_custoutboxcode where pib_outboxcode2=:pib_outboxcode2 and pib_custoutboxcode is null", new string[] { "pib_custoutboxcode", "pib_outboxcode2" }, OutBoxCode.ToArray(), PIBOUTBOXCODE2.ToArray());
                 }
                 dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + CurrentMaxNum + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");