public async Task <IActionResult> Edit(int id, [Bind("LevelId,LevelName,ActiveFlag")] TblLevel tblLevel) { if (id != tblLevel.LevelId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblLevel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblLevelExists(tblLevel.LevelId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblLevel)); }
public async Task <IActionResult> Create([Bind("LevelId,LevelName,ActiveFlag")] TblLevel tblLevel) { if (ModelState.IsValid) { _context.Add(tblLevel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblLevel)); }