public PartialViewResult EditGrantModificationFile(GrantModificationFileResourcePrimaryKey grantModificationFileResourcePrimaryKey)
        {
            var fileResource = grantModificationFileResourcePrimaryKey.EntityObject;
            var viewModel    = new EditFileResourceViewModel(fileResource);

            return(ViewEditGrantModificationFile(viewModel));
        }
        public ActionResult EditGrantModificationFile(GrantModificationFileResourcePrimaryKey grantModificationFileResourcePrimaryKey, EditFileResourceViewModel viewModel)
        {
            var fileResource = grantModificationFileResourcePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEditGrantModificationFile(viewModel));
            }

            viewModel.UpdateModel(fileResource);
            SetMessageForDisplay($"Successfully updated file \"{fileResource.DisplayName}\".");
            return(new ModalDialogFormJsonResult());
        }
        public ActionResult DeleteGrantModificationFile(GrantModificationFileResourcePrimaryKey grantModificationFileResourcePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var grantModificationFileResource = grantModificationFileResourcePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteGrantModificationFile(grantModificationFileResource, viewModel));
            }

            var message = $"{FieldDefinition.GrantModification.GetFieldDefinitionLabel()} file \"{grantModificationFileResource.DisplayName}\" created on '{grantModificationFileResource.FileResource.CreateDate}' by '{grantModificationFileResource.FileResource.CreatePerson.FullNameFirstLast}' successfully deleted.";

            grantModificationFileResource.DeleteFullAndChildless(HttpRequestStorage.DatabaseEntities);
            SetMessageForDisplay(message);
            return(new ModalDialogFormJsonResult());
        }
        public PartialViewResult DeleteGrantModificationFile(GrantModificationFileResourcePrimaryKey grantModificationFileResourcePrimaryKey)
        {
            var viewModel = new ConfirmDialogFormViewModel(grantModificationFileResourcePrimaryKey.PrimaryKeyValue);

            return(ViewDeleteGrantModificationFile(grantModificationFileResourcePrimaryKey.EntityObject, viewModel));
        }