public async Task <IActionResult> Edit(int id, [Bind("HeldId,HeldName,HeldEigenschaft")] Held held) { if (id != held.HeldId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(held); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HeldExists(held.HeldId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(held)); }
public async Task <IActionResult> Edit(int id, [Bind("AgressorId,AgressorName,AgressorEigenschaft")] Agressor agressor) { if (id != agressor.AgressorId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(agressor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AgressorExists(agressor.AgressorId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(agressor)); }
public async Task <IActionResult> Edit(int id, [Bind("BedrohungId,HeldId,AgressorId,Bedrohungsbezeichnung")] Bedrohung bedrohung) { if (id != bedrohung.BedrohungId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bedrohung); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BedrohungExists(bedrohung.BedrohungId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AgressorId"] = new SelectList(_context.Agressors, "AgressorId", "AgressorEigenschaft", bedrohung.AgressorId); ViewData["HeldId"] = new SelectList(_context.Helds, "HeldId", "HeldEigenschaft", bedrohung.HeldId); return(View(bedrohung)); }