public async Task <IActionResult> Create([Bind("Id,MatchNumber,MatchDateTime,ArenaId,TeamId,TeamId1,HomeTeamScore,AwayTeamScore,PersonId,PersonId1,PersonId2,PersonId3,PersonId4,SeriesId,TSMNumber,Payment,Payed,GameStatusId")] PROGames2018 pROGames2018)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pROGames2018);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArenaId"]      = new SelectList(_context.Arena, "Id", "Id", pROGames2018.ArenaId);
            ViewData["TeamId1"]      = new SelectList(_context.Team, "Id", "Id", pROGames2018.TeamId1);
            ViewData["GameStatusId"] = new SelectList(_context.GameStatus, "Id", "Id", pROGames2018.GameStatusId);
            ViewData["TeamId"]       = new SelectList(_context.Team, "Id", "Id", pROGames2018.TeamId);
            ViewData["PersonId"]     = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId);
            ViewData["PersonId1"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId1);
            ViewData["PersonId2"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId2);
            ViewData["PersonId3"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId3);
            ViewData["PersonId4"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId4);
            ViewData["SeriesId"]     = new SelectList(_context.Series, "Id", "Id", pROGames2018.SeriesId);
            return(View(pROGames2018));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,MatchNumber,MatchDateTime,ArenaId,TeamId,TeamId1,HomeTeamScore,AwayTeamScore,PersonId,PersonId1,PersonId2,PersonId3,PersonId4,SeriesId,TSMNumber,Payment,Payed,GameStatusId")] PROGames2018 pROGames2018)
        {
            if (id != pROGames2018.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pROGames2018);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PROGames2018Exists(pROGames2018.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArenaId"]      = new SelectList(_context.Arena, "Id", "Id", pROGames2018.ArenaId);
            ViewData["TeamId1"]      = new SelectList(_context.Team, "Id", "Id", pROGames2018.TeamId1);
            ViewData["GameStatusId"] = new SelectList(_context.GameStatus, "Id", "Id", pROGames2018.GameStatusId);
            ViewData["TeamId"]       = new SelectList(_context.Team, "Id", "Id", pROGames2018.TeamId);
            ViewData["PersonId"]     = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId);
            ViewData["PersonId1"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId1);
            ViewData["PersonId2"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId2);
            ViewData["PersonId3"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId3);
            ViewData["PersonId4"]    = new SelectList(_context.Person, "Id", "Id", pROGames2018.PersonId4);
            ViewData["SeriesId"]     = new SelectList(_context.Series, "Id", "Id", pROGames2018.SeriesId);
            return(View(pROGames2018));
        }