public ActionResult DeleteConfirmed(int id) { matiere matiere = db.matieres.Find(id); db.matieres.Remove(matiere); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_M,libelle")] matiere matiere) { if (ModelState.IsValid) { db.Entry(matiere).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(matiere)); }
public ActionResult Create([Bind(Include = "id_M,libelle")] matiere matiere) { if (ModelState.IsValid) { db.matieres.Add(matiere); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(matiere)); }
// GET: matieres/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } matiere matiere = db.matieres.Find(id); if (matiere == null) { return(HttpNotFound()); } return(View(matiere)); }