Special_SettleSN.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using UAS_MES.DataOperate;
  10. using UAS_MES.Entity;
  11. namespace UAS_MES.Special
  12. {
  13. public partial class Special_SettleSN : Form
  14. {
  15. DataHelper dh = SystemInf.dh;
  16. public Special_SettleSN()
  17. {
  18. InitializeComponent();
  19. }
  20. private void Confirm_Click(object sender, EventArgs e)
  21. {
  22. if (sn_code.Text != "")
  23. {
  24. DataTable dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id desc", "select");
  25. if (dt.Rows.Count > 0)
  26. {
  27. string msid = dt.Rows[0]["ms_id"].ToString();
  28. dh.UpdateByCondition("makeserial", "ms_nextstepcode='',ms_status=2", "ms_id='" + msid + "'");
  29. OperateResult.AppendText(">>序列号" + sn_code.Text + "结案成功\n", Color.Red, sn_code);
  30. }
  31. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red);
  32. }
  33. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不能为空\n", Color.Red);
  34. }
  35. }
  36. }