public static bool Validate(Person person)
        {
            if (string.IsNullOrEmpty(person.FirstName))
            {
                StandardMessage.DisplayValidationError("first name");
                return(false);
            }
            if (string.IsNullOrEmpty(person.LastName))
            {
                StandardMessage.DisplayValidationError("last name");
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public static bool Validate(Person person)
        {
            //Check to be sure the first and last name are valid
            if (string.IsNullOrWhiteSpace(person.FirstName))
            {
                StandardMessage.DisplayValidationError("first name");
                return(false);
            }

            if (string.IsNullOrWhiteSpace(person.LastName))
            {
                StandardMessage.DisplayValidationError("last name");

                return(false);
            }

            return(true);
        }