public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Code,Address")] ROMTestModel rOMTestModel) { if (id != rOMTestModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rOMTestModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ROMTestModelExists(rOMTestModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rOMTestModel)); }
public async Task <IActionResult> Create([Bind("Id,Name,Code,Address")] ROMTestModel rOMTestModel) { if (ModelState.IsValid) { _context.Add(rOMTestModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rOMTestModel)); }