|
|
@@ -93,18 +93,9 @@ namespace UAS_LabelMachine
|
|
|
/// </summary>
|
|
|
List<string> MidBoxArgument = new List<string>();
|
|
|
/// <summary>
|
|
|
- /// 全部采集
|
|
|
- /// </summary>
|
|
|
- bool AllCollect = false;
|
|
|
- /// <summary>
|
|
|
- /// 是否全选
|
|
|
- /// </summary>
|
|
|
- bool AllChecked = false;
|
|
|
- /// <summary>
|
|
|
/// 默认采集了指定的数据上传
|
|
|
/// </summary>
|
|
|
int UploadNum = 100;
|
|
|
-
|
|
|
/*需要重绘的Cell*/
|
|
|
Dictionary<DataGridViewCell, bool> PaintCell = new Dictionary<DataGridViewCell, bool>();
|
|
|
/// <summary>
|
|
|
@@ -172,7 +163,7 @@ namespace UAS_LabelMachine
|
|
|
OutBoxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
|
|
|
asc.controllInitializeSize(this);
|
|
|
asc.controlAutoSize(this);
|
|
|
-
|
|
|
+
|
|
|
//实例化打印进程
|
|
|
try
|
|
|
{
|
|
|
@@ -228,174 +219,184 @@ namespace UAS_LabelMachine
|
|
|
case "FrontendCheck":
|
|
|
//比对当前箱数量和容量
|
|
|
FrontCollect.Text = msg;
|
|
|
- for (int i = 0; i < ScanGroup.Rows.Count; i++)
|
|
|
- {
|
|
|
- string sg_name = ScanGroup.Rows[i]["sg_name"].ToString();
|
|
|
- string sg_brand = ScanGroup.Rows[i]["sg_brand"].ToString();
|
|
|
- reg = new Regex(ScanGroup.Rows[i]["sg_script"].ToString());
|
|
|
- MatchCollection matchs = reg.Matches(msg);
|
|
|
- int index = 0;
|
|
|
- DataTable dt = BaseUtil.filterDataTable(ScanItem, "sg_name='" + sg_name + "' and sg_brand='" + sg_brand + "' and items_num=" + matchs.Count);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- for (int j = 0; j < dt.Rows.Count; j++)
|
|
|
- {
|
|
|
- string si_expression = dt.Rows[j]["si_expression"].ToString();
|
|
|
- Regex si_exp;
|
|
|
- switch (dt.Rows[j]["si_item"].ToString())
|
|
|
- {
|
|
|
- case "DateCode":
|
|
|
- if (si_expression != "")
|
|
|
- {
|
|
|
- si_exp = new Regex(si_expression);
|
|
|
- DateCode = si_exp.Match(matchs[index].Value).Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DateCode = matchs[index].Value;
|
|
|
- }
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
- break;
|
|
|
- case "LotNo":
|
|
|
- LotNo = matchs[index].Value;
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
|
- break;
|
|
|
- case "PN":
|
|
|
- PN = matchs[index].Value;
|
|
|
- break;
|
|
|
- case "Order":
|
|
|
- Order = matchs[index].Value;
|
|
|
- break;
|
|
|
- case "QTY":
|
|
|
- if (si_expression != "")
|
|
|
- {
|
|
|
- si_exp = new Regex(si_expression);
|
|
|
- QTY = si_exp.Match(matchs[index].Value).Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- QTY = matchs[index].Value;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "OutBox":
|
|
|
- OutBox = matchs[index].Value;
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- index = index + 1;
|
|
|
- }
|
|
|
- LabelInf.Refresh();
|
|
|
- }
|
|
|
- }
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
- LabelInf.Refresh();
|
|
|
+ FrontCheckFunction(msg);
|
|
|
break;
|
|
|
case "BackendCheck":
|
|
|
BackCheck.Text = msg;
|
|
|
- string[] msgArr = BackCheck.Text.Split('@');
|
|
|
- //需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
|
|
|
- int checkItemCount = 0;
|
|
|
- for (int i = 0; i < msgArr.Length; i++)
|
|
|
+ BackendCheckFunction(msg, pib_id);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ LogManager.DoLog(ex.StackTrace);
|
|
|
+ MessageBox.Show("接收返回消息异常!具体原因:" + ex.Message, "提示信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void FrontCheckFunction(string msg)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < ScanGroup.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ string sg_name = ScanGroup.Rows[i]["sg_name"].ToString();
|
|
|
+ string sg_brand = ScanGroup.Rows[i]["sg_brand"].ToString();
|
|
|
+ reg = new Regex(ScanGroup.Rows[i]["sg_script"].ToString());
|
|
|
+ MatchCollection matchs = reg.Matches(msg);
|
|
|
+ int index = 0;
|
|
|
+ DataTable dt = BaseUtil.filterDataTable(ScanItem, "sg_name='" + sg_name + "' and sg_brand='" + sg_brand + "' and items_num=" + matchs.Count);
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < dt.Rows.Count; j++)
|
|
|
+ {
|
|
|
+ string si_expression = dt.Rows[j]["si_expression"].ToString();
|
|
|
+ Regex si_exp;
|
|
|
+ switch (dt.Rows[j]["si_item"].ToString())
|
|
|
{
|
|
|
- if (RecheckCuprodcode.Checked)
|
|
|
- {
|
|
|
- //直接验证两个值相等
|
|
|
- if (Equal.Checked)
|
|
|
+ case "DateCode":
|
|
|
+ if (si_expression != "")
|
|
|
{
|
|
|
- if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
- {
|
|
|
- checkItemCount = checkItemCount + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- //验证正则匹配过之后相等
|
|
|
- else if (Expression.Checked)
|
|
|
- {
|
|
|
- Regex re = new Regex(cu_print_regexpression.Text);
|
|
|
- if (re.Match(msgArr[i]).Value == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
- {
|
|
|
- checkItemCount = checkItemCount + 1;
|
|
|
- }
|
|
|
+ si_exp = new Regex(si_expression);
|
|
|
+ DateCode = si_exp.Match(matchs[index].Value).Value;
|
|
|
}
|
|
|
- if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
+ else
|
|
|
{
|
|
|
- checkItemCount = checkItemCount + 1;
|
|
|
+ DateCode = matchs[index].Value;
|
|
|
}
|
|
|
- }
|
|
|
- else if (RecheckBarcode.Checked)
|
|
|
- {
|
|
|
- if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pib_custbarcode"].Value.ToString())
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
+ break;
|
|
|
+ case "LotNo":
|
|
|
+ LotNo = matchs[index].Value;
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
|
+ break;
|
|
|
+ case "PN":
|
|
|
+ PN = matchs[index].Value;
|
|
|
+ break;
|
|
|
+ case "Order":
|
|
|
+ Order = matchs[index].Value;
|
|
|
+ break;
|
|
|
+ case "QTY":
|
|
|
+ if (si_expression != "")
|
|
|
{
|
|
|
- checkItemCount = checkItemCount + 1;
|
|
|
+ si_exp = new Regex(si_expression);
|
|
|
+ QTY = si_exp.Match(matchs[index].Value).Value;
|
|
|
}
|
|
|
- if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
+ else
|
|
|
{
|
|
|
- checkItemCount = checkItemCount + 1;
|
|
|
+ QTY = matchs[index].Value;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- if (checkItemCount != 2)
|
|
|
- {
|
|
|
- MessageBox.Show("复核不通过");
|
|
|
- return;
|
|
|
- }
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
|
|
|
- adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
|
- LabelInf.Refresh();
|
|
|
- //获取当前最大的箱号
|
|
|
- string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
- int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
- boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
- int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
- if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
- {
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
+ break;
|
|
|
+ case "OutBox":
|
|
|
+ OutBox = matchs[index].Value;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
- if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
+ index = index + 1;
|
|
|
+ }
|
|
|
+ LabelInf.Refresh();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
+ LabelInf.Refresh();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BackendCheckFunction(string msg, string pib_id)
|
|
|
+ {
|
|
|
+ string[] msgArr = msg.Split('@');
|
|
|
+ //需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
|
|
|
+ int checkItemCount = 0;
|
|
|
+ for (int i = 0; i < msgArr.Length; i++)
|
|
|
+ {
|
|
|
+ if (RecheckCuprodcode.Checked)
|
|
|
+ {
|
|
|
+ //直接验证两个值相等
|
|
|
+ if (Equal.Checked)
|
|
|
+ {
|
|
|
+ if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
{
|
|
|
- outboxcode2 = outboxcode2 + 1;
|
|
|
+ checkItemCount = checkItemCount + 1;
|
|
|
}
|
|
|
- else if (CurrentRowIndex - 1 >= 0)
|
|
|
+ }
|
|
|
+ //验证正则匹配过之后相等
|
|
|
+ else if (Expression.Checked)
|
|
|
+ {
|
|
|
+ Regex re = new Regex(cu_print_regexpression.Text);
|
|
|
+ if (re.Match(msgArr[i]).Value == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
{
|
|
|
- if (cu_print_midlotno.Checked)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
- }
|
|
|
- else if (cu_print_midpo.Checked)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
- }
|
|
|
- else if (cu_print_midprod.Checked)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodcode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
- }
|
|
|
- else if (cu_print_midspec.Checked)
|
|
|
- {
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
- }
|
|
|
+ checkItemCount = checkItemCount + 1;
|
|
|
}
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
|
|
|
- adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
- LabelInf.Refresh();
|
|
|
- if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
|
- CurrentRowIndex = CurrentRowIndex + 1;
|
|
|
- RefreshProcessData();
|
|
|
- LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ }
|
|
|
+ if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
+ {
|
|
|
+ checkItemCount = checkItemCount + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (RecheckBarcode.Checked)
|
|
|
+ {
|
|
|
+ if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pib_custbarcode"].Value.ToString())
|
|
|
+ {
|
|
|
+ checkItemCount = checkItemCount + 1;
|
|
|
+ }
|
|
|
+ if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
+ {
|
|
|
+ checkItemCount = checkItemCount + 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ if (checkItemCount != 2)
|
|
|
{
|
|
|
- LogManager.DoLog(ex.StackTrace);
|
|
|
- MessageBox.Show("接收返回消息异常!具体原因:" + ex.Message, "提示信息");
|
|
|
+ MessageBox.Show("复核不通过");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
|
|
|
+ adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
|
+ LabelInf.Refresh();
|
|
|
+ //获取当前最大的箱号
|
|
|
+ string boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
+ int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
+ boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
|
|
|
+ int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
|
|
|
+ if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
+ {
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
+ }
|
|
|
+ if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
+ {
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
+ else if (CurrentRowIndex - 1 >= 0)
|
|
|
+ {
|
|
|
+ if (cu_print_midlotno.Checked)
|
|
|
+ {
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
+ }
|
|
|
+ else if (cu_print_midpo.Checked)
|
|
|
+ {
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
+ }
|
|
|
+ else if (cu_print_midprod.Checked)
|
|
|
+ {
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodcode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
+ }
|
|
|
+ else if (cu_print_midspec.Checked)
|
|
|
+ {
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
|
|
|
+ adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
+ LabelInf.Refresh();
|
|
|
+ if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
|
+ CurrentRowIndex = CurrentRowIndex + 1;
|
|
|
+ RefreshProcessData();
|
|
|
+ LogicHandler.CheckUploadData(pi_inoutno.Text, UploadNum);
|
|
|
}
|
|
|
|
|
|
//只执行一次窗体自适应
|
|
|
@@ -632,6 +633,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
|
+ CurrentPage = 1;
|
|
|
sql.Clear();
|
|
|
sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
@@ -1197,7 +1199,10 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
LoadGridData(new object(), new EventArgs());
|
|
|
}
|
|
|
-
|
|
|
+ int CurrentPage = 1;
|
|
|
+ int PageSize = 1000;
|
|
|
+ int DataSize = 0;
|
|
|
+ int MaxPageSize = 0;
|
|
|
/// <summary>
|
|
|
/// 自定义函数 加载明细行的数据,多处使用添加进函数
|
|
|
/// </summary>
|
|
|
@@ -1205,21 +1210,25 @@ namespace UAS_LabelMachine
|
|
|
/// <param name="e"></param>
|
|
|
private void LoadGridData(object sender, EventArgs e)
|
|
|
{
|
|
|
- AllCollect = false;
|
|
|
- dt = (DataTable)adh.ExecuteSql("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id", "select");
|
|
|
+ dt = (DataTable)adh.ExecuteSql("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum between " + ((CurrentPage - 1) * PageSize + 1) + " and " + CurrentPage * PageSize + " order by rownum", "select");
|
|
|
if (dt.Rows.Count == 0)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pd_custprodcode,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,");
|
|
|
+ sql.Append("select rownum,pd_custprodcode,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,");
|
|
|
sql.Append("pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,pi_title,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,");
|
|
|
sql.Append("pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join prodinout on pib_piid=pi_id left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
|
|
|
- sql.Append("pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by to_number(pib_id)");
|
|
|
+ sql.Append("pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode where pib_piid='" + PI_ID + "' order by rownum");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
|
adh.AddColumFromDataTable(dt, "prodiobarcode");
|
|
|
//将数据保存在本地数据库
|
|
|
adh.SaveDataTable(dt, "prodiobarcode");
|
|
|
+ dt = BaseUtil.filterDataTable(dt, "rownum <=" + PageSize);
|
|
|
}
|
|
|
+ DataSize = adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "'");
|
|
|
+ PageNum.Text = "总数" + DataSize;
|
|
|
+ MaxPageSize = DataSize % PageSize == 0 ? DataSize / PageSize : (DataSize / PageSize) + 1;
|
|
|
+ PageInf.Text = CurrentPage + "/" + MaxPageSize;
|
|
|
MidSource.DataSource = dt;
|
|
|
BaseUtil.FillDgvWithDataTable(LabelInf, (DataTable)MidSource.DataSource);
|
|
|
//获取系统设置的上传数量,如参数异常则默认为100
|
|
|
@@ -1434,22 +1443,6 @@ namespace UAS_LabelMachine
|
|
|
catch (Exception) { }
|
|
|
}
|
|
|
|
|
|
- private void ChooseAll_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- if (AllChecked)
|
|
|
- {
|
|
|
- foreach (DataGridViewRow dr in LabelInf.Rows)
|
|
|
- dr.Cells[0].Value = false;
|
|
|
- AllChecked = false;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- foreach (DataGridViewRow dr in LabelInf.Rows)
|
|
|
- dr.Cells[0].Value = true;
|
|
|
- AllChecked = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private void ExportData_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
ExportFileDialog.Description = "选择导出的路径";
|
|
|
@@ -1674,5 +1667,38 @@ namespace UAS_LabelMachine
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void Page_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
|
+ {
|
|
|
+ switch ((sender as LinkLabel).Name)
|
|
|
+ {
|
|
|
+ case "FirstPage":
|
|
|
+ CurrentPage = 1;
|
|
|
+ break;
|
|
|
+ case "LastPage":
|
|
|
+ CurrentPage = MaxPageSize;
|
|
|
+ break;
|
|
|
+ case "BeforePage":
|
|
|
+ if (CurrentPage == 1)
|
|
|
+ {
|
|
|
+ MessageBox.Show("已经是第一页了", "提示");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ CurrentPage = CurrentPage - 1;
|
|
|
+ break;
|
|
|
+ case "NextPage":
|
|
|
+ if (CurrentPage == MaxPageSize)
|
|
|
+ {
|
|
|
+ MessageBox.Show("已经是最后一页了", "提示");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ CurrentPage = CurrentPage + 1;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ PageInf.Text = CurrentPage + "/" + MaxPageSize;
|
|
|
+ LoadGridData();
|
|
|
+ }
|
|
|
}
|
|
|
}
|