コード例 #1
0
 public void UpdateCustomerDetails(LoginToken <Administrator> token, Customer customer)
 {
     if (token.IsTokenValid())
     {
         _customerDAO.Update(customer);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #2
0
 public void RemoveCustomer(LoginToken <Administrator> token, Customer customer)
 {
     if (token.IsTokenValid())
     {
         _customerDAO.Remove(customer);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #3
0
 public void UpdateAirlineDetails(LoginToken <Administrator> token, AirlineCompany customer)
 {
     if (token.IsTokenValid())
     {
         _airlineDAO.Update(customer);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #4
0
 public void RemoveAirline(LoginToken <Administrator> token, AirlineCompany airline)
 {
     if (token.IsTokenValid())
     {
         _airlineDAO.Remove(airline);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #5
0
 public void ModifyAirlineDetails(LoginToken<AirlineCompany> token, AirlineCompany airline)
 {
     if (token.IsTokenValid())
     {
         _airlineDAO.Update(airline);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #6
0
 public void UpdateFlight(LoginToken<AirlineCompany> token, Flight flight)
 {
     if (token.IsTokenValid())
     {
         _flightDAO.Update(flight);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #7
0
 public void CancelTicket(LoginToken <Customer> token, Ticket ticket)
 {
     if (token.IsTokenValid())
     {
         _ticketDAO.Remove(ticket);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #8
0
 public IList <Flight> GetAllMyFlights(LoginToken <Customer> token)
 {
     if (token.IsTokenValid())
     {
         return(_flightDAO.GetFlightsByCustomer(token.User));
     }
     else
     {
         throw new TokenNotValidException();
     }
 }
コード例 #9
0
 public void ChangeMyPassword(LoginToken<AirlineCompany> token, string oldPassword, string newPassword)
 {
     var service = new LoginService(_airlineDAO,_customerDAO);
     if (token.IsTokenValid())
     {
         service.ChangeAirlinePassword(token,oldPassword,newPassword);
     }
     else
     {
         throw new TokenNotValidException();
     }
 }