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