示例#1
0
        public async Task <ItineraryModel> LoadFullItinerary(ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
        {
            ItineraryModel itineraryModel = await LoadFullCart <ItineraryModel>(itinerary, cancellationToken);

            itineraryModel.RecordLocator = itinerary.RecordLocator;
            return(itineraryModel);
        }
示例#2
0
        public async Task <string> Purchase(CartPersistenceModel cart, System.DateTimeOffset PurchasedOn, CancellationToken cancellationToken)
        {
            ItineraryPersistenceModel itinerary = JsonConvert.DeserializeObject <ItineraryPersistenceModel>(JsonConvert.SerializeObject(cart));

            itinerary.PurchasedOn = PurchasedOn;

            for (int ii = 0; ii < 6; ii++)
            {
                itinerary.RecordLocator += SAFECHARACTERS[_random.Next(0, 21)];
            }

            await _itineraryDataProvider.UpsertItinerary(itinerary, cancellationToken);

            return(itinerary.RecordLocator);
        }
 public async Task UpsertItinerary(ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
 {
     await _sqlServerProvider.Execute <ItineraryUpsertParams>("UpsertItinerary", new ItineraryUpsertParams()
     {
         Id = Guid.Parse(itinerary.Id),
         DepartingFlight          = _sqlServerProvider.NullIfZero(itinerary.DepartingFlight),
         ReturningFlight          = _sqlServerProvider.NullIfZero(itinerary.ReturningFlight),
         CarReservation           = _sqlServerProvider.NullIfZero(itinerary.CarReservation),
         CarReservationDuration   = _sqlServerProvider.NullIfZero(itinerary.CarReservationDuration),
         HotelReservation         = _sqlServerProvider.NullIfZero(itinerary.HotelReservation),
         HotelReservationDuration = _sqlServerProvider.NullIfZero(itinerary.HotelReservationDuration),
         RecordLocator            = itinerary.RecordLocator,
         PurchasedOn = itinerary.PurchasedOn
     }, cancellationToken);
 }
示例#4
0
 public async Task UpsertItinerary([FromBody] ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
 {
     await _itineraryDataProvider.UpsertItinerary(itinerary, cancellationToken);
 }
示例#5
0
 public async Task UpsertItinerary(ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
 {
     await _httpClient.PostAsync <ItineraryPersistenceModel>("api/Itinerary", itinerary, new System.Net.Http.Formatting.JsonMediaTypeFormatter());
 }
 public async Task UpsertItinerary(ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
 {
     _itineraries[itinerary.RecordLocator] = itinerary;
     await Task.Delay(0);
 }
 public async Task UpsertItinerary(ItineraryPersistenceModel itinerary, CancellationToken cancellationToken)
 {
     var docClient = await _getClientAndVerifyCollection;
     await _cosmosDBProvider.Persist <ItineraryPersistenceModel>(docClient, COLLECTIONNAME, itinerary, cancellationToken);
 }