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