public PartialViewResult EditInteractionEventFile(InteractionEventFileResourcePrimaryKey interactionEventFileResourcePrimaryKey)
        {
            var fileResource = interactionEventFileResourcePrimaryKey.EntityObject;
            var viewModel    = new EditFileResourceViewModel(fileResource);

            return(ViewEditInteractionFile(viewModel));
        }
        public ActionResult EditInteractionEventFile(InteractionEventFileResourcePrimaryKey interactionEventFileResourcePrimaryKey, EditFileResourceViewModel viewModel)
        {
            var fileResource = interactionEventFileResourcePrimaryKey.EntityObject;

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

            viewModel.UpdateModel(fileResource);
            SetMessageForDisplay($"Successfully updated file \"{fileResource.DisplayName}\".");
            return(new ModalDialogFormJsonResult());
        }
        public ActionResult DeleteInteractionEventFile(InteractionEventFileResourcePrimaryKey interactionEventFileResourcePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var interactionEventFileResource = interactionEventFileResourcePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteInteractionEventFile(interactionEventFileResource, viewModel));
            }

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

            interactionEventFileResource.DeleteFullAndChildless(HttpRequestStorage.DatabaseEntities);
            SetMessageForDisplay(message);
            return(new ModalDialogFormJsonResult());
        }
        public PartialViewResult DeleteInteractionEventFile(InteractionEventFileResourcePrimaryKey interactionEventFileResourcePrimaryKey)
        {
            var viewModel = new ConfirmDialogFormViewModel(interactionEventFileResourcePrimaryKey.PrimaryKeyValue);

            return(ViewDeleteInteractionEventFile(interactionEventFileResourcePrimaryKey.EntityObject, viewModel));
        }