Esempio n. 1
0
            public static Person GetPerson(string name)
            {
                foreach (Person p in USERS)
                {
                    if (p.Name == name)
                    {
                        return(p);
                    }
                }

                AccountException e = new AccountException(ExceptionEnum.USER_DOES_NOT_EXIST);

                throw new Exception(e.ToString());
            }
Esempio n. 2
0
            public void Login(string password)
            {
                if (this.password != password)
                {
                    IsAuthenticated = false;
                    AccountException e = new AccountException(ExceptionEnum.PASSWORD_INCORRECT);

                    throw e;
                }

                if (this.password == password)
                {
                    IsAuthenticated = true;
                }
            }