public async Task <IActionResult> Index(long jobId) { Logger.LogInfo($"Loading validation results page for job id : {jobId}", jobIdOverride: jobId); var job = await GetJob(jobId); var valResult = await _validationResultsService.GetValidationResult(Ukprn, jobId, job.JobType, job.DateTimeSubmittedUtc); if (valResult == null) { Logger.LogInfo($"Loading validation results page for job id : {jobId}, no data found", jobIdOverride: jobId); return(View(new ValidationResultViewModel())); } if (await _collectionManagementService.GetCurrentPeriodAsync(job.CollectionName) == null) { var nextPeriod = await _collectionManagementService.GetNextPeriodAsync(job.CollectionName); ViewData[ViewDataConstants.NextReturnOpenDate] = nextPeriod?.NextOpeningDate; } valResult.CollectionName = job.CollectionName; Logger.LogInfo($"Returning validation results for job id : {jobId}, total errors : {valResult.TotalErrors}", jobIdOverride: jobId); return(View(valResult)); }
private async Task SetupNextPeriod(string collectionName) { if (string.IsNullOrEmpty(collectionName)) { return; } if (await _collectionManagementService.GetCurrentPeriodAsync(collectionName) == null) { Logger.LogWarning($"No active period for collection : {collectionName}"); var nextPeriod = await _collectionManagementService.GetNextPeriodAsync(collectionName); ViewData[ViewDataConstants.NextReturnOpenDate] = nextPeriod?.NextOpeningDate; } }
public async Task <IActionResult> Index(string collectionName) { var period = await _collectionManagementService.GetNextPeriodAsync(collectionName); return(View(period)); }
protected async Task <ReturnPeriodViewModel> GetNextPeriodAsync(string collectionName) { return(await _collectionManagementService.GetNextPeriodAsync(collectionName)); }