Exemple #1
0
 protected override void LoadModel(object savedModel)
 {
     trip = (Trip)savedModel;
 }
Exemple #2
0
        /// <summary>
        /// Gets a <see cref="System.Collections.IList"/> comprised of all
        /// those <see cref="SpringAir.Domain.Itinerary"/> instances that
        /// are applicable for the supplied <see cref="SpringAir.Domain.Trip"/>.
        /// </summary>
        /// <param name="trip">
        /// The <see cref="SpringAir.Domain.Trip"/> that contains the criteria
        /// that are to be used to select a list of applicable
        /// <see cref="SpringAir.Domain.Itinerary"/> instances.
        /// </param>
        /// <returns>
        /// A <see cref="System.Collections.IList"/> comprised of all
        /// those <see cref="SpringAir.Domain.Itinerary"/> instances that
        /// are applicable for the supplied <see cref="SpringAir.Domain.Trip"/>.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">
        /// If the supplied <paramref name="trip"/> is <cref lang="null"/>.
        /// </exception>
        public IList GetItinerariesFor(Trip trip)
        {
            #region Sanity Check

            if (trip == null)
            {
                throw new ArgumentNullException("trip", "The 'trip' argument is required.");
            }

            #endregion

            IList itineraries = new ArrayList();

            return itineraries;
        }
Exemple #3
0
 protected override void InitializeModel()
 {
     trip = new Trip();
     trip.Mode = TripMode.RoundTrip;
     trip.StartingFrom.Date = DateTime.Today;
     trip.ReturningFrom.Date = DateTime.Today.AddDays(1);
 }
		/// <summary>
		/// Gets those <see cref="SpringAir.Domain.FlightSuggestions"/>
		/// that are applicable for the supplied <see cref="SpringAir.Domain.Trip"/>.
		/// </summary>
		/// <param name="trip">
		/// The <see cref="SpringAir.Domain.Trip"/> that contains the criteria
		/// that are to be used to select the flight suggestions.
		/// </param>
		/// <returns>
		/// A <see cref="SpringAir.Domain.FlightSuggestions"/> comprised of all
		/// those <see cref="SpringAir.Domain.Flight"/> instances that
		/// are applicable for the supplied <see cref="SpringAir.Domain.Trip"/>.
		/// </returns>
		/// <exception cref="System.ArgumentNullException">
		/// If the supplied <paramref name="trip"/> is <cref lang="null"/>.
		/// </exception>
		public FlightSuggestions SuggestFlights(Trip trip)
		{
			#region Sanity Check

			if (trip == null)
			{
				throw new ArgumentNullException("trip", "The 'trip' argument is required.");
			}

			#endregion

			Airport origin = this.airportDao.GetAirport(trip.StartingFrom.AirportCode);
			Airport destination = this.airportDao.GetAirport(trip.ReturningFrom.AirportCode);

			FlightCollection outboundLegs = GetFlights(origin, destination, trip.StartingFrom.Date);
			FlightCollection returnLegs = null;
			if (trip.Mode == TripMode.RoundTrip)
			{
				// swap 'em round, and get the legs for the way back...
				returnLegs = GetFlights(destination, origin, trip.ReturningFrom.Date);
			}
			return new FlightSuggestions(outboundLegs, returnLegs);
		}