コード例 #1
0
        //[Authorize(Roles = "Admin")]
        public ActionResult Start(List <RoundAndWinner> model)
        {
            if (ModelState.IsValid)
            {
                var history = new List <History>(model.Count);
                foreach (var item in model)
                {
                    history.Add(new History()
                    {
                        Round   = item.Round,
                        Winners = item.Winners
                    });
                }

                var result = Unit.AdminSrvc.InitGameHistory(history);
                if (result != -1)
                {
                    Unit.PokerBetSrvc.ChangeGameState(result);
                    MvcApplication.DoGeneralActions(0);
                    MvcApplication.timer.Start();
                    return(Redirect("/"));
                }
            }
            return(View(model));
        }