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);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            StandardMessages.WelcomeMessage();
            //Ask for user information.

            Person person        = PersonDataCapture.Capture();
            bool   isPersonValid = PersonValidator.Validate(person);

            if (!isPersonValid)
            {
                StandardMessages.EndApplication();
                return;
            }
            //check to be sure firstName and lastname are valid.

            AccountGenerator.CreateAccount(person);
            StandardMessages.EndApplication();
        }