Esempio n. 1
0
        public static bool Validate(Person person)
        {
            //Checks to be sure the first and last names are valid
            if (string.IsNullOrWhiteSpace(person.FirstName))
            {
                StandardMessages.DisplayValidationError("first name");
                return(false);
            }

            if (string.IsNullOrWhiteSpace(person.LastName))
            {
                StandardMessages.DisplayValidationError("last name");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        public void ShowExample()
        {
            StandardMessages.SayWelcomeMessage();

            Person user = PersonDataCapture.Capture();

            bool isUserValid = PersonValidator.Validate(user);

            if (isUserValid == false)
            {
                StandardMessages.EndApplication();
                return;
            }

            StandardMessages.EndApplication();

            AccountGenerator.CreateAccount(user);
        }