示例#1
0
        public ActionResult Properties(string tabId, int parentId, int id, string backendActionCode, FormCollection collection)
        {
            var content    = ContentService.ReadForUpdate(id);
            var model      = ContentViewModel.Create(content, tabId, parentId);
            var oldGroupId = model.Data.GroupId;

            TryUpdateModel(model);
            model.Validate(ModelState);
            if (ModelState.IsValid)
            {
                try
                {
                    model.Data = ContentService.Update(model.Data);
                }
                catch (VirtualContentProcessingException vcpe)
                {
                    if (HttpContext.IsXmlDbUpdateReplayAction())
                    {
                        throw;
                    }

                    ModelState.AddModelError("VirtualContentProcessingException", vcpe.Message);
                    return(JsonHtml("Properties", model));
                }

                return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = backendActionCode, groupChanged = oldGroupId != model.Data.GroupId }));
            }

            return(JsonHtml("Properties", model));
        }
示例#2
0
        public ActionResult New(string tabId, int parentId, int?groupId)
        {
            var content = ContentService.New(parentId, groupId);
            var model   = ContentViewModel.Create(content, tabId, parentId);

            return(JsonHtml("Properties", model));
        }
示例#3
0
        public ActionResult New(string tabId, int parentId, string backendActionCode, FormCollection collection)
        {
            var content = ContentService.New(parentId, null);
            var model   = ContentViewModel.Create(content, tabId, parentId);

            TryUpdateModel(model);
            model.Validate(ModelState);
            if (ModelState.IsValid)
            {
                try
                {
                    model.Data = ContentService.Save(model.Data);
                    PersistResultId(model.Data.Id);
                    PersistFieldIds(model.Data.GetFieldIds());
                    PersistLinkIds(model.Data.GetLinkIds());
                }
                catch (VirtualContentProcessingException vcpe)
                {
                    if (HttpContext.IsXmlDbUpdateReplayAction())
                    {
                        throw;
                    }

                    ModelState.AddModelError("VirtualContentProcessingException", vcpe.Message);
                    return(JsonHtml("Properties", model));
                }

                return(Redirect("Properties", new { tabId, parentId, id = model.Data.Id, successfulActionCode = backendActionCode }));
            }

            return(JsonHtml("Properties", model));
        }
示例#4
0
        public ActionResult ForgotPasswordConfirmation()
        {
            var homePage = _contentLoader.Get <PageData>(ContentReference.StartPage) as HomePage;
            var model    = ContentViewModel.Create(homePage);

            return(View("ForgotPasswordConfirmation", model));
        }
示例#5
0
        public async Task <ActionResult> Index(Cms.Pages.LandingPage currentPage)
        {
            await _trackingService.PageViewed(HttpContext, currentPage);

            var model = ContentViewModel.Create(currentPage);

            return(View(model));
        }
示例#6
0
        public ActionResult Properties(string tabId, int parentId, int id, string successfulActionCode, bool?groupChanged = null)
        {
            var content = ContentService.Read(id);
            var model   = ContentViewModel.Create(content, tabId, parentId);

            model.GroupChanged        = groupChanged ?? false;
            model.SuccesfulActionCode = successfulActionCode;
            return(JsonHtml("Properties", model));
        }
        public ActionResult Index(LandingPage currentPage)
        {
            var model = ContentViewModel.Create(currentPage);

            return(View(model));
        }
示例#8
0
 public ActionResult Index(DemoHomePage currentContent)
 {
     return(View(ContentViewModel.Create <DemoHomePage>(currentContent)));
 }
        public ActionResult Index(Cms.Pages.ThreeColumnLandingPage currentPage)
        {
            var model = ContentViewModel.Create(currentPage);

            return(View(model));
        }
示例#10
0
 public ActionResult Index(HomePage currentContent) => View(ContentViewModel.Create <HomePage>(currentContent));
 public ActionResult Index(Models.CalendarEventPage currentPage) => View(ContentViewModel.Create(currentPage));
示例#12
0
        public async Task <ActionResult> Index(CalendarEventPage currentPage)
        {
            await _trackingService.PageViewed(HttpContext, currentPage);

            return(View(ContentViewModel.Create(currentPage)));
        }
 public ActionResult Index(CollectionPage currentPage)
 {
     return(View(ContentViewModel.Create(currentPage)));
 }
 public ActionResult Index(TestPage currentContent)
 {
     return(View(ContentViewModel.Create <TestPage>(currentContent)));
 }
示例#15
0
        public async Task <ActionResult> Index(DemoHomePage currentContent)
        {
            await _trackingService.PageViewed(HttpContext, currentContent);

            return(View(ContentViewModel.Create <DemoHomePage>(currentContent)));
        }