LockCheckBox.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Windows.Forms;
  3. using UAS_MES_NEW.CustomControl.TextBoxWithIcon;
  4. using UAS_MES_NEW.PublicMethod;
  5. namespace UAS_MES_NEW.CustomControl.CustomCheckBox
  6. {
  7. public partial class LockCheckBox : CheckBox
  8. {
  9. /// <summary>
  10. /// 存放工单的控件
  11. /// </summary>
  12. MaCodeSearchTextBox MaCtl;
  13. bool LeaveEvent1;
  14. public bool LeaveEvent
  15. {
  16. get
  17. {
  18. return LeaveEvent1;
  19. }
  20. set
  21. {
  22. LeaveEvent1 = value;
  23. }
  24. }
  25. public LockCheckBox()
  26. {
  27. InitializeComponent();
  28. }
  29. public void GetMakeCodeCtl(MaCodeSearchTextBox ctl)
  30. {
  31. MaCtl = ctl;
  32. }
  33. private void LockCheckBox_CheckStateChanged(object sender, EventArgs e)
  34. {
  35. if (Checked)
  36. {
  37. if (MaCtl.Text != "")
  38. {
  39. //string ErrorMessage;
  40. //if (LogicHandler.CheckMakeStatus(MaCtl.Text, out ErrorMessage))
  41. MaCtl.Enabled = false;
  42. //else
  43. //{
  44. // Checked = false;
  45. // MaCtl.Text = "";
  46. // BaseUtil.ShowError(ErrorMessage);
  47. //}
  48. }
  49. else
  50. {
  51. Checked = false;
  52. MaCtl.Text = "";
  53. BaseUtil.ShowError("数据不能为空");
  54. }
  55. }
  56. else
  57. {
  58. MaCtl.Enabled = true;
  59. MaCtl.Focus();
  60. }
  61. }
  62. }
  63. }