/// <summary> /// Prcoess the incoming extrapolation data event message, and creates and shows an instance of the report popup window with the appropriate chart. /// It uses the service locator to get an instance of the report popup window. /// </summary> /// <param name="eventPayLoad"> the GreeksExtrapolationReportEventPayLoad event sent by the ReportDataManagerImpl.</param> /// <exception cref="ArgumentNullException"> thrown if the eventpayload parameter is null.</exception> private void HandleGreeksExtrapolationyReportEvent(GreeksExtrapolationReportEventPayLoad eventPayLoad) { if (eventPayLoad == null) { throw new ArgumentNullException("eventPayLoad"); } if (eventPayLoad.OutputExtrapolation.Count == 0) { MessageBox.Show("No extrapolation data returned for the selected criteria!", "No Report Data To Display", MessageBoxButton.OK, MessageBoxImage.Information); return; } var reportViewModel = new GeneratedReportViewModel { ReportTitle = "Extrapolation Graph Of " + GetRangeVariableDescription(eventPayLoad.RangeVariable) + " For RFQ " + eventPayLoad.RequestId + ":", ReportType = eventPayLoad.ReportType, }; foreach (var extrapolationPoint in eventPayLoad.OutputExtrapolation) { var listOfExtrapolations = extrapolationPoint.Value.ToList(); listOfExtrapolations.Sort(new NumericKeyComparer()); reportViewModel.AddSeries(extrapolationPoint.Key, listOfExtrapolations); } var reportWindow = ServiceLocator.Current.GetInstance <IWindowPopup>(WindowPopupNames.REPORT_WINDOW_POPUP); reportWindow.ShowWindow(reportViewModel); }
/// <summary> /// Prcoess the incoming report data event message, and creates and shows an instance of the report popup window with the appropriate chart. /// It uses the service locator to get an instance of the report popup window. /// </summary> /// <param name="eventPayLoad"> the GreeksByCategoryReportEventPayLoad event sent by the ReportDataManagerImpl.</param> /// <exception cref="ArgumentNullException"> thrown if the eventpayload parameter is null.</exception> private void HandleGreeksByCategoryReportEvent(GreeksByCategoryReportEventPayLoad eventPayLoad) { if (eventPayLoad == null) { throw new ArgumentNullException("eventPayLoad"); } if (eventPayLoad.GreeksByCategory.Count == 0) { MessageBox.Show("No greek data returned for the selected criteria!", "No Report Data To Display", MessageBoxButton.OK, MessageBoxImage.Information); return; } var reportViewModel = new GeneratedReportViewModel { ReportTitle = "Graph Of Greeks By " + eventPayLoad.Category + " :", ReportType = eventPayLoad.ReportType, }; foreach (var greeksBelongingToACatgeory in eventPayLoad.GreeksByCategory) { var listOfCategorizedgreeks = greeksBelongingToACatgeory.Value.ToList(); listOfCategorizedgreeks.Sort(new StringKeyComparer()); reportViewModel.AddSeries(greeksBelongingToACatgeory.Key, listOfCategorizedgreeks); } var reportWindow = ServiceLocator.Current.GetInstance <IWindowPopup>(WindowPopupNames.REPORT_WINDOW_POPUP); reportWindow.ShowWindow(reportViewModel); }
/// <summary> /// Prcoess the incoming report data event message, and creates and shows an instance of the report popup window with the appropriate chart. /// It uses the service locator to get an instance of the report popup window. /// </summary> /// <param name="eventPayLoad"> the RequestsCountByCategoryReportEventPayLoad event sent by the ReportDataManagerImpl.</param> /// <exception cref="ArgumentNullException"> thrown if the eventpayload paramter is null.</exception> private void HandleRequestsCountByCategoryReportEvent(RequestsCountByCategoryReportEventPayLoad eventPayLoad) { if (eventPayLoad == null) { throw new ArgumentNullException("eventPayLoad"); } if (eventPayLoad.CountByCategory.Count == 0) { MessageBox.Show("No RFQ data returned for the selected criteria!", "No Report Data To Display", MessageBoxButton.OK, MessageBoxImage.Information); return; } var reportViewModel = new GeneratedReportViewModel() { ReportTitle = "Request Count By " + eventPayLoad.Category + ":", ReportType = eventPayLoad.ReportType }; reportViewModel.AddSeries(GeneratedReportViewModel.ONLY_ONE_SERIES, eventPayLoad.CountByCategory.ToList()); var reportWindow = ServiceLocator.Current.GetInstance <IWindowPopup>(WindowPopupNames.REPORT_WINDOW_POPUP); reportWindow.ShowWindow(reportViewModel); }