public async Task <IActionResult> Edit(int id, [Bind("Id,RefereeFeeName,RefereeFeeCategory,RefereeFeeValue")] RefereeFee refereeFee) { if (id != refereeFee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(refereeFee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RefereeFeeExists(refereeFee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(refereeFee)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,SeriesId,MatchLengthId,RefereeTypeId,FeeValue")] RefereeFee refereeFee) { if (id != refereeFee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(refereeFee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RefereeFeeExists(refereeFee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MatchLengthId"] = new SelectList(_context.MatchLength, "Id", "MatchLengthName", refereeFee.MatchLengthId); ViewData["RefereeTypeId"] = new SelectList(_context.RefereeType, "Id", "RefereeTypeName", refereeFee.RefereeTypeId); ViewData["SeriesId"] = new SelectList(_context.Series, "Id", "SeriesName", refereeFee.SeriesId); return(View(refereeFee)); }
public async Task <IActionResult> Create([Bind("Id,RefereeFeeName,RefereeFeeCategory,RefereeFeeValue")] RefereeFee refereeFee) { if (ModelState.IsValid) { _context.Add(refereeFee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(refereeFee)); }
public async Task <IActionResult> Create([Bind("Id,SeriesId,MatchLengthId,RefereeTypeId,FeeValue")] RefereeFee refereeFee) { if (ModelState.IsValid) { _context.Add(refereeFee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MatchLengthId"] = new SelectList(_context.MatchLength, "Id", "MatchLengthName", refereeFee.MatchLengthId); ViewData["RefereeTypeId"] = new SelectList(_context.RefereeType, "Id", "RefereeTypeName", refereeFee.RefereeTypeId); ViewData["SeriesId"] = new SelectList(_context.Series, "Id", "SeriesName", refereeFee.SeriesId); return(View(refereeFee)); }