public async Task <IActionResult> Edit(int id, [Bind("Id,GameDateTime,WeekDay,GameNumber,Round,HomeTeam,AwayTeam,Arena,Series,HD1,HD2,LD1,LD2,Supervisor,DateChanged,ChangedBy,TSMGameStatusId")] TSMGame tSMGame) { if (id != tSMGame.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tSMGame); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TSMGameExists(tSMGame.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(ListTSMGames))); } ViewData["TSMGameStatusId"] = new SelectList(_context.TSMGameStatus, "Id", "TSMGameStatusName", tSMGame.TSMGameStatusId); return(View(tSMGame)); }
public async Task <IActionResult> Create([Bind("Id,GameDateTime,WeekDay,GameNumber,Round,HomeTeam,AwayTeam,Arena,Series,HD1,HD2,LD1,LD2,Supervisor,DateChanged,ChangedBy,TSMGameStatusId")] TSMGame tSMGame) { if (ModelState.IsValid) { _context.Add(tSMGame); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(ListTSMGames))); } ViewData["TSMGameStatusId"] = new SelectList(_context.TSMGameStatus, "Id", "TSMGameStatusName", tSMGame.TSMGameStatusId); return(View(tSMGame)); }
public async Task <IActionResult> EditTSMGame(int id, [Bind("Id,DateTimePosted,DateTimeChanged,GameDateTime,TSMNumber,ArenaId,ClubId,ClubId1,HomeTeamScore,AwayTeamScore,RefereeId,RefereeId1,RefereeId2,RefereeId3,TSMSeriesId")] TSMGame tSMGame) { if (id != tSMGame.Id) { return(NotFound()); } if (ModelState.IsValid) { try { var pROLabContext = _context.TSMGames .Include(t => t.Arena) .Include(t => t.AwayTeam) .Include(t => t.HD1) .Include(t => t.HD2) .Include(t => t.HomeTeam) .Include(t => t.LD1) .Include(t => t.LD2) .Include(t => t.TSMSeries); _context.Update(tSMGame); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TSMGameExists(tSMGame.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ArenaId"] = new SelectList(_context.Arena, "Id", "ArenaName"); ViewData["ClubId1"] = new SelectList(_context.Club, "Id", "ClubName"); ViewData["RefereeId"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["RefereeId1"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["ClubId"] = new SelectList(_context.Club, "Id", "ClubName"); ViewData["RefereeId2"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["RefereeId3"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["TSMSeriesId"] = new SelectList(_context.Set <TSMSeries>(), "Id", "TSMSeriesName"); return(View()); }
public async Task <IActionResult> Create([Bind("Id,DateTimePosted,DateTimeChanged,GameDateTime,TSMNumber,ArenaId,ClubId,ClubId1,HomeTeamScore,AwayTeamScore,RefereeId,RefereeId1,RefereeId2,RefereeId3,TSMSeriesId")] TSMGame tSMGame) { if (ModelState.IsValid) { _context.Add(tSMGame); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ArenaId"] = new SelectList(_context.Arena, "Id", "ArenaName"); ViewData["ClubId1"] = new SelectList(_context.Club, "Id", "ClubName"); ViewData["RefereeId"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["RefereeId1"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["ClubId"] = new SelectList(_context.Club, "Id", "ClubName"); ViewData["RefereeId2"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["RefereeId3"] = new SelectList(_context.Referee, "Id", "FullName"); ViewData["TSMSeriesId"] = new SelectList(_context.Set <TSMSeries>(), "Id", "TSMSeriesName"); return(View()); }