Example #1
0
 public ActionResult Detail(int id) {
     var contentItem = _contentManager.Get(id, VersionOptions.Latest);
     PerspectiveViewModel model = new PerspectiveViewModel();
     model.Title = contentItem.As<TitlePart>().Title;
     model.Id = contentItem.As<TitlePart>().Id;
     return View(model);
 }
Example #2
0
 public ActionResult CreatePOST(PerspectiveViewModel model) {
     var contentItem = _contentManager.New("Menu");
     contentItem.As<TitlePart>().Title = model.Title;
     _contentManager.Create(contentItem, VersionOptions.Draft);
     _contentManager.Publish(contentItem);
     return Json(new {id = contentItem.Id});
 }
Example #3
0
 public ActionResult EditPOST(int id, PerspectiveViewModel model) {
     var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);
     contentItem.As<TitlePart>().Title = model.Title;
     _contentManager.Publish(contentItem);
     return new HttpStatusCodeResult(HttpStatusCode.OK);
 }
Example #4
0
 public ActionResult Create() {
     PerspectiveViewModel model = new PerspectiveViewModel();
     return View(model);
 }