public async Task <IActionResult> Create([Bind("Id,nom,prenom,dateNaissance,sexe,role")] Personne personne) { if (ModelState.IsValid) { _context.Add(personne); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(personne)); }
public async Task <IActionResult> Create([Bind("Id,Marque,NumLot,DateInjection,DateRappel,TypeVaccin")] Injections injections) { if (ModelState.IsValid) { _context.Add(injections); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(injections)); }
public async Task <IActionResult> Create([Bind("Id,Nom,Prenom,Sexe,DateNaissance,TypePersonne")] Personnes personnes) { if (ModelState.IsValid) { _context.Add(personnes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(personnes)); }
public async Task <IActionResult> Create([Bind("Id,Libelle,Description")] Categorie categorie) { if (ModelState.IsValid) { _context.Add(categorie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(categorie)); }
public async Task <IActionResult> Create([Bind("Id,dateInjection,dateRappel,numLot,marque")] Injection injection) { if (ModelState.IsValid) { _context.Add(injection); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(injection)); }
public async Task <IActionResult> Create([Bind("Id,Nom")] Vaccin vaccin) { if (ModelState.IsValid) { _context.Add(vaccin); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vaccin)); }
public async Task <IActionResult> Create([Bind("InjectionsId,PersonnesId")] InjectionsPersonnes injectionsPersonnes) { if (ModelState.IsValid) { _context.Add(injectionsPersonnes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["InjectionsId"] = new SelectList(_context.Injections, "Id", "Id", injectionsPersonnes.InjectionsId); ViewData["PersonnesId"] = new SelectList(_context.Personnes, "Id", "Id", injectionsPersonnes.PersonnesId); return(View(injectionsPersonnes)); }
public async Task <IActionResult> Create([Bind("VetementId,Nom")] Vetement vetement) { if (ModelState.IsValid) { vetement.ProprietaireId = UserManager.GetUserId(User); // requires using ContactManager.Authorization; var isAuthorized = await AuthorizationService.AuthorizeAsync( User, vetement, VetementOperations.Create); if (!isAuthorized.Succeeded) { return(Forbid()); } Contexte.Add(vetement); await Contexte.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vetement)); }