public async Task <IActionResult> Create([Bind("Id,PZGameName,GameCategoryId,GameStatusId,GameTypeId,ZoneGameId,ZoneGameId1,ZoneGameId2,ZoneGameId3,ZoneGameId4,ZoneGameId5,ZoneGameId6,ZoneGameId7,ZoneGameId8,ZoneGameId9,ZoneGameId10,ZoneGameId11,ClubId,ArenaId")] PZGame pZGame) { if (ModelState.IsValid) { _context.Add(pZGame); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ArenaId"] = new SelectList(_context.Arena, "Id", "Id", pZGame.ArenaId); ViewData["GameCategoryId"] = new SelectList(_context.GameCategory, "Id", "Id", pZGame.GameCategoryId); ViewData["GameStatusId"] = new SelectList(_context.GameStatus, "Id", "Id", pZGame.GameStatusId); ViewData["GameTypeId"] = new SelectList(_context.GameType, "Id", "Id", pZGame.GameTypeId); ViewData["ClubId"] = new SelectList(_context.Club, "Id", "Id", pZGame.ClubId); ViewData["ZoneGameId"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId); ViewData["ZoneGameId9"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId9); ViewData["ZoneGameId10"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId10); ViewData["ZoneGameId11"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId11); ViewData["ZoneGameId1"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId1); ViewData["ZoneGameId2"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId2); ViewData["ZoneGameId3"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId3); ViewData["ZoneGameId4"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId4); ViewData["ZoneGameId5"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId5); ViewData["ZoneGameId6"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId6); ViewData["ZoneGameId7"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId7); ViewData["ZoneGameId8"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId8); return(View(pZGame)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PZGameName,GameCategoryId,GameStatusId,GameTypeId,ZoneGameId,ZoneGameId1,ZoneGameId2,ZoneGameId3,ZoneGameId4,ZoneGameId5,ZoneGameId6,ZoneGameId7,ZoneGameId8,ZoneGameId9,ZoneGameId10,ZoneGameId11,ClubId,ArenaId")] PZGame pZGame) { if (id != pZGame.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pZGame); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PZGameExists(pZGame.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ArenaId"] = new SelectList(_context.Arena, "Id", "Id", pZGame.ArenaId); ViewData["GameCategoryId"] = new SelectList(_context.GameCategory, "Id", "Id", pZGame.GameCategoryId); ViewData["GameStatusId"] = new SelectList(_context.GameStatus, "Id", "Id", pZGame.GameStatusId); ViewData["GameTypeId"] = new SelectList(_context.GameType, "Id", "Id", pZGame.GameTypeId); ViewData["ClubId"] = new SelectList(_context.Club, "Id", "Id", pZGame.ClubId); ViewData["ZoneGameId"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId); ViewData["ZoneGameId9"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId9); ViewData["ZoneGameId10"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId10); ViewData["ZoneGameId11"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId11); ViewData["ZoneGameId1"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId1); ViewData["ZoneGameId2"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId2); ViewData["ZoneGameId3"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId3); ViewData["ZoneGameId4"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId4); ViewData["ZoneGameId5"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId5); ViewData["ZoneGameId6"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId6); ViewData["ZoneGameId7"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId7); ViewData["ZoneGameId8"] = new SelectList(_context.ZoneGame, "Id", "Id", pZGame.ZoneGameId8); return(View(pZGame)); }