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