private bool Validation() { if (string.IsNullOrWhiteSpace(TextBoxFirstName.Text)) { MessageBox.Show("Enter first name"); TextBoxFirstName.Focus(); return(false); } if (string.IsNullOrWhiteSpace(TextBoxLastName.Text)) { MessageBox.Show("Enter last name"); TextBoxLastName.Focus(); return(false); } if (string.IsNullOrWhiteSpace(DataPicker1.Text)) { MessageBox.Show("Enter date"); DataPicker1.Focus(); return(false); } return(true); }
private bool CheckAllFields() { ErrMsg errMsg; errMsg = Check.CheckField(FieldName.IsInsured, TextBoxInsured.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxInsured.Focus(); TextBoxInsured.ForeColor = Color.Red; return(false); } errMsg = Check.CheckField(FieldName.FirstName, TextBoxFirstName.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxFirstName.Focus(); TextBoxFirstName.ForeColor = Color.Red; return(false); } errMsg = Check.CheckField(FieldName.LastName, TextBoxLastName.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxLastName.Focus(); TextBoxLastName.ForeColor = Color.Red; return(false); } // Sterrenbeeld moet kloppen: errMsg = Check.CheckField(FieldName.Zodiac, TextBoxZodiac.Text); if (errMsg.ErrorId != "00") { SetOnErrMsg(errMsg); TextBoxZodiac.Focus(); TextBoxZodiac.ForeColor = Color.Red; return(false); } return(true); }