using System; using System.Collections.Generic; using System.Data; using System.Drawing; using System.Windows.Forms; using UAS_MES_NEW.DataOperate; using UAS_MES_NEW.Entity; using UAS_MES_NEW.PublicMethod; namespace UAS_MES_NEW.OQC { public partial class OQC_CancelMakeDown : Form { DataHelper dh = SystemInf.dh; LogStringBuilder sql = new LogStringBuilder(); public OQC_CancelMakeDown() { InitializeComponent(); } private void Confirm_Click(object sender, EventArgs e) { if (reason.Text == "") { OperateResult.AppendText(">>解除原因必填\n", Color.Red, this.batch); return; } //获取序列号的途程 DataTable dt = (DataTable)dh.ExecuteSql("select ms_batchcode,nvl(MS_IFQCCHECK,0)MS_IFQCCHECK,ms_makecode,ms_stepcode,ms_status,pr_detail,ms_outboxcode,ms_sncode,ms_firstsn,ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode,nvl(ms_qccheck,0)ms_qccheck from makeserial left join product on pr_code=ms_prodcode where ms_downcode='" + batch.Text + "' order by ms_id desc", "select"); if (dt.Rows.Count > 0) { pr_code.Text = dt.Rows[0]["ms_prodcode"].ToString(); string ms_makecode = dt.Rows[0]["ms_makecode"].ToString(); string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString(); string ms_status = dt.Rows[0]["ms_status"].ToString(); string ms_ifqccheck = dt.Rows[0]["MS_IFQCCHECK"].ToString(); pr_detail.Text = dt.Rows[0]["pr_detail"].ToString(); if (ms_ifqccheck == "-1" && ms_status == "3") { OperateResult.AppendText(">>序列号" + this.batch.Text + "不处于QC判定状态\n", Color.Red, this.batch); return; } dh.ExecuteSql("update makeserial set ms_downstatus=0 where ms_downcode='" + batch.Text + "' ", "update"); dh.ExecuteSql("update makedown set MD_STATUS=0,MD_UPREASON='" + reason.Text + "' where md_code='" + batch.Text + "'", "update"); LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "解除锁定不良品", "解除锁定不良品", this.batch.Text, ""); OperateResult.AppendText(">>批次号" + this.batch.Text + "解除锁定不良品\n", Color.Green, this.batch); } else OperateResult.AppendText(">>冻结批次号" + batch.Text + "不存在\n", Color.Red, batch); } private void Clean_Click(object sender, EventArgs e) { OperateResult.Clear(); } private void Special_CancelCollection_Load(object sender, EventArgs e) { } DataTable Dbfind; private void pr_code_DbChange(object sender, EventArgs e) { } private void sn_code_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { DataTable dt = (DataTable)dh.ExecuteSql("select ms_downcode,nvl(MS_IFQCCHECK,0)MS_IFQCCHECK,ms_makecode,ms_stepcode,ms_status,pr_detail,ms_outboxcode,ms_sncode,ms_firstsn,ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode,nvl(ms_qccheck,0)ms_qccheck from makeserial left join product on pr_code=ms_prodcode where ms_sncode='" + batch.Text + "' order by ms_id desc", "select"); if (dt.Rows.Count > 0) { pr_code.Text = dt.Rows[0]["ms_prodcode"].ToString(); string ms_makecode = dt.Rows[0]["ms_makecode"].ToString(); string ms_downcode = dt.Rows[0]["ms_downcode"].ToString(); pr_detail.Text = dt.Rows[0]["pr_detail"].ToString(); if (ms_downcode == "") { OperateResult.AppendText(">>该序列号不存在冻结批次" + batch.Text + "\n", Color.Red, batch); } else { batch.Text = ms_downcode; } } else OperateResult.AppendText(">>SN" + batch.Text + "不存在\n", Color.Red, batch); } } } }