예제 #1
0
        public virtual ActionResult Index(GameCreateModel g)
        {
            ViewData["g"] = g;
            if (!ModelState.IsValid)
            {
                return(View(Games.All().WithDocuments()));
            }

            var x = g.CreateGame();

            try
            {
                Games.Save(x);
                return(this.RedirectToAction(c => c.Edit(x.Document.Id)));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return(View(Games.All().WithDocuments()));
            }
        }
예제 #2
0
        public virtual ActionResult Index(GameCreateModel g)
        {
			ViewData["g"] = g;
			if (!ModelState.IsValid)
			{
                return View(Games.All().WithDocuments());
			}
			
			var x = g.CreateGame();
            try
            {
				Games.Save(x);
                return this.RedirectToAction(c => c.Edit(x.Document.Id));
            }
            catch (Exception ex)
            {
				Notifier.Notify(ex);
                return View(Games.All().WithDocuments());
            }
        }