public async Task <IActionResult> ValidationRulesReport(int year, int period, string rule) { var model = new RuleSearchViewModel(); var collectionYears = await _collectionsService.GetCollectionYearsByType(CollectionTypeConstants.Ilr); model.CollectionYears = collectionYears.OrderByDescending(x => x).ToList(); ViewData["years"] = model.CollectionYears.Select(x => new SelectListItem { Text = x.ToString(), Value = x.ToString() }).ToList(); var jobId = await _validationRulesService.GenerateReport(rule, year, User.Name()); return(RedirectToAction("InProgress", new { jobId, period })); }
private async Task <ReportsViewModel> GenerateReportsViewModel(ReportsViewModel reportsViewModel, CancellationToken cancellationToken) { var model = new ReportsViewModel() { CollectionYear = reportsViewModel.CollectionYear, CollectionPeriod = reportsViewModel.CollectionPeriod, }; var getAllPeriodsTask = _periodService.GetPeriodsUptoNowAsync(CollectionTypes.ILR, cancellationToken); var collectionYearsTask = _collectionsService.GetCollectionYearsByType(CollectionTypes.ILR, cancellationToken); await Task.WhenAll(getAllPeriodsTask, collectionYearsTask); model.ReturnPeriods = getAllPeriodsTask.Result; model.CollectionYears = collectionYearsTask.Result; return(model); }
public async Task <IEnumerable <int> > GetCollectionYears() { var collectionYears = await _collectionsService.GetCollectionYearsByType(CollectionTypeConstants.Ilr); return(collectionYears.OrderByDescending(x => x).ToList()); }