Пример #1
0
        public ActionResult Index()
        {
            Entities.Models.Game.CreateGame model = new Entities.Models.Game.CreateGame();

            model.AvailableDecks = _selectDeck.Execute(new Entities.Filters.Deck.Select {
            });

            model.AvailableDecks.RemoveAll(x => x.DeckID == 1);

            return(View("~/Views/CreateGame/CreateGame.cshtml", model));
        }
Пример #2
0
        public ActionResult Index(Entities.Models.Game.CreateGame model)
        {
            if (ModelState.IsValid)
            {
                model.Game.GameCreator_UserId = Authentication.Security.CurrentUserId;
                model.Game.GameDeckIDs.Add(1);

                _insertGame.Execute(model.Game);

                string key = string.Format("Game_{0}_Passphrase", model.Game.GameID);

                if (!string.IsNullOrWhiteSpace(model.Game.Passphrase))
                {
                    Session.Add(key, MachineKey.Protect(Encoding.ASCII.GetBytes(model.Game.Passphrase), Session.SessionID));
                }

                return(Redirect(Url.RouteUrl("Game_NoAction", new { id = model.Game.GameID })));
            }
            else
            {
                return(View("~/Views/CreateGame/CreateGame.cshtml", model));
            }
        }
Пример #3
0
        public ActionResult Index()
        {
            Entities.Models.Game.CreateGame model = new Entities.Models.Game.CreateGame();

            model.AvailableDecks = _selectDeck.Execute(new Entities.Filters.Deck.Select { });

            model.AvailableDecks.RemoveAll(x => x.DeckID == 1);

            return View("~/Views/CreateGame/CreateGame.cshtml", model);
        }