private PartialViewResult ViewEditInDialog(EditPageContentViewModel viewModel, ProjectFirmaModels.Models.ClassificationSystem classificationSystem)
        {
            var ckEditorToolbar = CkEditorExtension.CkEditorToolbar.Minimal;
            var viewData        = new EditPageContentViewData(ckEditorToolbar);

            return(RazorPartialView <EditPageContent, EditPageContentViewData, EditPageContentViewModel>(viewData, viewModel));
        }
        public PartialViewResult EditInDialog(ClassificationSystemPrimaryKey classificationSystemPrimaryKey)
        {
            var classificationSystem = classificationSystemPrimaryKey.EntityObject;
            var viewModel            = new EditPageContentViewModel(classificationSystem);

            return(ViewEditInDialog(viewModel, classificationSystem));
        }
Ejemplo n.º 3
0
        public ActionResult SaveCMSPageContent(EditPageContentViewModel model)
        {
            var websitePageDb = _unitOfWork.WebsitePages.GetPageById(model.Id);

            websitePageDb.Content1 = model.Content1;
            websitePageDb.Content2 = model.Content2;
            websitePageDb.Content3 = model.Content3;

            _unitOfWork.Complete();

            return(RedirectToAction("ReturnCMSPageEdit", new { @url = websitePageDb.PageUrl }));
        }
Ejemplo n.º 4
0
        // GET: Editor/CMSEditor
        public ActionResult ReturnCMSPageEdit(string url)
        {
            if (String.IsNullOrEmpty(url))
            {
                string viewName = "Homepage";
                return(View(viewName));
            }

            if (String.IsNullOrEmpty(url))
            {
                string viewName = "Homepage";
                return(View(viewName));
            }
            else
            {
                var websitePageDB = _unitOfWork.WebsitePages.GetPageByUrl(url);
                if (websitePageDB == null)
                {
                    return(Redirect("/"));
                }
                var websitePageToRedirectTo = new EditPageContentViewModel()
                {
                    Id              = websitePageDB.Id,
                    Content1        = websitePageDB.Content1,
                    Content2        = websitePageDB.Content2,
                    Content3        = websitePageDB.Content3,
                    Content4        = websitePageDB.Content4,
                    Content5        = websitePageDB.Content5,
                    ImageToShow     = string.IsNullOrEmpty(websitePageDB.ImagePath) ? "Content/images/bioreg-page-bg.jpg" : websitePageDB.ImagePath + "/" + websitePageDB.ImageName,
                    MetaDescription = websitePageDB.MetaDescription,
                    PageTitle       = websitePageDB.PageTitle,
                    RelatedPages    = _unitOfWork.WebsitePages.GetRelatedPages(websitePageDB.Id, websitePageDB.ParentId).ToList()
                };

                string template = websitePageDB.Template;
                return(View(template, websitePageToRedirectTo));
            }
        }
        public ActionResult EditInDialog(ClassificationSystemPrimaryKey classificationSystemPrimaryKey, EditPageContentViewModel viewModel)
        {
            var classificationSystem = classificationSystemPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEditInDialog(viewModel, classificationSystem));
            }
            viewModel.UpdateModel(classificationSystem);
            return(new ModalDialogFormJsonResult());
        }