Special_ChangeSNCraft.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. using UAS_MES.PublicMethod;
  12. namespace UAS_MES.Special
  13. {
  14. public partial class Special_ChangeSNCraft : Form
  15. {
  16. DataHelper dh = SystemInf.dh;
  17. DataTable Dbfind;
  18. public Special_ChangeSNCraft()
  19. {
  20. InitializeComponent();
  21. }
  22. private void Special_ChangeSNCraft_Load(object sender, EventArgs e)
  23. {
  24. cr_code.TableName = "craft left join product on cr_prodcode=pr_code";
  25. cr_code.SelectField = "cr_code # 途程编号,cr_name # 途程名称,cr_prodcode # 产品编号,pr_detail # 产品名称 ,pr_spec # 产品规格";
  26. cr_code.FormName = Name;
  27. cr_code.SetValueField = new string[] { "cr_code" };
  28. cr_code.Condition = "cr_statuscode='AUDITED'";
  29. cr_code.DbChange += Cr_code_DbChange;
  30. }
  31. private void Cr_code_DbChange(object sender, EventArgs e)
  32. {
  33. Dbfind = cr_code.ReturnData;
  34. BaseUtil.SetFormValue(this.Controls, Dbfind);
  35. }
  36. private void Confirm_Click(object sender, EventArgs e)
  37. {
  38. if (sn_code.Text != "")
  39. {
  40. DataTable dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id desc", "select");
  41. if (dt.Rows.Count > 0)
  42. {
  43. string msid = dt.Rows[0]["ms_id"].ToString();
  44. }
  45. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red);
  46. }
  47. else OperateResult.AppendText(">>序列号" + sn_code.Text + "不能为空\n", Color.Red);
  48. }
  49. }
  50. }