public ActionResult DeleteConfirmed(int id) { ConseillerClientele conseillerClientele = db.ConseillersClientele.Find(id); db.ConseillersClientele.Remove(conseillerClientele); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Mail,Password,Nom,Prenom,Adresse,Telephone,DateDeNaissance,Age,CivilityID")] ConseillerClientele conseillerClientele) { if (ModelState.IsValid) { db.Entry(conseillerClientele).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CivilityID = new SelectList(db.Civilites, "Id", "Label", conseillerClientele.CivilityID); return(View(conseillerClientele)); }
// GET: BackOfficeConseiller/ConseillerClienteles/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ConseillerClientele cc = db.ConseillersClientele.Include(X => X.Civilite).Where(x => x.Id == id).SingleOrDefault(); if (cc == null) { return(HttpNotFound()); } return(View(cc)); }
// GET: BackOfficeConseiller/ConseillerClienteles/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ConseillerClientele conseillerClientele = db.ConseillersClientele.Find(id); if (conseillerClientele == null) { return(HttpNotFound()); } return(View(conseillerClientele)); }
// GET: BackOfficeConseiller/ConseillerClienteles/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ConseillerClientele conseillerClientele = db.ConseillersClientele.Find(id); if (conseillerClientele == null) { return(HttpNotFound()); } ViewBag.CivilityID = new SelectList(db.Civilites, "Id", "Label", conseillerClientele.CivilityID); return(View(conseillerClientele)); }
public ActionResult Create([Bind(Include = "Id,Mail,Password,ConfirmedPassword,Nom,Prenom,Adresse,Telephone,DateDeNaissance,Age,CivilityID")] ConseillerClientele conseillerClientele) { if (ModelState.IsValid) { db.Configuration.ValidateOnSaveEnabled = false; conseillerClientele.Password = conseillerClientele.Password.HashMD5(); db.ConseillersClientele.Add(conseillerClientele); db.SaveChanges(); TempData["Message"] = $"Conseiller {conseillerClientele.Nom} enregistré"; return(RedirectToAction("Index")); } ViewBag.CivilityID = new SelectList(db.Civilites, "Id", "Label", conseillerClientele.CivilityID); return(View(conseillerClientele)); }