public ActionResult DeleteConfirmed(int id) { show show = db.shows.Find(id); db.shows.Remove(show); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "show_id,movie_id,theater_id,date,timing,price")] show show) { if (ModelState.IsValid) { db.Entry(show).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.movie_id = new SelectList(db.movies, "movie_id", "movie_name", show.movie_id); ViewBag.theater_id = new SelectList(db.theaters, "theater_id", "theater_name", show.theater_id); return(View(show)); }
// GET: shows/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } show show = db.shows.Find(id); if (show == null) { return(HttpNotFound()); } return(View(show)); }
// GET: shows/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } show show = db.shows.Find(id); if (show == null) { return(HttpNotFound()); } ViewBag.movie_id = new SelectList(db.movies, "movie_id", "movie_name", show.movie_id); ViewBag.theater_id = new SelectList(db.theaters, "theater_id", "theater_name", show.theater_id); return(View(show)); }