예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SeatType1 seatType1 = db.SeatType1.Find(id);

            db.SeatType1.Remove(seatType1);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,type,Persons,Price")] SeatType1 seatType1)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seatType1).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(seatType1));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "id,type,Persons,Price")] SeatType1 seatType1)
        {
            if (ModelState.IsValid)
            {
                db.SeatType1.Add(seatType1);
                db.SaveChanges();
                return(RedirectToAction("Welcome"));
            }

            return(View(seatType1));
        }
예제 #4
0
        // GET: SeatType1/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SeatType1 seatType1 = db.SeatType1.Find(id);

            if (seatType1 == null)
            {
                return(HttpNotFound());
            }
            return(View(seatType1));
        }
예제 #5
0
        public ActionResult Welcome(SeatType1 seat)
        {
            using (OnlineMovieTicketEntities31 db = new OnlineMovieTicketEntities31())
            {
                db.SeatType1.Add(seat);
                db.SaveChanges();

                int    SeatId  = seat.id;
                string Type    = seat.type;
                var    Tickets = seat.Persons;
                var    Price   = seat.Price;


                ViewBag.SeatId  = SeatId;
                ViewBag.Type    = Type;
                ViewBag.Tickets = Tickets;
                ViewBag.Price   = Price;
            }

            return(View());
        }