Esempio n. 1
0
        public PartialViewResult Edit(CustomPagePrimaryKey customPagePrimaryKey)
        {
            var customPage = customPagePrimaryKey.EntityObject;
            var viewModel  = new EditViewModel(customPage);

            return(ViewEdit(viewModel));
        }
Esempio n. 2
0
        public PartialViewResult DeleteCustomPage(CustomPagePrimaryKey customPagePrimaryKey)
        {
            var customPage = customPagePrimaryKey.EntityObject;
            var viewModel  = new ConfirmDialogFormViewModel(customPage.CustomPageID);

            return(ViewDeleteCustomPage(customPage, viewModel));
        }
Esempio n. 3
0
        public PartialViewResult EditInDialog(CustomPagePrimaryKey customPagePrimaryKey)
        {
            var customPage = customPagePrimaryKey.EntityObject;
            var viewModel  = new EditHtmlContentInDialogViewModel(customPage);

            return(ViewEditInDialog(viewModel, customPage));
        }
Esempio n. 4
0
        public ContentResult CkEditorUploadFileResourceForCustomPage(CustomPagePrimaryKey customPagePrimaryKey, CkEditorImageUploadViewModel viewModel)
        {
            var fileResourceInfo = FileResourceModelExtensions.CreateNewFromHttpPostedFileAndSave(viewModel.upload, CurrentFirmaSession);
            var customPage       = customPagePrimaryKey.EntityObject;
            var ppImage          = new CustomPageImage(customPage, fileResourceInfo);

            HttpRequestStorage.DatabaseEntities.AllCustomPageImages.Add(ppImage);
            return(Content(viewModel.GetCkEditorJavascriptContentToReturn(fileResourceInfo)));
        }
Esempio n. 5
0
        public ActionResult EditInDialog(CustomPagePrimaryKey customPagePrimaryKey, EditHtmlContentInDialogViewModel viewModel)
        {
            var customPage = customPagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEditInDialog(viewModel, customPage));
            }
            viewModel.UpdateModel(customPage, HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }
        public ActionResult Edit(CustomPagePrimaryKey customPagePrimaryKey, EditViewModel viewModel)
        {
            var customPage = customPagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }
            viewModel.UpdateModel(customPage, CurrentPerson);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 7
0
        public ActionResult DeleteCustomPage(CustomPagePrimaryKey customPagePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var customPage = customPagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteCustomPage(customPage, viewModel));
            }
            SetMessageForDisplay($"Custom Page '{customPage.CustomPageDisplayName}' successfully removed.");

            customPage.DeleteFull(HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 8
0
        public PartialViewResult CustomPageDetails(CustomPagePrimaryKey customPagePrimaryKey)
        {
            var customPage = customPagePrimaryKey.EntityObject;
            var customPageContentHtmlString = customPage.CustomPageContentHtmlString;

            if (!customPage.HasPageContent())
            {
                customPageContentHtmlString = new HtmlString(string.Format("No page content for Page \"{0}\".", customPage.CustomPageDisplayName));
            }
            var viewData = new CustomPageDetailsViewData(customPageContentHtmlString);

            return(RazorPartialView <CustomPageDetails, CustomPageDetailsViewData>(viewData));
        }
Esempio n. 9
0
        public ActionResult Edit(CustomPagePrimaryKey customPagePrimaryKey, EditViewModel viewModel)
        {
            var customPage = customPagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(viewModel));
            }
            HttpRequestStorage.DatabaseEntities.CustomPageRoles.Load();
            var customPageRoles = HttpRequestStorage.DatabaseEntities.AllCustomPageRoles.Local;

            viewModel.UpdateModel(customPage, CurrentFirmaSession, customPageRoles);
            return(new ModalDialogFormJsonResult());
        }
Esempio n. 10
0
 public ContentResult CkEditorUploadFileResourceForCustomPage(CustomPagePrimaryKey customPagePrimaryKey)
 {
     return(Content(String.Empty));
 }