private void checkStudent() { if (!idTextbox.Text.Equals("")) { loadingScreen.Show(); this.Enabled = false; //Load customer from database (might take awhile, put a loading screen) string customerId = idTextbox.Text.ToUpper(); Customer c = CustomerDAO.getInstance().getCustomer(customerId); this.Enabled = true; loadingScreen.Hide(); if (c == null) { clearData(); AddNewStudent addNewStudent = new AddNewStudent(); DialogResult result = addNewStudent.ShowDialog(); if (result.Equals(DialogResult.No)) { clearData(); } else if (result.Equals(DialogResult.Yes)) { clearData(); idTextbox.Text = customerId; } } else { loadCustomer(c); } } }