Esempio n. 1
0
        public async Task <IActionResult> DocumentGrid(PersonDocumentSearchModel model)
        {
            model = InitializePersonDocumentSearchModel(model);
            var result = await _customerApiClient.GetPersonDocuments(model);

            var documentTypes = _lookupApiClient.GetLookup().Result.DocumentTypes?.ConvertAll(x => (BaseLookupDto)x);

            model.DocumentTypeSelectList = SelectedListHelper.GetSelectListForItems(documentTypes, "");
            foreach (var personDocumentDto in result.PersonDocumentSearchResult)
            {
                personDocumentDto.DocumentTypeName = documentTypes?.FirstOrDefault(x => x.Id == personDocumentDto.Document.DocumentTypeId)?.Name;
            }
            var documents = await CreateThumbnail(result.PersonDocumentSearchResult.Where(x => x.Document.DocumentTypeId == 1).ToList());

            return(PartialView(result));
        }