private void txtLEDid_MouseLeave(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtLEDid.Text.Trim()) && id == -1) { BllScreeenSetting bllScreeenSetting = new BllScreeenSetting(); DataTable dtScreen = bllScreeenSetting.GetScreenSetting($" and ScreenID= '{txtLEDid.Text.Trim()}'"); if (dtScreen.Rows.Count > 0) { MessageBox.Show("屏幕编号已存在!"); } dtScreen.Dispose(); } }