/// <summary> /// Method that performs validation against the fields on the form /// </summary> /// <returns>True if all of the controls contain valid information</returns> private bool HomeInfoIsValid() { FormValidator.ControlValidator validator = new FormValidator.ControlValidator(FormValidator.HasTextValidator); return(FormValidator.FieldIsValid(this.errNotifier, this.txtHomeFloorSpace, "Please enter a valid number", validator) & FormValidator.FieldIsValid(this.errNotifier, this.txtHomeStreetAddress, "Please enter the Street Address of the Home to be insured", validator) & FormValidator.FieldIsValid(this.errNotifier, this.cboHomeType, "Please select a home type", validator) & HomeBuiltDateIsValid()); }
public bool CarInfoIsValid() { FormValidator.ControlValidator validator = new FormValidator.ControlValidator(FormValidator.HasTextValidator); return(FormValidator.FieldIsValid(this.errNotifier, txtCarColor, "You must enter a color", validator) & FormValidator.FieldIsValid(this.errNotifier, txtCarMake, "You must enter a make", validator) & FormValidator.FieldIsValid(this.errNotifier, txtCarModel, "You must enter a model", validator) & FormValidator.FieldIsValid(this.errNotifier, txtCarYear, "You must enter a year", validator)); }
private bool ClientInfoIsValid() { FormValidator.ControlValidator validator = new FormValidator.ControlValidator(FormValidator.HasTextValidator); return(FormValidator.FieldIsValid(this.errNotifier, this.txtName, "Please enter a valid name", validator) & FormValidator.FieldIsValid(this.errNotifier, this.txtMailingAddress, "Please enter your address.", validator) & FormValidator.FieldIsValid(this.errNotifier, this.txtEmailAddress, "Please enter your email address.", validator) & FormValidator.FieldIsValid(this.errNotifier, this.txtPhoneNumber, "Please enter your phone number.", validator) & ClientIsElegible()); }