public async Task <IActionResult> Create([Bind("FormationID,PersonneID,Titre,Duree,Date_Deb")] Formation formation) { if (ModelState.IsValid) { _context.Add(formation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(formation)); }
public async Task <IActionResult> Create([Bind("PersonneID,Nom,Prenom")] Personne personne) { if (ModelState.IsValid) { _context.Add(personne); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(personne)); }
public async Task <IActionResult> PutPersonne(long id, Personne personne1) { if (id != personne1.PersonneID) { return(BadRequest()); } _context.Entry(personne1).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }