public async Task <IActionResult> Edit(int id, [Bind("ID,BowlerID,Year,Average,Bigo")] YearAverage yearAverage) { if (id != yearAverage.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(yearAverage); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!YearAverageExists(yearAverage.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BowlerID"] = new SelectList(_context.Bowlers, "BowlerID", "BowlerID", yearAverage.BowlerID); return(View(yearAverage)); }
public async Task <IActionResult> Edit(int?Id, int[] inputScores) { var subGame = _context.SubGames.Include(s => s.Game).Where(s => s.ID == Id).SingleOrDefault(); bool inHandi = subGame.Game.bHandicap; if (Id == null) { return(NotFound()); } var teamMembers = await _context.TeamMembers .Include(t => t.Bowler) // .ThenInclude(b=>b.BowlerAverage) 핸디를 클라이언트 자바스트립트로 처리 .Include(t => t.Team) .Where(t => t.Team.SubGameID == Id) .OrderBy(t => t.Team.TeamOrder) .ThenBy(t => t.Sequence) .ToListAsync(); if (teamMembers == null) { return(NotFound()); } try { int i = 0; foreach (var item in teamMembers) { if (item.Score != inputScores[i]) { item.Score = inputScores[i]; //핸디 포함 점수 (클라이언트 자바스트립트에서 핸디계산을 하여 전송 함) _context.Update(item); } i++; } await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index), new { Id = subGame.GameID, game = subGame.Round })); } catch (DbUpdateException) { ModelState.AddModelError("", "TeamMember_Edit_Error"); } return(View(teamMembers)); }
public void Update(PlayerParty player) { _context.Update(player); }
public void Update(GameAccountability game) { _context.Update(game); _context.SaveChanges(); }