|
|
@@ -88,10 +88,10 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
//调用公共方法CheckStepSNAndMacode判断工序是否正确
|
|
|
- if (LogicHandler.CheckStepSNAndMacode(ma_code.Text==oMakeCode?oMakeCode:"", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
|
|
|
+ if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == oMakeCode ? oMakeCode : "", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
|
|
|
{
|
|
|
//IF (如果ma_code 为空)THEN
|
|
|
- if (ma_code.Text == ""||ma_code.Text!=oMakeCode)
|
|
|
+ if (ma_code.Text == "" || ma_code.Text != oMakeCode)
|
|
|
{
|
|
|
//获取工单的其他信息
|
|
|
sql.Clear();
|
|
|
@@ -124,61 +124,52 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
|
|
|
}
|
|
|
}
|
|
|
- //更新打印的数据
|
|
|
- if (LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "机身标打印", "机身标打印成功", User.UserCode, out oErrorMessage))
|
|
|
+ //所选标签不为空
|
|
|
+ if (PrintLabel.SelectedValue != null)
|
|
|
{
|
|
|
- //所选标签不为空
|
|
|
- if (PrintLabel.SelectedValue != null)
|
|
|
+ //如果打印张数为空,返回
|
|
|
+ if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
|
|
|
{
|
|
|
- //如果打印张数为空,返回
|
|
|
- if (PrintNum.Text == "" || int.Parse(PrintNum.Text) == 0)
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red);
|
|
|
- //清空输入框的值,聚焦
|
|
|
- sncode.Text = "";
|
|
|
- sncode.Focus();
|
|
|
- //提示用户“>>请输入SN”
|
|
|
- OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
- return;
|
|
|
- }
|
|
|
- //按照打印张数打印
|
|
|
- Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
|
|
|
- //提示用户打印成功
|
|
|
- OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
|
|
|
-
|
|
|
+ OperateResult.AppendText(">>打印张数不可空或者为0\n", Color.Red);
|
|
|
//清空输入框的值,聚焦
|
|
|
sncode.Text = "";
|
|
|
sncode.Focus();
|
|
|
- //刷新打印数量和剩余数量
|
|
|
- dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
|
|
|
- BaseUtil.SetFormValue(Controls, dt);
|
|
|
- mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
|
|
|
+ //提示用户“>>请输入SN”
|
|
|
+ OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //按照打印张数打印
|
|
|
+ Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
|
|
|
+ //提示用户打印成功
|
|
|
+ OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
|
|
|
+ //更新打印的数据
|
|
|
+ LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "机身标打印", "机身标打印成功", User.UserCode, out oErrorMessage);
|
|
|
+ //清空输入框的值,聚焦
|
|
|
+ sncode.Text = "";
|
|
|
+ sncode.Focus();
|
|
|
+ //刷新打印数量和剩余数量
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
|
|
|
+ BaseUtil.SetFormValue(Controls, dt);
|
|
|
+ mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
|
|
|
|
|
|
- //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
|
|
|
- if (int.Parse(mcd_remainqty.Text) == 0)
|
|
|
- {
|
|
|
- BaseUtil.CleanForm(this);
|
|
|
- OperateResult.AppendText(">>工单:" + ma_code.Text + "打印完成,>>请输入SN\n", Color.Green);
|
|
|
- }
|
|
|
- //剩余数量不为0
|
|
|
- else
|
|
|
- {
|
|
|
- //提示用户“>>请输入SN”
|
|
|
- OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
- }
|
|
|
+ //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
|
|
|
+ if (int.Parse(mcd_remainqty.Text) == 0)
|
|
|
+ {
|
|
|
+ BaseUtil.CleanForm(this);
|
|
|
+ OperateResult.AppendText(">>工单:" + ma_code.Text + "打印完成,>>请输入SN\n", Color.Green);
|
|
|
}
|
|
|
- //标签为空
|
|
|
+ //剩余数量不为0
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护机身标签\n", Color.Red);
|
|
|
- sncode.Text = "";
|
|
|
+ //提示用户“>>请输入SN”
|
|
|
+ OperateResult.AppendText(">>请输入SN\n", Color.Black);
|
|
|
}
|
|
|
}
|
|
|
+ //标签为空
|
|
|
else
|
|
|
{
|
|
|
+ OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护机身标签\n", Color.Red);
|
|
|
sncode.Text = "";
|
|
|
- sncode.Focus();
|
|
|
- OperateResult.AppendText(">>更新工序失败" + oErrorMessage + "\n", Color.Red);
|
|
|
}
|
|
|
}
|
|
|
else
|