Esempio n. 1
0
        /// <inheritdoc />
        IDictionaryRange <Guid, DynamicEventName> IRepository <Guid, DynamicEventName> .FindAll()
        {
            IEventNameRepository self = this;
            var request = new DynamicEventNameRequest
            {
                Culture = self.Culture
            };
            var response = this.serviceClient.Send <ICollection <EventNameDTO> >(request);

            if (response.Content == null)
            {
                return(new DictionaryRange <Guid, DynamicEventName>(0));
            }

            var dynamicEventNames = new DictionaryRange <Guid, DynamicEventName>(response.Content.Count)
            {
                SubtotalCount = response.Content.Count,
                TotalCount    = response.Content.Count
            };

            foreach (var dynamicEventName in this.dynamicEventNameCollectionConverter.Convert(response.Content, null))
            {
                dynamicEventName.Culture = request.Culture;
                dynamicEventNames.Add(dynamicEventName.EventId, dynamicEventName);
            }

            return(dynamicEventNames);
        }
Esempio n. 2
0
        /// <inheritdoc />
        async Task <IDictionaryRange <Guid, DynamicEventName> > IRepository <Guid, DynamicEventName> .FindAllAsync(CancellationToken cancellationToken)
        {
            IEventNameRepository self = this;
            var request = new DynamicEventNameRequest
            {
                Culture = self.Culture
            };
            var response = await this.serviceClient.SendAsync <ICollection <EventNameDTO> >(request, cancellationToken).ConfigureAwait(false);

            if (response.Content == null)
            {
                return(new DictionaryRange <Guid, DynamicEventName>(0));
            }

            var dynamicEventNames = new DictionaryRange <Guid, DynamicEventName>(response.Content.Count)
            {
                SubtotalCount = response.Content.Count,
                TotalCount    = response.Content.Count
            };

            foreach (var dynamicEventName in this.dynamicEventNameCollectionConverter.Convert(response.Content, null))
            {
                dynamicEventName.Culture = request.Culture;
                dynamicEventNames.Add(dynamicEventName.EventId, dynamicEventName);
            }

            return(dynamicEventNames);
        }
Esempio n. 3
0
 public ReportApplicationService(
     ICompletedEventRepository completedEventRepository,
     IEventMilestoneRepository eventMilestoneRepository,
     IPeriodRepository periodRepository,
     IHospitalRepository hospitalRepository,
     ISpecialtyRepository specialtyRepository,
     IClinicianRepository clinicianRepository,
     IEventNameRepository eventNameRepository,
     IClock clock,
     MonthlyPeriodBreachesReportService monthlyPeriodBreachesReportService,
     EventBreachesReportService eventBreachesReportService,
     PeriodBreachesReportService periodBreachesReportService,
     PeriodAndEventBreachesCountReportService periodAndEventBreachesCountReportService,
     PeriodBreachesCounterReportService periodBreachesCounterReportService)
 {
     _completedEventRepository = completedEventRepository;
     _eventMilestoneRepository = eventMilestoneRepository;
     _periodRepository         = periodRepository;
     _hospitalRepository       = hospitalRepository;
     _specialtyRepository      = specialtyRepository;
     _clinicianRepository      = clinicianRepository;
     _eventNameRepository      = eventNameRepository;
     _clock = clock;
     _monthlyPeriodBreachesReportService       = monthlyPeriodBreachesReportService;
     _eventBreachesReportService               = eventBreachesReportService;
     _periodBreachesReportService              = periodBreachesReportService;
     _periodAndEventBreachesCountReportService = periodAndEventBreachesCountReportService;
     _periodBreachesCounterReportService       = periodBreachesCounterReportService;
 }
        /// <inheritdoc />
        Task <IDictionaryRange <Guid, DynamicEventName> > IRepository <Guid, DynamicEventName> .FindAllAsync(CancellationToken cancellationToken)
        {
            IEventNameRepository self = this;
            var request = new DynamicEventNameRequest
            {
                Culture = self.Culture
            };
            var responseTask = this.serviceClient.SendAsync <ICollection <EventNameDataContract> >(request, cancellationToken);

            return(responseTask.ContinueWith(task => this.ConvertAsyncResponse(task, request.Culture), cancellationToken));
        }