/// <summary> /// Gets all the flights /// </summary> /// <exception cref="FlightManagerException">Thorwn when unable to get flights</exception> /// <returns>Returns list of flights</returns> public List <Flight> GetFlights() { try { return(flightDAO.GetFlights()); } catch (FlightDAOException ex) { throw new FlightManagerException("Unable to get flights", ex); } }
/// <summary> /// Gets all the flights /// </summary> /// <exception cref="FlightManagerException">Thorwn when unable to get flights</exception> /// <returns>Returns array of flights</returns> public Flight[] GetFlights() { try { Flight[] flightsArr = flightDAO.GetFlights(); return(flightsArr); } catch (FlightDAOException ex) { throw new FlightManagerException("Unable to get flights", ex); } }
/// <summary> /// Gets all the flights /// </summary> /// <exception cref="FlightManagerException">Thorwn when unable to get flights</exception> /// <returns>Returns list of flights</returns> public List <Flight> GetFlights() { try { //return flightDAO.GetFlights(); var flights = from flight in flightDAO.GetFlights().Distinct() orderby flight.Name select flight; return(flights.ToList <Flight>()); } catch (FlightDAOException ex) { throw new FlightManagerException("Unable to get flights", ex); } }
public List <Flight> GetFlightsCollectionForAirline() { FlightManager fm = new FlightManager(); flights = new List <Flight>(); flights = flightDAO.GetFlights().ToList(); flights.Sort(); return(flights); }
/// <summary> /// Gets the flight details for a given airline id /// </summary> /// <parameter name="airlineId"></parameter> /// <exception cref="FlightManagerException">Thorwn when unable to get flights for a given airline</exception> /// <returns>Returns list of flights for an airline</returns> public List <Flight> GetFlightsForAirLine(int airlineId) { try { return(flightDAO.GetFlights().Where(w => w.AirlineForFlight.Id == airlineId).ToList()); } catch (FlightDAOException ex) { throw new FlightManagerException("Unable to get the flight for a given airline", ex); } }