Ejemplo n.º 1
0
        public ActionResult BookingItinerary(
            Guid bookingId
            )
        {
            // fetch booking data
            var bookingItineraryContract =
                new BookingItineraryContract(
                    bookingId,
                    Logging.UserId(User.Identity, ViewBag)
                    );

            // todo, move the following into get booking service
            bookingItineraryContract.Flights = new BookingSearchService().BookingFlights(bookingId);

            // default search flight dates
            bookingItineraryContract.SearchFlights = new FlightsForPeriodLiveContract();
            bookingItineraryContract.SearchFlights.FromDateTime  = DateTime.UtcNow.Date;
            bookingItineraryContract.SearchFlights.UntilDateTime = DateTime.UtcNow.Date.AddDays(1);

            bookingItineraryContract.SearchFlights.Flights =
                new FlightSearchService().FlightsForPeriod(
                    Guid.Empty,
                    Guid.Empty,
                    bookingItineraryContract.SearchFlights.FromDateTime,
                    bookingItineraryContract.SearchFlights.UntilDateTime
                    );

            return(View(MVCHelper.Resolve(Request, "", "Booking", "BookingItinerary"),
                        bookingItineraryContract
                        ));
        }
Ejemplo n.º 2
0
        public ActionResult BookingItinerary(
            [Bind()] BookingItineraryContract bookingItineraryContract
            )
        {
            // move the following into get booking service
            bookingItineraryContract.Flights = new BookingSearchService().BookingFlights(bookingItineraryContract.BookingId);

            // search for flights
            bookingItineraryContract.SearchFlights.Flights =
                new FlightSearchService().FlightsForPeriod(
                    Guid.Empty,
                    Guid.Empty,
                    bookingItineraryContract.SearchFlights.FromDateTime,
                    bookingItineraryContract.SearchFlights.UntilDateTime
                    );

            return(View(MVCHelper.Resolve(Request, "", "Booking", "BookingItinerary"),
                        bookingItineraryContract
                        ));
        }