Пример #1
0
 public FacadeBase()
 {
     _airlineDAO  = new AirlineDAOMSSQL();
     _countryDAO  = new CountryDAOMSSQL();
     _customerDAO = new CustomerDAOMSSQL();
     _flightDAO   = new FlightDAOMSSQL();
     _ticketDAO   = new TicketDAOMSSQL();
 }
 /// <summary>
 /// Change the password of the Airline User.
 /// </summary>
 /// <param name="token"></param>
 /// <param name="oldPassword"></param>
 /// <param name="newPassword"></param>
 public void ChangeMyPassword(LoginToken <AirlineCompany> token, string oldPassword, string newPassword)
 {
     if (token != null)
     {
         if (token.User.Password == oldPassword)
         {
             token.User.Password = newPassword;
             _airlineDAO         = new AirlineDAOMSSQL();
             _airlineDAO.Update(token.User);
         }
         else
         {
             throw new WrongPasswordException($"Old Password {oldPassword} is wrong");
         }
     }
 }
Пример #3
0
 public LoginService()
 {
     _airlineDAO  = new AirlineDAOMSSQL();
     _customerDAO = new CustomerDAOMSSQL();
 }