private PartialViewResult ViewNew(NewProjectAttachmentUpdateViewModel viewModel, ProjectUpdateBatch projectUpdateBatch) { IEnumerable <AttachmentType> attachmentTypes = projectUpdateBatch.GetValidAttachmentTypesForForms(); Check.Assert(attachmentTypes != null, "Cannot find any valid attachment relationship types for this project."); var viewData = new NewProjectAttachmentViewData(attachmentTypes); return(RazorPartialView <NewProjectAttachment, NewProjectAttachmentViewData, NewProjectAttachmentViewModel>(viewData, viewModel)); }
public ActionResult New(ProjectUpdateBatchPrimaryKey projectUpdateBatchPrimaryKey, NewProjectAttachmentUpdateViewModel viewModel) { if (!ModelState.IsValid) { return(ViewNew(viewModel, projectUpdateBatchPrimaryKey.EntityObject)); } var projectUpdateBatch = projectUpdateBatchPrimaryKey.EntityObject; viewModel.UpdateModel(projectUpdateBatch, CurrentFirmaSession); projectUpdateBatch.TickleLastUpdateDate(CurrentFirmaSession); return(new ModalDialogFormJsonResult()); }
public PartialViewResult New(ProjectUpdateBatchPrimaryKey projectUpdateBatchPrimaryKey) { var viewModel = new NewProjectAttachmentUpdateViewModel(projectUpdateBatchPrimaryKey.EntityObject); return(ViewNew(viewModel, projectUpdateBatchPrimaryKey.EntityObject)); }