|
|
@@ -234,26 +234,30 @@ namespace UAS_MES.Make
|
|
|
|
|
|
private void RepairComplete_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
|
|
|
- if (RejectNum > 0)
|
|
|
- OperatResult.AppendText(">>维修结果必须为已维修或无不良\n", Color.Red);
|
|
|
- else
|
|
|
+ //
|
|
|
+ if (dh.CheckExist("makeserial", "ms_status=3 and ms_sncode='" + ms_sncode.Text + "'"))
|
|
|
{
|
|
|
- dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
- OperatResult.AppendText(">>回流工序不存在\n", Color.Red);
|
|
|
+ int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
|
|
|
+ if (RejectNum > 0)
|
|
|
+ OperatResult.AppendText(">>维修结果必须为已维修或无不良\n", Color.Red);
|
|
|
else
|
|
|
{
|
|
|
- string cr_id = dt.Rows[0]["cr_id"].ToString();
|
|
|
- dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
|
|
|
if (dt.Rows.Count == 0)
|
|
|
- OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
|
|
|
+ OperatResult.AppendText(">>回流工序不存在\n", Color.Red);
|
|
|
else
|
|
|
{
|
|
|
- dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
|
|
|
- dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
|
|
|
- OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
|
|
|
- GetSNCode.Clear();
|
|
|
+ string cr_id = dt.Rows[0]["cr_id"].ToString();
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
|
|
|
+ dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
|
|
|
+ OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
|
|
|
+ GetSNCode.Clear();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -352,7 +356,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else OperatResult.AppendText(">>必须选择不良原因\n", Color.Red);
|
|
|
}
|
|
|
- else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
|
|
|
+ else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
|
|
|
}
|
|
|
|
|
|
private void SaveBadLocation_Click(object sender, EventArgs e)
|
|
|
@@ -373,7 +377,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else OperatResult.AppendText(">>不良位置不能为空\n", Color.Red);
|
|
|
}
|
|
|
- else OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
|
|
|
+ else OperatResult.AppendText(">>" + GetSNCode.Text + "序列号错误,不存在或者不处于维修状态\n", Color.Red);
|
|
|
}
|
|
|
|
|
|
private void mbl_loc_TextChanged(object sender, EventArgs e)
|