public async Task <FundingClaimsDatesModel> GetFundingClaimsCollectionMetaDataAsync( int collectionYear, CancellationToken cancellationToken = default(CancellationToken)) { var fundingClaimsCollectionMeta = await _httpClientService.GetAsync <IEnumerable <FundingClaimsCollection> >($"{_baseUrl}/collection/collectionYear/{collectionYear}", cancellationToken); var fundingClaimsCollectionMetaData = new List <FundingClaimsCollectionMetaData>(); foreach (var fccm in fundingClaimsCollectionMeta) { fundingClaimsCollectionMetaData.Add(new FundingClaimsCollectionMetaData() { CollectionName = fccm.CollectionName, CollectionId = fccm.CollectionId, UpdatedBy = fccm.UpdatedBy, CollectionYear = fccm.CollectionYear, DateTimeUpdatedUtc = fccm.DateTimeUpdatedUtc, HelpdeskOpenDateUtc = fccm.HelpdeskOpenDateUtc, RequiresSignature = fccm.RequiresSignature.GetValueOrDefault() ? 'Y' : 'N', SignatureCloseDateUtc = fccm.SignatureCloseDateUtc, SubmissionCloseDateUtc = fccm.SubmissionCloseDateUtc, SubmissionOpenDateUtc = fccm.SubmissionOpenDateUtc }); } var collections = await _collectionsService.GetCollectionsByType(CollectionTypes.FundingClaim, cancellationToken); FundingClaimsDatesModel model = new FundingClaimsDatesModel() { FundingClaimsDatesList = fundingClaimsCollectionMetaData.OrderByDescending(x => x.CollectionId).ThenByDescending(x => x.SubmissionOpenDateUtc).ToList(), Collections = collections.Where(x => x.CollectionYear == collectionYear).ToList() }; return(model); }
public async Task <IActionResult> Index() { var collections = (await _collectionsService.GetCollectionsByType(CollectionTypeConstants.Publication)).ToList(); ViewData[ViewDataConstants.Collections] = collections.Select(x => x.CollectionTitle); return(await ReportTypeChanged(new PublicationReportModel() { CollectionName = collections.FirstOrDefault()?.CollectionTitle, })); }
public async Task <IActionResult> SelectValidate() { var collections = await _collectionsService.GetCollectionsByType(CollectionTypeConstants.Publication); ViewData[ViewDataConstants.Collections] = collections.Select(x => x.CollectionTitle); return(View("SelectValidate")); }