LockCheckBox.cs 1.7 KB

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