public async Task <IActionResult> Edit(long id, [Bind("PersonneID,Nom,Prenom")] Personne personne) { if (id != personne.PersonneID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(personne); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonneExists(personne.PersonneID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(personne)); }
public async Task <IActionResult> EditEdit(long id, [Bind("FormationID,PersonneID,Titre,Duree,Date_Deb")] Formation formation) { if (id != formation.FormationID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(formation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormationExists(formation.PersonneID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(formation)); }