public IActionResult AddMatchResult() { AddMatchResultViewModel viewModel = new AddMatchResultViewModel(); viewModel.Match = MatchLogic.GetOpenMatch(); return(View(viewModel)); }
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")); }