public PartialViewResult EditGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey) { var fileResource = grantAllocationFileResourcePrimaryKey.EntityObject; var viewModel = new EditFileResourceViewModel(fileResource); return(ViewEditGrantAllocationFile(viewModel)); }
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()); }
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()); }
public PartialViewResult DeleteGrantAllocationFile(GrantAllocationFileResourcePrimaryKey grantAllocationFileResourcePrimaryKey) { var viewModel = new ConfirmDialogFormViewModel(grantAllocationFileResourcePrimaryKey.PrimaryKeyValue); return(ViewDeleteGrantAllocationFile(grantAllocationFileResourcePrimaryKey.EntityObject, viewModel)); }