public ActionResult NewPage(PageModel model) { // Redirect if the user isn't logged in if (!IdentityModel.CurrentUserLoggedIn || !IdentityModel.CurrentUserOwner) { return RedirectToAction("Login", "Admin"); } model.NewPage(); return View(model); }
public ActionResult EditPage(String id, PageModel model) { // Redirect if the user isn't logged in if (!IdentityModel.CurrentUserLoggedIn || !IdentityModel.CurrentUserOwner) { return RedirectToAction("Login", "Admin"); } int x; if (!Int32.TryParse(id, out x)) return RedirectToAction("Login", "Admin"); model.SavePage(x); return View(model); }