public virtual ActionResult Index(PageCreateModel p) { ViewData["p"] = p; if (!ModelState.IsValid) { return(View(Pages.All().WithDocuments())); } var x = p.CreatePage(); try { Pages.Save(x); return(this.RedirectToAction(c => c.Edit(x.Document.Id))); } catch (Exception ex) { Notifier.Notify(ex); return(View(Pages.All().WithDocuments())); } }
public virtual ActionResult Index(PageCreateModel p) { ViewData["p"] = p; if (!ModelState.IsValid) { return View(Pages.All().WithDocuments()); } var x = p.CreatePage(); try { Pages.Save(x); return this.RedirectToAction(c => c.Edit(x.Document.Id)); } catch (Exception ex) { Notifier.Notify(ex); return View(Pages.All().WithDocuments()); } }