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