public ActionResult ShowUploadButton(bool? error, string errorMessage, int documentOriginTypeId = 0, bool canEditDocumentType = false, AttachDocumentReturnView returnView = AttachDocumentReturnView.GeneralRiskAssessmentDocuments, int documentTypeId = 0) { var viewModel = new DocumentUploadButtonViewModel() { DocumentOriginTypeId = documentOriginTypeId, CanEditDocumentType = canEditDocumentType, ReturnView = returnView, DocumentTypeId = documentTypeId }; if (error.HasValue && error.Value) { viewModel.Error = true; viewModel.ErrorMessage = "An error occured."; } return View("~/Areas/Documents/Views/Document/DocumentUploadButton.cshtml", viewModel); }
public PartialViewResult DocumentUploaded(long documentLibraryId, string fileName, int documentOriginTypeId = 0, int documentTypeId = 0, bool canEditDocumentType = false, AttachDocumentReturnView returnView = AttachDocumentReturnView.GeneralRiskAssessmentDocuments) { var viewModel = new NewlyAddedDocumentGridRowViewModel() { DocumentLibraryId = documentLibraryId, Filename = fileName, DocumentOriginTypeId = documentOriginTypeId, CanEditDocumentType = canEditDocumentType, DocumentTypeId = documentTypeId }; var documentTypes = _lookupService.GetDocumentTypes(); viewModel.DocumentTypes = new SelectList(documentTypes, "Id", "Name", documentTypeId); if (returnView == AttachDocumentReturnView.AddedDocuments) { viewModel.Sites = GetSites(); return PartialView("~/Areas/Documents/Views/Document/_AddedDocumentGridRow.cshtml", viewModel); } return PartialView("~/Areas/Documents/Views/Document/_DocumentGridRow.cshtml", viewModel); }