public async Task <ActionResult> Edit([Bind(Include = "Id,Numero,Rue,CodePostal,Ville")] Adresse adresse) { if (ModelState.IsValid) { db.Entry(adresse).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(adresse)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Horaire,EstDispo")] Planning planning) { if (ModelState.IsValid) { db.Entry(planning).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(planning)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Libelle")] Models.Type type) { if (ModelState.IsValid) { db.Entry(type).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(type)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Montant,Libelle,DatePaiement,PaiementAJour")] Paiement paiement) { if (ModelState.IsValid) { db.Entry(paiement).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(paiement)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,DateResa,Remarque,IdUser,IdEvenement")] InscriptionUserEvenement inscriptionUserEvenement) { if (ModelState.IsValid) { db.Entry(inscriptionUserEvenement).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("GetCurrentUserResa")); } ViewBag.IdEvenement = new SelectList(db.Evenement, "Id", "Libelle", inscriptionUserEvenement.IdEvenement); ViewBag.IdUser = new SelectList(db.Users, "Id", "Nom", inscriptionUserEvenement.IdUser); return(View(inscriptionUserEvenement)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Nom,Prenom,DateNaissance,Genre,Mail,Telephone,Photo ,DateAdhesion,IdTrancheAge,IdRole,IdAdresse")] Users users) { //Paramètre retiré : ,DateAdhesion,IdTrancheAge,IdRole,IdAdresse if (ModelState.IsValid) { db.Entry(users).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("GetCurrentUser")); } ViewBag.IdAdresse = new SelectList(db.Adresse, "Id", "Rue", users.IdAdresse); ViewBag.IdRole = new SelectList(db.Role, "Id", "Type", users.IdRole); ViewBag.IdTrancheAge = new SelectList(db.TrancheAge, "Id", "Libelle", users.IdTrancheAge); return(View(users)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Libelle,Description,Image,DateDebut,DateFin,Duree,DateLimiteInscription,IdType,IdTrancheAge,IdAdresse")] Evenement evenement) { if (ModelState.IsValid) { //image par défaut pour la modification des événements if (evenement.Image == null) { string eventImg = ConfigurationManager.AppSettings["eventImg"]; evenement.Image = eventImg; } db.Entry(evenement).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.IdAdresse = new SelectList(db.Adresse, "Id", "Rue", evenement.IdAdresse); ViewBag.IdTrancheAge = new SelectList(db.TrancheAge, "Id", "Libelle", evenement.IdTrancheAge); ViewBag.IdType = new SelectList(db.Type, "Id", "Libelle", evenement.IdType); return(View(evenement)); }