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_CancelMaterial : Form { DataHelper dh = SystemInf.dh; LogStringBuilder sql = new LogStringBuilder(); public Special_CancelMaterial() { InitializeComponent(); } private void Confirm_Click(object sender, EventArgs e) { //获取序列号的途程 DataTable dt = (DataTable)dh.ExecuteSql("select ms_firstsn,ms_id,ms_nextstepcode,ms_currentstepcode,ms_makecode,ms_status,ms_checkno,ms_craftcode,ms_prodcode,ms_stepcode from makeserial where ms_sncode='" + sn_code.Text + "' and ms_makecode='" + ms_makecode.Text + "' order by ms_id desc", "select"); if (dt.Rows.Count > 0) { string pr_code = dt.Rows[0]["ms_prodcode"].ToString(); string cr_code = dt.Rows[0]["ms_craftcode"].ToString(); string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString(); string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString(); string ms_checkno = dt.Rows[0]["ms_checkno"].ToString(); string ms_status = dt.Rows[0]["ms_status"].ToString(); string ms_currentstepcode = dt.Rows[0]["ms_currentstepcode"].ToString(); string ms_id = dt.Rows[0]["ms_id"].ToString(); string ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString(); if (ms_status != "3") { OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于维修状态,不允许拆解" + ms_makecode.Text + "\n", Color.Red, sn_code); return; } dh.ExecuteSql("update craftmaterial set cm_status=-1 where cm_firstsn='" + ms_firstsn + "' and cm_makecode='" + ms_makecode.Text + "'", "update"); LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "解绑物料", "解绑物料成功", sn_code.Text, ""); OperateResult.AppendText(">>序列号" + sn_code.Text + "成功解除绑定\n", Color.Green, sn_code); } else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在于工单" + ms_makecode.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) { } } }