public bool TryAirlineLogin(string userName, string password, out LoginToken <AirlineCompany> token) { AirlineCompany airlineCompany = _airlineDAO.GetAirlineByUserame(userName); if (airlineCompany != null) { if ((userName == airlineCompany.USERNAME) && (password == airlineCompany.PASSWORD)) { token = new LoginToken <AirlineCompany>(); token.User = airlineCompany; return(true); } else { throw new WrongPasswordException(); } } else { token = null; return(false); } }
public bool TryCustomerLogin(string userName, string password, out LoginToken <Customer> token) { Customer customer = _customerDAO.GetCustomerByUserame(userName); if (customer != null) { //if (userName == customer.USERNAME && password == customer.PASSWORD) if (password == customer.PASSWORD) { token = new LoginToken <Customer>(); token.User = customer; return(true); } else { throw new WrongPasswordException(); } } else { token = null; return(false); } }