using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using UAS_MES.PublicMethod; namespace UAS_MES.CustomControl.CustomCheckBox { public partial class LockCheckBox : CheckBox { /// /// 存放工单的控件 /// Control MaCtl; public LockCheckBox() { InitializeComponent(); } public void GetMakeCodeCtl(Control ctl) { MaCtl = ctl; } public void LockCheckBox_CheckedChanged(object sender, EventArgs e) { if (Checked) { if (MaCtl.Text != "") { string ErrorMessage; if (LogicHandler.CheckMakeStatus(MaCtl.Text, out ErrorMessage)) MaCtl.Enabled = false; else { Checked = false; BaseUtil.ShowError(ErrorMessage); } } else { Checked = false; BaseUtil.ShowError("工单号不能为空"); } } else { MaCtl.Enabled = true; MaCtl.Focus(); } } } }