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