コード例 #1
0
        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));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        public PartialViewResult New(ProjectUpdateBatchPrimaryKey projectUpdateBatchPrimaryKey)
        {
            var viewModel = new NewProjectAttachmentUpdateViewModel(projectUpdateBatchPrimaryKey.EntityObject);

            return(ViewNew(viewModel, projectUpdateBatchPrimaryKey.EntityObject));
        }