Browse Source

范围提示调整

章政 7 years ago
parent
commit
a623876522
1 changed files with 2 additions and 2 deletions
  1. 2 2
      UAS-出货标签管理/UAS_出货标签管理.cs

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

@@ -1398,7 +1398,7 @@ namespace UAS_LabelMachine
                     {
                         int begin = int.Parse(SingleBoxBegin.Text == "" ? "1" : SingleBoxBegin.Text);
                         int end = int.Parse(SingleBoxEnd.Text == "" ? LabelInf.Rows.Count.ToString() : SingleBoxEnd.Text);
-                        if (begin > 0 && end <= LabelInf.Rows.Count)
+                        if (begin > 0 && end <= LabelInf.Rows.Count && begin <= end)
                         {
                             for (int i = begin - 1; i < end; i++)
                             {
@@ -1442,7 +1442,7 @@ namespace UAS_LabelMachine
                         end = int.Parse(MidBoxEnd.Text == "" ? LabelInf.Rows[LabelInf.Rows.Count - 1].Cells["pib_outboxcode1"].Value.ToString() : MidBoxEnd.Text);
                         int minmidbox = int.Parse(LabelInf.Rows[0].Cells["pib_outboxcode1"].Value.ToString());
                         int maxmidbox = int.Parse(LabelInf.Rows[LabelInf.Rows.Count - 1].Cells["pib_outboxcode1"].Value.ToString());
-                        if (begin >= minmidbox && end <= maxmidbox)
+                        if (begin >= minmidbox && end <= maxmidbox && begin <= end)
                         {
                             //设置中盒打印范围的行号
                             for (int i = 0; i < LabelInf.Rows.Count; i++)