public async Task <IActionResult> Edit(int id, [Bind("Id,CompetencyNumber,CompetencyText,CompetencyDescription")] TblAnnualReviewCompetency tblAnnualReviewCompetency) { if (id != tblAnnualReviewCompetency.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblAnnualReviewCompetency); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblAnnualReviewCompetencyExists(tblAnnualReviewCompetency.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblAnnualReviewCompetency)); }
public async Task <IActionResult> Create([Bind("Id,CompetencyNumber,CompetencyText,CompetencyDescription")] TblAnnualReviewCompetency tblAnnualReviewCompetency) { if (ModelState.IsValid) { _context.Add(tblAnnualReviewCompetency); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblAnnualReviewCompetency)); }