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