예제 #1
0
        public bool Register()
        {
            YYAccount account = GetAccountInformation();
            Dictionary <string, string> errors = account.CheckValidate();

            if (errors.Count > 0)
            {
                Console.WriteLine("Please fix errros below and try again.");
                foreach (var error in errors)
                {
                    Console.WriteLine(error);
                }
                return(false);
            }
            else
            {
                // Lưu vào database.
                account.EncryptPassword();
                model.Save(account);
                return(true);
            }
        }
예제 #2
0
 public bool Register()
 {
     while (true)
     {
         YYAccount yyAccount = GetAccountInformation();
         Dictionary <string, string> errors = yyAccount.CheckValidate();
         if (errors.Count > 0)
         {
             Console.WriteLine("Please fix errors below and try again.");
             foreach (var error in errors)
             {
                 Console.WriteLine(error);
             }
         }
         else
         {
             yyAccount.EncryptPassWord();
             model.Save(yyAccount);
             return(true);
         }
     }
 }