Explorar o código

索引超出的BUG修改

章政 %!s(int64=7) %!d(string=hai) anos
pai
achega
44f99b4f88
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

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

@@ -171,7 +171,7 @@ namespace UAS_LabelMachine
 
         private void LabelFormClose(object sender, EventArgs e)
         {
-                GetInOutInfAndLabelFile();
+            GetInOutInfAndLabelFile();
         }
 
         //输入框Enter事件
@@ -361,7 +361,10 @@ namespace UAS_LabelMachine
             //更新流水号
             dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + (pi_cardcode.Text == "" ? "Default" : pi_cardcode.Text) + "' and rmn_prefix='" + Prefix + "'");
             LoadGridData(new object(), new EventArgs());
-            LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
+            if (LabelInf.Rows.Count > 0)
+            {
+                LabelInf.Rows[LabelInf.Rows.Count - 1].Selected = true;
+            }
             //加载完数据之后进行容量的判断
             int BoxNum = LabelInfDataTable.Select("pib_outboxcode2='" + OutBoxNum.Text + "'").Length;
             if (BoxNum > OutboxCapacity.Value)
@@ -492,7 +495,7 @@ namespace UAS_LabelMachine
             SingleLabelCombox.DisplayMember = "cl_labelname";
             SingleLabelCombox.ValueMember = "cl_labelurl";
             SingleLabelCombox.DataSource = dt;
-          
+
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelurl,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode 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 + "' ");
@@ -501,7 +504,7 @@ namespace UAS_LabelMachine
             MidLabelCombox.DisplayMember = "cl_labelname";
             MidLabelCombox.ValueMember = "cl_labelurl";
             MidLabelCombox.DataSource = dt;
-          
+
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelurl,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode 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 + "' ");
@@ -510,7 +513,7 @@ namespace UAS_LabelMachine
             OutBoxCombox.DisplayMember = "cl_labelname";
             OutBoxCombox.ValueMember = "cl_labelurl";
             OutBoxCombox.DataSource = dt;
-          
+
             ComBoxClickChangeLabelDoc = true;
         }