コード例 #1
0
 public static bool Validate(Person person)
 {
     //Checks to be sure the first and last name are valid
     if (string.IsNullOrWhiteSpace(person.FirstName))
     {
         StandardMessage.ValidateErrorMessage("first name");
         return(false);
     }
     if (string.IsNullOrWhiteSpace(person.LastName))
     {
         StandardMessage.ValidateErrorMessage("last name");
         return(false);
     }
     return(true);
 }
コード例 #2
0
        static void Main(string[] args)
        {
            StandardMessage.WelcomeMessage();


            Person user        = PersonDataCapture.Capture();
            bool   isUserValid = PersonValidator.Validate(user);

            if (isUserValid == false)
            {
                StandardMessage.EndApplication();
            }
            AccountGenerator.CreateAccount(user);
            StandardMessage.EndApplication();
        }