Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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());
        }