public ActionResult DeleteConfirmed(int id) { Centre_Interet centre_Interet = db.Centre_Interet.Find(id); db.Centre_Interet.Remove(centre_Interet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Interet,Id_Candiat")] Centre_Interet centre_Interet) { if (ModelState.IsValid) { db.Entry(centre_Interet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat); return(View(centre_Interet)); }
// GET: Centre_Interet/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Centre_Interet centre_Interet = db.Centre_Interet.Find(id); if (centre_Interet == null) { return(HttpNotFound()); } return(View(centre_Interet)); }
// GET: Centre_Interet/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Centre_Interet centre_Interet = db.Centre_Interet.Find(id); if (centre_Interet == null) { return(HttpNotFound()); } ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat); return(View(centre_Interet)); }
public ActionResult Create([Bind(Include = "Id,Interet,Id_Candiat")] Centre_Interet centre_Interet) { var id = Session["IdCandidat"]; if (ModelState.IsValid) { centre_Interet.Id_Candiat = int.Parse(id.ToString()); db.Centre_Interet.Add(centre_Interet); db.SaveChanges(); return(RedirectToAction("Create", "References")); } ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat); return(View(centre_Interet)); }