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); } }
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); } } }