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

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArenaId"]      = new SelectList(_context.Arena, "Id", "ArenaName", pROGames2012.ArenaId);
            ViewData["TeamId1"]      = new SelectList(_context.Team, "Id", "TeamName", pROGames2012.TeamId1);
            ViewData["GameStatusId"] = new SelectList(_context.GameStatus, "Id", "GameStatusName", pROGames2012.GameStatusId);
            ViewData["TeamId"]       = new SelectList(_context.Team, "Id", "TeamName", pROGames2012.TeamId);
            ViewData["PersonId"]     = new SelectList(_context.Person, "Id", "FullName", pROGames2012.PersonId);
            ViewData["PersonId1"]    = new SelectList(_context.Person, "Id", "FullName", pROGames2012.PersonId1);
            ViewData["PersonId2"]    = new SelectList(_context.Person, "Id", "FullName", pROGames2012.PersonId2);
            ViewData["PersonId3"]    = new SelectList(_context.Person, "Id", "FullName", pROGames2012.PersonId3);
            ViewData["PersonId4"]    = new SelectList(_context.Person, "Id", "FullName", pROGames2012.PersonId4);
            ViewData["SeriesId"]     = new SelectList(_context.Series, "Id", "SeriesName", pROGames2012.SeriesId);
            return(View(pROGames2012));
        }
Exemplo n.º 2
0
        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")] PROGames2012 pROGames2012)
        {
            if (id != pROGames2012.Id)
            {
                return(NotFound());
            }

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