public async Task <IActionResult> Edit(int id, [Bind("ItemTypeId,ItemType")] TblItemType tblItemType) { if (id != tblItemType.ItemTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblItemType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblItemTypeExists(tblItemType.ItemTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblItemType)); }
public async Task <IActionResult> Create([Bind("ItemTypeId,ItemType")] TblItemType tblItemType) { if (ModelState.IsValid) { _context.Add(tblItemType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblItemType)); }