SMT_WaringSetting.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Text;
  3. using System.Windows.Forms;
  4. using UAS_MES.DataOperate;
  5. using UAS_MES.Entity;
  6. using UAS_MES.PublicMethod;
  7. namespace UAS_MES.SMT
  8. {
  9. public partial class SMT_WaringSetting : Form
  10. {
  11. StringBuilder sql = new StringBuilder();
  12. DataHelper dh = new DataHelper();
  13. public SMT_WaringSetting()
  14. {
  15. InitializeComponent();
  16. }
  17. private void Confirm_Click(object sender, EventArgs e)
  18. {
  19. if (de_code.Text == "" || Cycle.Text == "" || UnitTime.Text == "" || EarlyWarning.Text == "")
  20. {
  21. BaseUtil.ShowError("所有参数都必须填写!");
  22. }
  23. else
  24. {
  25. string str = dh.getFieldDataByCondition("device", "de_statuscode", "de_code='" + de_code.Text + "'").ToString();
  26. if (str != "")
  27. {
  28. if (!(str == ("AUDITED")))
  29. {//机台未审核
  30. BaseUtil.ShowError("机台:" + de_code.Text + "未审核!");
  31. }
  32. }
  33. else
  34. {
  35. BaseUtil.ShowError("机台:" + de_code.Text + "不存在!");
  36. }
  37. Close();
  38. }
  39. }
  40. private void 用料预警设置_Load(object sender, EventArgs e)
  41. {
  42. de_code.FormName = Name;
  43. de_code.SetValueField = new string[] { "de_code" };
  44. de_code.TableName = "device";
  45. de_code.SelectField = "de_code # 设备编号,de_linecode # 线别编号,de_name # 设备名称,de_runstatus # 运行状态";
  46. de_code.Condition = "de_linecode='" + User.UserLineCode + "'";
  47. }
  48. }
  49. }