|
@@ -40,13 +40,14 @@ namespace UAS_MES_NEW.Make
|
|
|
asc.controlAutoSize(this);
|
|
asc.controlAutoSize(this);
|
|
|
}
|
|
}
|
|
|
bool FindColorSN = false;
|
|
bool FindColorSN = false;
|
|
|
- bool FindFugeSN = false;
|
|
|
|
|
int RowIndex = 0;
|
|
int RowIndex = 0;
|
|
|
|
|
+ string ms_makecode = "";
|
|
|
private void sncode_KeyDown(object sender, KeyEventArgs e)
|
|
private void sncode_KeyDown(object sender, KeyEventArgs e)
|
|
|
{
|
|
{
|
|
|
//判断是enter事件
|
|
//判断是enter事件
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
{
|
|
|
|
|
+ string ErrorMessage = "";
|
|
|
if (sncode.Text == "")
|
|
if (sncode.Text == "")
|
|
|
{
|
|
{
|
|
|
OperateResult.AppendText("<<输入不能为空\n", Color.Red);
|
|
OperateResult.AppendText("<<输入不能为空\n", Color.Red);
|
|
@@ -54,58 +55,38 @@ namespace UAS_MES_NEW.Make
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool AllCheck = true;
|
|
bool AllCheck = true;
|
|
|
- if (FindColorSN)
|
|
|
|
|
- {
|
|
|
|
|
- object fugelcode = CheckSnDGV.Rows[RowIndex].Cells["pr_fugelcode"].Value;
|
|
|
|
|
- if ((fugelcode != null ? fugelcode.ToString() : "") + CheckSnDGV.Rows[RowIndex].Cells["pd_barcode"].Value.ToString() == sncode.Text)
|
|
|
|
|
- {
|
|
|
|
|
- CheckSnDGV.Rows[RowIndex].Cells["pd_checksn1"].Value = sncode.Text;
|
|
|
|
|
- FindFugeSN = true;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- OperateResult.AppendText("<<" + sncode.Text + "机身校验失败\n", Color.Red, sncode);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
for (int i = 0; i < CheckSnDGV.Rows.Count; i++)
|
|
for (int i = 0; i < CheckSnDGV.Rows.Count; i++)
|
|
|
{
|
|
{
|
|
|
- if (!FindColorSN)
|
|
|
|
|
|
|
+ object colorcode = CheckSnDGV.Rows[RowIndex].Cells["pr_colorcode"].Value;
|
|
|
|
|
+ if ((colorcode != null ? colorcode.ToString() : "") + CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() == sncode.Text)
|
|
|
{
|
|
{
|
|
|
- object colorcode = CheckSnDGV.Rows[RowIndex].Cells["pr_colorcode"].Value;
|
|
|
|
|
- Console.WriteLine(CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() + (colorcode != null ? colorcode.ToString() : ""));
|
|
|
|
|
- if ((colorcode != null ? colorcode.ToString() : "") + CheckSnDGV.Rows[i].Cells["pd_barcode"].Value.ToString() == sncode.Text)
|
|
|
|
|
- {
|
|
|
|
|
- CheckSnDGV.Rows[i].Cells["pd_checksn"].Value = sncode.Text;
|
|
|
|
|
- RowIndex = i;
|
|
|
|
|
- FindColorSN = true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ CheckSnDGV.Rows[i].Cells["pd_checksn"].Value = sncode.Text;
|
|
|
|
|
+ RowIndex = i;
|
|
|
|
|
+ FindColorSN = true;
|
|
|
}
|
|
}
|
|
|
- if (CheckSnDGV.Rows[i].Cells["pd_checksn"].Value == null || CheckSnDGV.Rows[i].Cells["pd_checksn1"].Value == null)
|
|
|
|
|
|
|
+ if (CheckSnDGV.Rows[i].Cells["pd_checksn"].Value == null)
|
|
|
{
|
|
{
|
|
|
AllCheck = false;
|
|
AllCheck = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (!FindColorSN && !FindFugeSN)
|
|
|
|
|
- {
|
|
|
|
|
- OperateResult.AppendText("<<" + sncode.Text + "校验失败\n", Color.Red, sncode);
|
|
|
|
|
- }
|
|
|
|
|
- if (FindColorSN && !FindFugeSN)
|
|
|
|
|
|
|
+ if (FindColorSN)
|
|
|
{
|
|
{
|
|
|
OperateResult.AppendText("<<" + sncode.Text + "彩盒校验成功\n", Color.Green, sncode);
|
|
OperateResult.AppendText("<<" + sncode.Text + "彩盒校验成功\n", Color.Green, sncode);
|
|
|
}
|
|
}
|
|
|
- if (FindFugeSN)
|
|
|
|
|
- {
|
|
|
|
|
- FindColorSN = false;
|
|
|
|
|
- FindFugeSN = false;
|
|
|
|
|
- OperateResult.AppendText("<<" + sncode.Text + "机身校验成功\n", Color.Green, sncode);
|
|
|
|
|
- }
|
|
|
|
|
if (AllCheck)
|
|
if (AllCheck)
|
|
|
{
|
|
{
|
|
|
SetCheck set = new SetCheck("OK", Color.Green);
|
|
SetCheck set = new SetCheck("OK", Color.Green);
|
|
|
BaseUtil.SetFormCenter(set);
|
|
BaseUtil.SetFormCenter(set);
|
|
|
set.ShowDialog();
|
|
set.ShowDialog();
|
|
|
|
|
+ if (LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "卡通箱整箱过站", out ErrorMessage))
|
|
|
|
|
+ {
|
|
|
|
|
+ dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
|
|
+ OperateResult.AppendText("<<" + pa_outboxcode.Text + "整箱校验通过\n", Color.Green, pa_outboxcode);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
|
|
|
|
|
+ }
|
|
|
pa_outboxcode.Focus();
|
|
pa_outboxcode.Focus();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -115,9 +96,10 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
{
|
|
|
if (e.KeyCode == Keys.Enter)
|
|
if (e.KeyCode == Keys.Enter)
|
|
|
{
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select pd_barcode,PR_COLORCODE, PR_FUGELCODE from packagedetail left join product on pr_code=PD_PRODCODE where pd_outboxcode='" + pa_outboxcode.Text + "'", "select");
|
|
|
|
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select pd_barcode,PR_COLORCODE,pd_makecode from packagedetail left join product on pr_code=PD_PRODCODE where pd_outboxcode='" + pa_outboxcode.Text + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ ms_makecode = dt.Rows[0]["pd_makecode"].ToString();
|
|
|
BaseUtil.FillDgvWithDataTable(CheckSnDGV, dt);
|
|
BaseUtil.FillDgvWithDataTable(CheckSnDGV, dt);
|
|
|
sncode.Focus();
|
|
sncode.Focus();
|
|
|
}
|
|
}
|