|
@@ -244,7 +244,7 @@ namespace UAS_LabelMachine
|
|
|
case "FrontendCheck":
|
|
case "FrontendCheck":
|
|
|
//比对当前箱数量和容量
|
|
//比对当前箱数量和容量
|
|
|
FrontCollect.Text = msg;
|
|
FrontCollect.Text = msg;
|
|
|
- if (!FrontCheckFunction(msg, out ErrorMsg))
|
|
|
|
|
|
|
+ if (!FrontCheckFunction(pib_id, msg, out ErrorMsg))
|
|
|
{
|
|
{
|
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataDelete);
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataDelete);
|
|
|
MessageLog.AppendText(">>" + ErrorMsg + "\n", Color.Red);
|
|
MessageLog.AppendText(">>" + ErrorMsg + "\n", Color.Red);
|
|
@@ -264,12 +264,10 @@ namespace UAS_LabelMachine
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
//勾选了中盒自动打印
|
|
//勾选了中盒自动打印
|
|
|
if (MidLabelAutoPrint.Checked)
|
|
if (MidLabelAutoPrint.Checked)
|
|
|
AutoPrintMidLabel();
|
|
AutoPrintMidLabel();
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
|
|
|
|
|
- //设置变量为已勾选
|
|
|
|
|
- ShowDt.Select("pib_id=" + pib_id)[0]["pib_ifpick"] = -1;
|
|
|
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataPass);
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataPass);
|
|
|
LabelInf.Refresh();
|
|
LabelInf.Refresh();
|
|
|
}
|
|
}
|
|
@@ -278,6 +276,8 @@ namespace UAS_LabelMachine
|
|
|
BackCheck.Text = msg;
|
|
BackCheck.Text = msg;
|
|
|
if (BackendCheckFunction(msg, pib_id, out ErrorMsg))
|
|
if (BackendCheckFunction(msg, pib_id, out ErrorMsg))
|
|
|
{
|
|
{
|
|
|
|
|
+ //设置变量为已勾选
|
|
|
|
|
+ ShowDt.Select("pib_id=" + pib_id)[0]["pib_ifpick"] = -1;
|
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataPass);
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.BackDataPass);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -297,7 +297,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private bool FrontCheckFunction(string msg, out string ErrorMsg)
|
|
|
|
|
|
|
+ private bool FrontCheckFunction(string pib_id, string msg, out string ErrorMsg)
|
|
|
{
|
|
{
|
|
|
int GroupCount = 0;
|
|
int GroupCount = 0;
|
|
|
ErrorMsg = "";
|
|
ErrorMsg = "";
|
|
@@ -435,8 +435,143 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ //获取当前最大的箱号
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
|
|
|
|
|
+ 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);
|
|
|
|
|
+ string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
|
|
|
|
|
+ //超过中盒容量中盒号+1
|
|
|
|
|
+ if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CurrentRowIndex - 1 >= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //或者不符合合并条件中盒号+1
|
|
|
|
|
+ if (cu_print_midlotno.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ 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())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_midprod.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ 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())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_middc.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (MidBoxBarCode == "")
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (CurrentRowIndex - 1 >= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //或者不符合合并条件中盒号+1
|
|
|
|
|
+ if (cu_print_outlotno.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_outpo.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_outprod.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_outspec.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (cu_print_outdc.Checked)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (OutBoxBarCode == "")
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
+ LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ 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_custoutboxcode='" + OutBoxBarCode + "',pib_custmidboxcode='" + MidBoxBarCode + "',pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
|
|
+ LabelInf.Refresh();
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -514,137 +649,12 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
{
|
|
|
Item += CheckItem[i].ToString() + " ";
|
|
Item += CheckItem[i].ToString() + " ";
|
|
|
}
|
|
}
|
|
|
- ErrorMsg = ">>" + Item + "复核不通过";
|
|
|
|
|
|
|
+ ErrorMsg = Item + "复核不通过";
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_ifrecheck"].Value = true;
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifrecheck=-1 where pib_id=" + pib_id, "update");
|
|
|
LabelInf.Refresh();
|
|
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);
|
|
|
|
|
- string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
|
|
|
|
|
- //超过中盒容量中盒号+1
|
|
|
|
|
- if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) > MidBoxCapacity.Value)
|
|
|
|
|
- {
|
|
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- }
|
|
|
|
|
- if (CurrentRowIndex - 1 >= 0)
|
|
|
|
|
- {
|
|
|
|
|
- //或者不符合合并条件中盒号+1
|
|
|
|
|
- if (cu_print_midlotno.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- 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())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_midprod.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- 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())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_middc.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- outboxcode1 = outboxcode1 + 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (MidBoxBarCode == "")
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- }
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
|
|
- {
|
|
|
|
|
- outboxcode2 = outboxcode2 + 1;
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- else if (CurrentRowIndex - 1 >= 0)
|
|
|
|
|
- {
|
|
|
|
|
- //或者不符合合并条件中盒号+1
|
|
|
|
|
- if (cu_print_outlotno.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_outpo.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_outprod.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pr_orispeccode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_outspec.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (cu_print_outdc.Checked)
|
|
|
|
|
- {
|
|
|
|
|
- if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_datecode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString())
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (OutBoxBarCode == "")
|
|
|
|
|
- {
|
|
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
|
|
- }
|
|
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
|
|
- }
|
|
|
|
|
- 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_custoutboxcode='" + OutBoxBarCode + "',pib_custmidboxcode='" + MidBoxBarCode + "',pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
|
|
|
|
|
- LabelInf.Refresh();
|
|
|
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
if (CurrentRowIndex + 1 < LabelInf.Rows.Count)
|
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
CurrentRowIndex = CurrentRowIndex + 1;
|
|
|
RefreshProcessData();
|
|
RefreshProcessData();
|
|
@@ -1299,7 +1309,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + "select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
|
|
|
|
|
|
|
+ DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
|
|
|
for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
|
|
for (int j = 0; j < MidDoc.Variables.FreeVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower() + "'");
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FreeVariables.Item(j + 1).Name.ToLower() + "'");
|
|
@@ -1435,6 +1445,7 @@ namespace UAS_LabelMachine
|
|
|
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 ");
|
|
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 ");
|
|
|
sql.Append("pd_pdno=pib_pdno and 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))t");
|
|
sql.Append("pd_pdno=pib_pdno and 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))t");
|
|
|
LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
|
|
+ ShowDt = LabelInfDataTable;
|
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
//检验查询的字段和本地数据库字段是否匹配
|
|
|
adh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
|
|
adh.AddColumFromDataTable(LabelInfDataTable, "prodiobarcode");
|
|
|
//将数据保存在本地数据库
|
|
//将数据保存在本地数据库
|
|
@@ -1870,7 +1881,7 @@ namespace UAS_LabelMachine
|
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
|
|
|
int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
|
|
|
string ErrorMsg = "";
|
|
string ErrorMsg = "";
|
|
|
- FrontCheckFunction("", out ErrorMsg);
|
|
|
|
|
|
|
+ FrontCheckFunction(pib_id, "", out ErrorMsg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void ButtonRecheckPass_Click(object sender, EventArgs e)
|
|
private void ButtonRecheckPass_Click(object sender, EventArgs e)
|
|
@@ -1970,5 +1981,13 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void MessageLog_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (e.Button == MouseButtons.Right)
|
|
|
|
|
+ {
|
|
|
|
|
+ LogMenu.Show(new Point(MessageLog.Location.X + 100, MessageLog.Location.Y + 20));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|