SMT_WaringSetting.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Text;
  3. using System.Windows.Forms;
  4. using UAS_MES_NEW.DataOperate;
  5. using UAS_MES_NEW.Entity;
  6. using UAS_MES_NEW.PublicMethod;
  7. namespace UAS_MES_NEW.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. try { UAS_MES_NEW.I18n.LanguageManager.Localize(this); } catch { }
  17. }
  18. private void Confirm_Click(object sender, EventArgs e)
  19. {
  20. if (de_code.Text == "" || Cycle.Text == "" || UnitTime.Text == "" || EarlyWarning.Text == "")
  21. {
  22. BaseUtil.ShowError(UAS_MES_NEW.I18n.LanguageManager.T("所有参数都必须填写!"));
  23. }
  24. else
  25. {
  26. string str = dh.getFieldDataByCondition("device", "de_statuscode", "de_code='" + de_code.Text + "'").ToString();
  27. if (str != "")
  28. {
  29. if (!(str == ("AUDITED")))
  30. {//机台未审核
  31. BaseUtil.ShowError(UAS_MES_NEW.I18n.LanguageManager.T("机台:") + de_code.Text + UAS_MES_NEW.I18n.LanguageManager.T("未审核!"));
  32. }
  33. }
  34. else
  35. {
  36. BaseUtil.ShowError(UAS_MES_NEW.I18n.LanguageManager.T("机台:") + de_code.Text + UAS_MES_NEW.I18n.LanguageManager.T("不存在!"));
  37. }
  38. Close();
  39. }
  40. }
  41. private void 用料预警设置_Load(object sender, EventArgs e)
  42. {
  43. de_code.FormName = Name;
  44. de_code.SetValueField = new string[] { "de_code" };
  45. de_code.TableName = "device";
  46. de_code.SelectField = "de_code # 设备编号,de_linecode # 线别编号,de_name # 设备名称,de_runstatus # 运行状态";
  47. de_code.Condition = "de_linecode='" + User.UserLineCode + "'";
  48. }
  49. }
  50. }