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.Special { public partial class Special_QCRecheck : Form { DataHelper dh = SystemInf.dh; LogStringBuilder sql = new LogStringBuilder(); public Special_QCRecheck() { InitializeComponent(); } private void Confirm_Click(object sender, EventArgs e) { //获取序列号的途程 DataTable dt = (DataTable)dh.ExecuteSql("select 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='" + sn_code.Text + "' or ms_imei1='" + sn_code.Text + "' and ms_imei2='" + sn_code.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_qccheck = dt.Rows[0]["ms_qccheck"].ToString(); pr_detail.Text = dt.Rows[0]["pr_detail"].ToString(); if (ms_qccheck != "-1") { OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于QC判定状态\n", Color.Red, sn_code); return; } dh.ExecuteSql("update makeserial set ms_qccheck=0 where ms_sncode='" + sn_code.Text + "'", "update"); LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "维修品判定", "维修品判定为良品", sn_code.Text, ""); OperateResult.AppendText(">>序列号" + sn_code.Text + "QC确认良品\n", Color.Green, sn_code); } else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code); } 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 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='" + sn_code.Text + "' or ms_imei1='" + sn_code.Text + "' and ms_imei2='" + sn_code.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_qccheck = dt.Rows[0]["ms_qccheck"].ToString(); pr_detail.Text = dt.Rows[0]["pr_detail"].ToString(); } else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code); } } } }