public async Task <IActionResult> Edit(int id, [Bind("GlobalScoreEntryId,DateCreated,DateModified,GlobalScoreType,TimeFrameTotal,WeekEnding")] GlobalScoreEntry globalScoreEntry) { if (id != globalScoreEntry.GlobalScoreEntryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(globalScoreEntry); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GlobalScoreEntryExists(globalScoreEntry.GlobalScoreEntryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(globalScoreEntry)); }
public async Task <IActionResult> Create([Bind("GlobalScoreEntryId,DateCreated,DateModified,GlobalScoreType,TimeFrameTotal,WeekEnding")] GlobalScoreEntry globalScoreEntry) { if (ModelState.IsValid) { _context.Add(globalScoreEntry); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(globalScoreEntry)); }