Esempio n. 1
0
        public PartialViewResult EditGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey)
        {
            var fileResource = grantAllocationFileResourcePrimaryKey.EntityObject;
            var viewModel    = new EditFileResourceViewModel(fileResource);

            return(ViewEditGrantAllocationFile(viewModel));
        }
Esempio n. 2
0
        public ActionResult EditGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey, EditFileResourceViewModel viewModel)
        {
            var fileResource = grantAllocationFileResourcePrimaryKey.EntityObject;

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

            viewModel.UpdateModel(fileResource);
            SetMessageForDisplay($"Successfully updated file \"{fileResource.DisplayName}\".");
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 3
0
        public ActionResult DeleteGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var grantAllocationFileResource = grantAllocationFileResourcePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteGrantAllocationFile(grantAllocationFileResource, viewModel));
            }

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

            grantAllocationFileResource.DeleteFullAndChildless(HttpRequestStorage.DatabaseEntities);
            SetMessageForDisplay(message);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 4
0
        public PartialViewResult DeleteGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey)
        {
            var viewModel = new ConfirmDialogFormViewModel(grantAllocationFileResourcePrimaryKey.PrimaryKeyValue);

            return(ViewDeleteGrantAllocationFile(grantAllocationFileResourcePrimaryKey.EntityObject, viewModel));
        }