public ActionResult DeleteConfirmed(int id) { Classtype classtype = db.Classtypes.Find(id); db.Classtypes.Remove(classtype); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,Color,Image,Teacher")] Classtype classtype) { if (ModelState.IsValid) { db.Entry(classtype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(classtype)); }
public ActionResult Create([Bind(Include = "Id,Name,Description,Color,Image,Teacher")] Classtype classtype) { if (ModelState.IsValid) { db.Classtypes.Add(classtype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(classtype)); }
// GET: Classtypes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Classtype classtype = db.Classtypes.Find(id); if (classtype == null) { return(HttpNotFound()); } return(View(classtype)); }