示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            theatre theatre = db.theatres.Find(id);

            db.theatres.Remove(theatre);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Th_Id,Th_name,Th_loc,dist,movieMv_Id")] theatre theatre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(theatre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.movieMv_Id = new SelectList(db.movies, "Mv_Id", "Mv_Name", theatre.movieMv_Id);
     return(View(theatre));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Th_Id,Th_name,Th_loc,dist,movieMv_Id")] theatre theatre)
        {
            if (ModelState.IsValid)
            {
                db.theatres.Add(theatre);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.movieMv_Id = new SelectList(db.movies, "Mv_Id", "Mv_Name", theatre.movieMv_Id);
            return(View(theatre));
        }
示例#4
0
        // GET: theatres/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            theatre theatre = db.theatres.Find(id);

            if (theatre == null)
            {
                return(HttpNotFound());
            }
            return(View(theatre));
        }
示例#5
0
        // GET: theatres/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            theatre theatre = db.theatres.Find(id);

            if (theatre == null)
            {
                return(HttpNotFound());
            }
            ViewBag.movieMv_Id = new SelectList(db.movies, "Mv_Id", "Mv_Name", theatre.movieMv_Id);
            return(View(theatre));
        }