|
|
@@ -351,16 +351,22 @@ namespace UAS_MES.Make
|
|
|
string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
|
|
|
if (confirm == "Yes")
|
|
|
{
|
|
|
- string ms_ifrework = dh.getFieldDataByCondition("makeserial", "nvl(ms_ifrework,0)", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
|
|
|
- if (ms_ifrework == "0")
|
|
|
- {
|
|
|
- dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
- }
|
|
|
- else
|
|
|
+ DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcode" }, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_reworkstatus= 4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
- dh.UpdateByCondition("oqcbatch", "ob_nowcheckqty=ob_nowcheckqty-1", "ob_checkno='" + ms_checkno.Text + "'");
|
|
|
- dh.ExecuteSql("delete from oqcbatchedetail where obd_sncode='" + ms_sncode.Text + "'", "delete");
|
|
|
+ string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
|
|
|
+ string reworkcode = dt.Rows[0]["ms_reworkcode"].ToString();
|
|
|
+ if (ms_ifrework == "0")
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_reworkstatus= 4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
|
|
|
+ dh.UpdateByCondition("oqcbatch", "ob_nowcheckqty=ob_nowcheckqty-1", "ob_checkno='" + ms_checkno.Text + "'");
|
|
|
+ dh.ExecuteSql("delete from oqcbatchedetail where obd_sncode='" + ms_sncode.Text + "'", "delete");
|
|
|
+ dh.UpdateByCondition("ReworkDetail", "rd_rwstatus='报废'", "rd_reid=(select re_id from rework where re_code='"+reworkcode+"') and rd_sncode='"+ reworkcode + "'");
|
|
|
+ }
|
|
|
}
|
|
|
dh.UpdateByCondition("make", "MA_NGMADEQTY=nvl(MA_NGMADEQTY,0)+1", "ma_code='" + macode + "'");
|
|
|
LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "报废", "序列号报废", User.UserCode);
|