Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            theater theater = db.theaters.Find(id);

            db.theaters.Remove(theater);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "theater_id,theater_name,city,country")] theater theater)
 {
     if (ModelState.IsValid)
     {
         db.Entry(theater).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(theater));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "theater_id,theater_name,city,country")] theater theater)
        {
            if (ModelState.IsValid)
            {
                db.theaters.Add(theater);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(theater));
        }
Пример #4
0
        // GET: theaters/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            theater theater = db.theaters.Find(id);

            if (theater == null)
            {
                return(HttpNotFound());
            }
            return(View(theater));
        }