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)); }
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)); }
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)); }
public ActionResult ForgotPasswordConfirmation() { var homePage = _contentLoader.Get <PageData>(ContentReference.StartPage) as HomePage; var model = ContentViewModel.Create(homePage); return(View("ForgotPasswordConfirmation", model)); }
public async Task <ActionResult> Index(Cms.Pages.LandingPage currentPage) { await _trackingService.PageViewed(HttpContext, currentPage); var model = ContentViewModel.Create(currentPage); return(View(model)); }
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)); }
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)); }
public ActionResult Index(HomePage currentContent) => View(ContentViewModel.Create <HomePage>(currentContent));
public ActionResult Index(Models.CalendarEventPage currentPage) => View(ContentViewModel.Create(currentPage));
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))); }
public async Task <ActionResult> Index(DemoHomePage currentContent) { await _trackingService.PageViewed(HttpContext, currentContent); return(View(ContentViewModel.Create <DemoHomePage>(currentContent))); }