Exemple #1
0
        public static bool ValidateFirstName(Person user)
        {
            if (string.IsNullOrWhiteSpace(user.FirstName))
            {
                StandardMessages.ValidateMessage("First Name");
                return(false);
            }

            if (string.IsNullOrWhiteSpace(user.LastName))
            {
                StandardMessages.ValidateMessage("Last Name");
                return(false);
            }
            return(true);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            StandardMessages.WelcomeMessage();

            Person user = PersonCaptureData.Capture();


            bool isUserValid = PersonValidator.ValidateFirstName(user);

            if (!isUserValid)
            {
                StandardMessages.EndApplication();
                return;
            }

            string userName = AccountGenerator.GenerateUserName(user);

            StandardMessages.ShowUserName(userName);

            StandardMessages.EndApplication();
        }