コード例 #1
0
ファイル: AdminController.cs プロジェクト: tristanvd/BetStar
        public IActionResult AddMatchResult()
        {
            AddMatchResultViewModel viewModel = new AddMatchResultViewModel();

            viewModel.Match = MatchLogic.GetOpenMatch();

            return(View(viewModel));
        }
コード例 #2
0
ファイル: AdminController.cs プロジェクト: tristanvd/BetStar
        public IActionResult AddMatchResultPost(AddMatchResultViewModel viewModel)
        {
            int    id                  = viewModel.Match.Id;
            string result              = viewModel.Result;
            int    homeTeamCorners     = viewModel.HomeTeamCorners;
            int    awayTeamCorners     = viewModel.AwayTeamCorners;
            int    homeTeamYellowCards = viewModel.HomeTeamYellowCards;
            int    awayTeamYellowCards = viewModel.AwayTeamYellowCards;
            int    homeTeamRedCards    = viewModel.HomeTeamRedCards;
            int    awayTeamRedCards    = viewModel.AwayTeamRedCards;
            bool   available           = viewModel.Available;

            MatchLogic.AddMatchResult(id, result, homeTeamCorners, awayTeamCorners, homeTeamYellowCards, awayTeamYellowCards, homeTeamRedCards, awayTeamRedCards, available);
            return(RedirectToAction("AddMatchResult"));
        }