Beispiel #1
0
        public void ReservationConfirmation()
        {
            OccasionType   type           = OccasionType.Appointment;
            DateTimeOffset bookingTime    = DateTimeOffset.Parse("2018-11-20T19:16:31+00:00");
            var            occasionUpdate = new ReservationConfirmation(ReservationConfirmationStatus.Confirmed,
                                                                        new Occasion(
                                                                            type,
                                                                            bookingTime,
                                                                            new LocaleAttributes("en-GB", "provider"),
                                                                            new LocaleAttributes("en-GB", "subject"),
                                                                            new LocaleAttributes("en-GB", "broker")));

            Assert.True(Utility.CompareJson(occasionUpdate, "ReservationConfirmation.json", "payload.occasion.bookingTime"));
        }
Beispiel #2
0
        private void BookFlights(object sender, EventArgs e)
        {
//			if(Validate(this, flightsValidator))
//			{
            FlightCollection flightsToBook = GetFlightsToBook();
            Itinerary        itinerary     = new Itinerary(flightsToBook);
            // TODO: forward to next logical page and get user details...
            ReservationConfirmation confirmation = bookingAgent.Book(
                new Reservation(new Passenger(1, "Aleksandar", "Seovic"), itinerary));

            Session[Constants.ReservationConfirmationKey] = confirmation;
            SetResult(ReservationConfirmed);
//			}
//			else
//			{
//				this.outboundFlightIndex = NoFlightSelected;
//				this.returnFlightIndex = NoFlightSelected;
//			}
        }
Beispiel #3
0
 protected void BookFlights(object sender, EventArgs e)
 {
     if ((flights.HasOutboundFlights && !HasOutboundFlight))
     {
         this.ValidationErrors.AddError("summary", new ErrorMessage("error.outboundFlight.required"));
     }
     if ((flights.HasReturnFlights && !HasReturnFlight))
     {
         this.ValidationErrors.AddError("summary", new ErrorMessage("error.returnFlight.required"));
     }
     if (this.ValidationErrors.IsEmpty)
     {
         FlightCollection flightsToBook = GetFlightsToBook();
         Itinerary        itinerary     = new Itinerary(flightsToBook);
         // TODO: forward to next logical page and get user details...
         ReservationConfirmation confirmation = bookingAgent.Book(
             new Reservation(new Passenger(1, "Aleksandar", "Seovic"), itinerary));
         Session[Constants.ReservationConfirmationKey] = confirmation;
         SetResult(ReservationConfirmed);
     }
 }
 protected override void LoadModel(object savedModel)
 {
     confirmation = (ReservationConfirmation)savedModel;
 }
 protected override void InitializeModel()
 {
     confirmation = (ReservationConfirmation)Session[Constants.ReservationConfirmationKey];
 }