public async Task <IActionResult> RegisterGame(RegisterGameViewModel input) { if (!this.ModelState.IsValid) { return(this.View(input)); } await this.gamesService.RegisterGame(input.MyTeamId, input.OpponentId, input.MyPoints, input.OpponentPoints, input.Date); return(this.Redirect("/")); }
public IActionResult RegisterGame() { var userId = this.userManager.GetUserId(this.User); DateTime now = DateTime.UtcNow; var viewModel = new RegisterGameViewModel(); var teams = this.teamService.GetMyTeamsById <MyTeamViewModel>(userId); var opponents = this.teamService.GetOpponentsById <MyTeamViewModel>(userId); viewModel.Teams = teams; viewModel.Opponents = opponents; viewModel.DateNow = now; return(this.View(viewModel)); }
public RegisterGamePage(RegisterGameViewModel vm) { InitializeComponent(); BindingContext = _vm = vm; }