1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using System;
- using System.Data;
- 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_CancelImei : Form
- {
- DataHelper dh;
- LogStringBuilder sql = new LogStringBuilder();
- public Special_CancelImei()
- {
- InitializeComponent();
- }
- private void Special_BoxSplit_Load(object sender, EventArgs e)
- {
- dh = SystemInf.dh;
- }
- private void Split_Click(object sender, EventArgs e)
- {
- }
- private void SaveRepairInf_Click(object sender, EventArgs e)
- {
- if (Reason.Text == "")
- {
- MessageBox.Show("必须填写原因");
- return;
- }
- DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei1 ='" + IMEI.Text + "'", "select");
- if (dt.Rows.Count > 0)
- {
- dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei1='" + IMEI.Text + "'", "select");
- if (dt.Rows.Count > 0)
- {
- string sn = dt.Rows[0]["ms_sncode"].ToString();
- string pr_detail = dt.Rows[0]["pr_detail"].ToString();
- dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei1='' where ms_imei1='" + IMEI.Text + "'", "update");
- dh.ExecuteSql("update sninfo set si_imei1='' where si_imei1='" + IMEI.Text + "'", "update");
- LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
- OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
- }
- else
- {
- OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
- }
- }
- else
- {
- dt = (DataTable)dh.ExecuteSql("select ms_sncode,ms_imei1 from makeserial where ms_imei2 ='" + IMEI.Text + "'", "select");
- if (dt.Rows.Count > 0)
- {
- dt = (DataTable)dh.ExecuteSql("select ms_sncode,substr(pr_detail,0,15)pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_imei2='" + IMEI.Text + "'", "select");
- if (dt.Rows.Count > 0)
- {
- string sn = dt.Rows[0]["ms_sncode"].ToString();
- string pr_detail = dt.Rows[0]["pr_detail"].ToString();
- dh.ExecuteSql("update makeserial set ms_imei='" + Reason.Text + "',ms_imei2='' where ms_imei2='" + IMEI.Text + "'", "update");
- dh.ExecuteSql("update sninfo set si_imei2='' where si_imei2='" + IMEI.Text + "'", "update");
- LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, sn + " " + Reason.Text, "取消成功", IMEI.Text, "");
- OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
- }
- else
- {
- OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
- }
- }
- else
- {
- OperateResult.AppendText(IMEI.Text + "未录入系统\n", System.Drawing.Color.Black);
- }
- }
- }
- }
- }
|