public async Task <IActionResult> Edit(int id, [Bind("Id,HomeTeam,AwayTeam,HomeOdds,DrawOdds,AwayOdds,StartTime,Stadium,HomeGoals,AwayGoals")] Match match) { if (id != match.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(match); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MatchExists(match.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(match)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,BetTime,BetMoney,WinMoney,Tip,MatchId,GamblerId")] Ticket ticket) { if (id != ticket.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ticket); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TicketExists(ticket.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GamblerId"] = new SelectList(_context.Gambler, "Id", "Id", ticket.GamblerId); ViewData["MatchId"] = new SelectList(_context.Set <Match>(), "Id", "Id", ticket.MatchId); return(View(ticket)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,FullName,Nationality,Earnings,ProfilePicture,CoverPhoto")] Gambler gambler) { if (id != gambler.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gambler); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GamblerExists(gambler.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gambler)); }