コード例 #1
0
        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()));
            }
        }
コード例 #2
0
        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());
            }
        }