Esempio n. 1
0
        public LoginResult Login(string userName, string password, out BankUser bankUser)
        {
            bankUser = null;
            if (users.TryGetValue(userName, out BankUser user))
            {
                if (user.Credentials.IsPasswordCorect(password))
                {
                    bankUser = user;
                    return(LoginResult.Sucess);
                }
                else
                {
                    return(LoginResult.InvalidPassword);
                }
            }

            return(LoginResult.InvalidUser);
        }
Esempio n. 2
0
 public bool AddNewUser(BankUser user)
 {
     return(users.TryAdd(user.Credentials.UserName, user));
 }