Ejemplo n.º 1
0
        public virtual PeriodBreachesViewModel GetPeriodBreachesReport(RoleData role, int weeksToBreach, BreachFilterInputModel filterInputModel, ListInputModel listInputModel)
        {
            var filterInputInfo = _breachFilterInputModelToInfoMapper.Map(filterInputModel);
            var listInputInfo   = _listInputModelToInfoMapper.Map(listInputModel);

            var periodBreachesInfo = _reportAuthorizationFilter.GetPeriodBreachesReport(role, weeksToBreach, filterInputInfo, listInputInfo);

            return(new PeriodBreachesViewModel
            {
                PeriodsInfo = periodBreachesInfo.PeriodsInfo
                              .Select(periodInfo => _periodBreachInfoToViewModelMapper.Map(periodInfo))
                              .ToArray(),
                TotalNumberOfPeriods = periodBreachesInfo.TotalNumberOfPeriodBreaches
            });
        }
Ejemplo n.º 2
0
        public virtual EventBreachesViewModel GetEventBreachesReport(RoleData role, int daysToBreach, BreachFilterInputModel filterInputModel, ListInputModel listInputModel)
        {
            var filterInputInfo = _breachFilterInputModelToInfoMapper.Map(filterInputModel);
            var listInputInfo   = _listInputModelToInfoMapper.Map(listInputModel);

            var eventBreaches = _reportAuthorizationFilter.GetEventBreachesReport(role, daysToBreach, filterInputInfo, listInputInfo);

            return(new EventBreachesViewModel
            {
                EventBreaches = eventBreaches.EventBreaches
                                .Select(eventBreach => _eventBreachInfoToViewModelMapper.Map(eventBreach))
                                .ToArray(),
                TotalNumberOfEventBreaches = eventBreaches.TotalNumberOfEventBreaches
            });
        }