public LoginService() { _adminDAO = new AdminDAOPGSQL(); _customerDAO = new CustomerDAOPGSQL(); _airlineDAO = new AirlineDAOPGSQL(); _userDAO = new UserDAOPGSQL(); }
public LoginService() { _airlineDAO = new AirlineDAOMSSQL(); _customerDAO = new CustomerDAOMSSQL(); mapTypeLoginFunction = new Dictionary <Type, Func <string, string, ILoginToken> >(); AddToDictionary(); }
public bool TryAirlineLogin(string userName, string password, out LoginToken <AirlineCompany> token) { if (userName == "AlphaUser" || userName == "BetaUser") { _airlineDAO = new AirlineDAOMSSQL(true); } else { _airlineDAO = new AirlineDAOMSSQL(); } AirlineCompany airlineCompany = _airlineDAO.GetAirlineByUsername(userName); if (airlineCompany != null) { if (airlineCompany.Password == password) { token = new LoginToken <AirlineCompany>(airlineCompany); return(true); } else { throw new WrongPasswordException($"failed to login as [{userName}], you entered a wrong password! [{password}]"); } } token = null; return(false); }
public bool TryAirlineLogin(string userName, string password, out LoginToken <AirlineCompany> token) { try { _airlineDAO = new AirLineDAOMSSQL(); AirlineCompany alc = _airlineDAO.GetAirlineByUserame(userName); if (alc == null) { token = null; return(false); } else if (alc.PASSWORD == password) { token = new LoginToken <AirlineCompany>(); token.User = new AirlineCompany(); token.User.USER_NAME = userName; token.User.PASSWORD = password; return(true); } else if (alc.PASSWORD != password) { throw new WrongPasswordException("Wrong password"); } } catch (Exception e) { Console.WriteLine(e.Message); } token = null; return(false); }
public FacadeBase() { this._airlineDAO = new AirlineDAOMSSQL(); this._countryDAO = new CountryDAOMSQQL(); this._customerDAO = new CustomerDAOMSSQL(); this._flightDAO = new FlightDAOMSSQL(); this._ticketDAO = new TIcketDAOMSSQL(); }
public FacadeBase() { _airlineDAO = new AirlineDAOMSSQL(); _countryDAO = new CountryDAOMSSQL(); _customerDAO = new CustomerDAOMSSQL(); _flightDAO = new FlightDAOMSSQL(); _ticketDAO = new TicketDAOMSSQL(); }
public FacadeBase(IAirlineDAO airlineDAO, ICountryDAO countryDAO, ICustomerDAO customerDAO, IFlightDAO flightDAO, ITicketDAO ticketDAO, IAdministratorDAO administratorDAO) { _airlineDAO = airlineDAO; _countryDAO = countryDAO; _customerDAO = customerDAO; _flightDAO = flightDAO; _ticketDAO = ticketDAO; _administratorDAO = administratorDAO; }
protected FacadeBase(bool test) { _airlineDAO = new AirlineCompany(); _countryDAO = new Country(); _customerDAO = customerDAO; _adminDAO = adminDAO; _user = user; _flightDAO = flightDAO; _ticketDAO = ticketDAO; }
protected FacadeBase() { _airlineDAO = new AirlineDAOPGSQL(); _countryDAO = new CountryDAOPGSQL(); _customerDAO = new CustomerDAOPGSQL(); _adminDAO = new AdminDAOPGSQL(); _userDAO = new UserDAOPGSQL(); _flightDAO = new FlightDAOPGSQL(); _ticketDAO = new TicketDAOPGSQL(); _flightsTicketsHistoryDAO = new FlightsTicketsHistoryDAOPGSQL(); }
public FacadeBase() { _airlineDAO = new AirlineDAO(); _countryDAO = new CountryDAO(); _customerDAO = new CustomerDAO(); _flightDAO = new FlightDAO(); _ticketDAO = new TicketDAO(); _userRoleDAO = new UserRoleDAO(); _userRepositoryDAO = new UserRepositoryDAO(); _adminDAO = new AdminDAO(); }
public FacadeBase(bool testMode) { GlobalConfig.GetConfiguration(testMode); _airlineDAO = new AirlineDAOPGSQL(); _countryDAO = new CountryDAOPGSQL(); _customerDAO = new CustomerDAOPGSQL(); _adminDAO = new AdminDAOPGSQL(); _userDAO = new UserDAOPGSQL(); _flightDAO = new FlightDAOPGSQL(); _ticketDAO = new TicketDAOPGSQL(); }
public FacadeBase() { _adminDAO = new AdministratorDAOMSSQL(); _airlineDAO = new AirlineDAOMSSQL(); _customerDAO = new CustomerDAOMSSQL(); _userDAO = new UserDAOMSSQL(); _flightDAO = new FlightDAOMSSQL(); _ticketDAO = new TicketDAOMSSQL(); _countryDAO = new CountryDAOMSSQL(); _backgroundDAO = new MaintenanceDAOMSSQL(); }
public FacadeBase(bool testMode = false) { _ticketDAO = new TicketDAOMSSQL(testMode); _customerDAO = new CustomerDAOMSSQL(testMode); _flightDAO = new FlightDAOMSSQL(testMode); _countryDAO = new CountryDAOMSSQL(testMode); log.Debug($"creating airlineDAO from type AirlineDAOMSSQL, testMode = {testMode}"); _airlineDAO = new AirlineDAOMSSQL(testMode); log.Debug("AirlineDAOMSSQL created successfully"); }
public void ChangeMyPassword(LoginToken <AirlineCompany> token, string oldPassword, string newPassword) { if (UserIsValid(token)) { if (token.User.Password == oldPassword) { token.User.Password = newPassword; _airlineDAO = new AirlineDAOMSSQL(); _airlineDAO.Update(token.User); } else { throw new WrongPasswordException("Your Password Old, Please write new Password"); } } }
public bool TryAirlineLogin(string username, string password, out LoginToken <AirlineCompany> token) { _airlineDAO = new AirlineDAOMSSQL(); AirlineCompany company = _airlineDAO.GetAirLineByUserName(username); if (company != null) { if (company.Password == password) { token = new LoginToken <AirlineCompany>() { User = company }; return(true); } } else { try { if (company == null) { token = null; return(false); } } catch (WrongPasswordException) { token = new LoginToken <AirlineCompany>() { User = company }; return(false); throw new WrongPasswordException("Your Password is not correct, Try again"); } } token = null; return(false); }
public bool TryAirlineLogin(string userName, string password, out LoginToken <AirlineCompany> token) { _arilineDAO = new AirlineDAOMSSQL(); AirlineCompany airline = _arilineDAO.GetAirlineByUsername(userName); if (airline != null) { if (airline.PASSWORD == password) { token = new LoginToken <AirlineCompany>() { User = airline }; return(true); } else { throw new WrongPasswordException("Wrong password exception"); } } token = null; return(false); }
public LoginService() { _airlineDAO = new AirlineDAOMSSQL(); _customerDAO = new CustomerDAOMSSQL(); _administratorDAO = new AdministratorDAOMSSQL(); }
/// <summary> /// Default Constructor /// </summary> public AirLineManager() { airlineDAO = (IAirlineDAO)AirTravelDAOFactory.GetInstance().Create("Airline"); }
/// <summary> /// Default Constructor /// </summary> public AirLineManager() { airlineDAO = AirTravelDAOFactory.GetInstance().CreateAirlineDAO(); }
public LoginService() { _airlineDAO = new AirLineDAOMSSQL(); _customerDAO = new CustomerDAOMSSQL(); }
/// <summary> /// Parameterized Constructor /// </summary> /// <param name="airlineDAO"></param> public AirLineManager(IAirlineDAO airlineDAO) { this.airlineDAO = airlineDAO; }
public LoginService(IAirlineDAO airlineDAO, ICustomerDAO customerDAO) { _airlineDAO = airlineDAO; _customerDAO = customerDAO; db = new FlightsSystemContext(); // make DAO for LoginService ... }
public LoginService(IAirlineDAO arilineDAO) { _arilineDAO = arilineDAO; }
public LoginServiceBase(IAirlineDAO airlineDAO, ICustomerDAO customerDAO, IAdministratorDAO administratorDAO) { _airlineDAO = airlineDAO; _customerDAO = customerDAO; _administratorDAO = administratorDAO; }