public ActionResult EditPage(int id) { var repo = PageRepoFactory.Create(); var page = repo.GetPage(id); return(View(page)); }
public ActionResult SavedPages() { var repo = PageRepoFactory.Create(); var model = repo.GetAllPages(); return(View(model)); }
public ActionResult DeletePage(int id) { var repo = PageRepoFactory.Create(); repo.RemovePage(id); return(RedirectToAction("SavedPages")); }
public ActionResult Page(int id) { Page model = new Page(); var repo = PageRepoFactory.Create(); model = repo.GetPage(id); return(View(model)); }
public ActionResult AddPage(Page p) { var repo = PageRepoFactory.Create(); if (ModelState.IsValid) { if (p.IsInNavigation) { p.IsFinished = true; } repo.AddPage(p); return(RedirectToAction("Index", "Home")); } else { return(View(p)); } }