Exemplo n.º 1
0
        public bool TryAdminLogin(string userName, string password, out LoginToken <AdministratorLogin> token)
        {
            token = new LoginToken <AdministratorLogin>();
            List <string> _listpassword = _administratorADO.GetPasswords();
            List <string> _listusername = _administratorADO.GetUserName();

            if (_listpassword.Contains(password) && _listusername.Contains(userName))
            {
                token.User = new AdministratorLogin();
                token.User.SetAdministrator();
                return(true);
            }
            else if (!_listpassword.Contains(password))
            {
                throw new WrongPasswordException();
            }
            else
            {
                token = null;
                return(false);
            }
        }