|
|
@@ -73,17 +73,19 @@ namespace UAS_MES.Make
|
|
|
string oMsId = "";
|
|
|
string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "upper(ms_sncode)='" + sncode.Text.ToUpper() + "' or ms_firstsn in (select firstsn from makesnrelation where upper(beforesn)='" + sncode.Text.ToUpper() + "')").ToString();
|
|
|
oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
|
|
|
- if (oMakeCode=="")
|
|
|
+ if (oMakeCode == "")
|
|
|
{
|
|
|
OperateResult.AppendText(">>序列号:" + sncode.Text + " 未归属工单\n", Color.Red);
|
|
|
OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Black);
|
|
|
+ sncode.Text = "";
|
|
|
return;
|
|
|
}
|
|
|
//用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
|
|
|
- if (LogicHandler.CheckStepSNAndMacode(ma_code.Text==oMakeCode?oMakeCode:"", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out errorMessage))
|
|
|
+ if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == oMakeCode ? oMakeCode : "", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out errorMessage))
|
|
|
{
|
|
|
//如果用户没有选择工单号
|
|
|
- if (ma_code.Text==""||ma_code.Text!=oMakeCode) {
|
|
|
+ if (ma_code.Text == "" || ma_code.Text != oMakeCode)
|
|
|
+ {
|
|
|
dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -101,7 +103,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
//勾选是修改已转换的序列,矫正修改错了的序列号
|
|
|
case CheckState.Checked:
|
|
|
- if (dh.CheckExist("MakeSerial", "ms_beforesn='" + sncode.Text + "' and ms_id='"+oMsId+"' and ms_stepcode='"+User.CurrentStepCode+"'"))
|
|
|
+ if (dh.CheckExist("MakeSerial", "ms_beforesn='" + sncode.Text + "' and ms_id='" + oMsId + "' and ms_stepcode='" + User.CurrentStepCode + "'"))
|
|
|
{
|
|
|
bsncode = sncode.Text;
|
|
|
sncode.Text = "";
|
|
|
@@ -110,7 +112,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText(">>不存在该已转序列号:" + sncode.Text + "\n",Color.Red);
|
|
|
+ OperateResult.AppendText(">>不存在该已转序列号:" + sncode.Text + "\n", Color.Red);
|
|
|
sncode.Text = "";
|
|
|
OperateResult.AppendText("<<请重新输入序列号\n", Color.Black);
|
|
|
}
|
|
|
@@ -119,7 +121,7 @@ namespace UAS_MES.Make
|
|
|
|
|
|
//string beforesn = dh.getFieldDataByCondition("makeserial", "ms_beforesn", "ms_sncode='" + sncode.Text + "'").ToString().Trim();
|
|
|
//为空,就说明,没有进行过序列号的转换
|
|
|
- if (dh.CheckExist("makeserial","ms_sncode='"+sncode.Text+"' and ms_id='"+oMsId+"'"))
|
|
|
+ if (dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id='" + oMsId + "'"))
|
|
|
{
|
|
|
//记录转换前的序列号
|
|
|
bsncode = sncode.Text;
|
|
|
@@ -207,7 +209,10 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
|
|
|
+ }
|
|
|
+ sncode.Text = "";
|
|
|
}
|
|
|
}
|
|
|
|