Ejemplo n.º 1
0
        public static Person Capture()
        {
            Person output = new Person();

            Console.WriteLine("What is your first name?");
            output.FirstName = Console.ReadLine();

            Console.WriteLine("What is your last name?");
            StandardMessages.EndApplication();
            return(output);
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            StandardMessages.WelcomeMessage();
            Person user = PersonDataCapture.Capture();
            //check for null
            bool isUserValide = PersonValidator.ValidatePerson(user);

            if (!isUserValide)
            {
                StandardMessages.EndApplication();
                return;
            }
            AccountGenerator.CreateAccount(user);
            StandardMessages.EndApplication();
        }
Ejemplo n.º 3
0
 public static bool ValidatePerson(Person person)
 {
     if (string.IsNullOrWhiteSpace(person.FirstName))
     {
         StandardMessages.DisplayValidatorError("first name");
         Console.WriteLine("Invalid firstname");
         StandardMessages.EndApplication();
         return(false);
     }
     if (string.IsNullOrWhiteSpace(person.LastName))
     {
         StandardMessages.DisplayValidatorError("last name");
         StandardMessages.EndApplication();
         return(false);
     }
     return(true);
 }