public static bool Validate(Person person) { if (string.IsNullOrWhiteSpace(person.FirstName)) { StandardMessages.DisplayValidationError("first name"); return(false); } if (string.IsNullOrWhiteSpace(person.LastName)) { StandardMessages.DisplayValidationError("last name"); return(false); } return(true); }
public static bool Validate(Person person) { // Check to ensure that both first and last names are valid inputs if (string.IsNullOrWhiteSpace(person.FirstName)) { StandardMessages.DisplayValidationError("first name"); return(false); } if (string.IsNullOrWhiteSpace(person.LastName)) { StandardMessages.DisplayValidationError("last name"); return(false); } return(true); }