public async Task <IViewComponentResult> InvokeAsync(ViewComponentVModel model)
        {
            try
            {
                var userTrackingLKDId    = (await _lookupAppService.GetAllLookDetail(null, model.Module)).Items.FirstOrDefault().Id;
                var businessDocumentList = (await _documentAppService.GetAllBusinessDocuments(null, userTrackingLKDId, null)).Items.ToList();

                foreach (var businessDoc in businessDocumentList)
                {
                    businessDoc.BusinessDocumentAttachmentDto = _documentAppService.GetAllBusinessDocumentAttachments(null, businessDoc.Id, model.BusinessEntityId).Result.Items.ToList();
                }

                var documentModel = new DocumentUploaderViewModel()
                {
                    BusinessEntityId = model.BusinessEntityId,
                    DocumentList     = businessDocumentList,
                    IsReadOnly       = model.IsReadOnly
                };
                return(View(documentModel));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        public async Task <IViewComponentResult> InvokeAsync(ViewComponentVModel model)
        {
            if (!model.SearchModel.UserId.HasValue && !string.IsNullOrWhiteSpace(model.SearchModel.UserIdEnyc))
            {
                model.SearchModel.UserId = (!string.IsNullOrWhiteSpace(model.SearchModel.UserIdEnyc)) ? (int?)Convert.ToInt32(CryptoEngine.DecryptString(model.SearchModel.UserIdEnyc)) : null;
            }

            var photoList = _photoTrackingAppService.GetAllPhotoTrackingPagedResult(model.SearchModel, model.BusinessEntityId);
            var result    = new PhotoTrackingViewModel()
            {
                DocumentList = photoList,
                DocumentType = (model.SearchModel != null) ? model.SearchModel.DocumentType : EnumDocumentType.FrontPose
            };

            ViewBag.IsAdminLoggedIn = _userManager.IsAdminUser(AbpSession.UserId.Value);
            string view = string.IsNullOrEmpty(model.ViewName) ? "_Default" : model.ViewName;

            return(await Task.FromResult((IViewComponentResult)View(view, result)));
        }
示例#3
0
 public IActionResult LoadViewComponent(ViewComponentVModel model)
 {
     //if (!model.SearchModel.UserId.HasValue)
     //    model.SearchModel.UserId = (int?)AbpSession.UserId.Value;
     return(ViewComponent(model.ViewComponentName, model));
 }