Ejemplo n.º 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()));
            }
        }
Ejemplo n.º 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());
            }
        }