private void ChartPerCustomerSetup(BookingAggregates bookingAggregates) { Chart.ImageStorageMode = System.Web.UI.DataVisualization.Charting.ImageStorageMode.UseHttpHandler; Chart.Series["NumberOfCheckin"].Points.AddXY("Winter", bookingAggregates.NumberOfCheckinWinterSeason); Chart.Series["NumberOfCheckin"].Points.AddXY("Spring", bookingAggregates.NumberOfCheckinSpringSeason); Chart.Series["NumberOfCheckin"].Points.AddXY("Summer", bookingAggregates.NumberOfCheckinSummerSeason); Chart.Series["NumberOfCheckin"].Points.AddXY("Autumn", bookingAggregates.NumberOfCheckinAutumnSeason); }
public async Task <IActionResult> Post(string key, [FromBody] Booking booking) { try { var dictionary = await _stateManager.GetOrAddAsync <IReliableDictionary <string, BookingAggregates> >(ValuesDictionaryName); var bookingAggregates = await GetBookingAggregatesByKey(key); using (ITransaction tx = _stateManager.CreateTransaction()) { if (bookingAggregates == null) { bookingAggregates = new BookingAggregates(booking); } else { bookingAggregates.Update(booking); } await dictionary.SetAsync(tx, key, bookingAggregates); await tx.CommitAsync(); } return(Ok()); } catch (FabricNotPrimaryException) { return(new ContentResult { StatusCode = 410, Content = "The primary replica has moved. Please re-resolve the service." }); } catch (FabricException) { return(new ContentResult { StatusCode = 503, Content = "The service was unable to process the request. Please try again." }); } }