Exemplo n.º 1
0
        public ActionResult SeatUpdate(int id)
        {
            List <Hall> halls = db.Halls.ToList();
            Seat        seat  = db.Seats.Where(x => x.Id == id).FirstOrDefault();

            SeatUpdateViewModel Update = new SeatUpdateViewModel()
            {
                Halls = halls,
                Seat  = seat
            };

            return(View(Update));
        }
Exemplo n.º 2
0
 public ActionResult SeatUpdate(Seat seat, int id)
 {
     if (seat.Row != null &&
         seat.Column != 0 &&
         seat.HallId != 0)
     {
         Seat seat1 = db.Seats.Where(x => x.Id == id).FirstOrDefault();
         seat1.HallId = seat.HallId;
         seat1.Row    = seat.Row;
         seat1.Column = seat.Column;
         db.SaveChanges();
         List <Hall>         halls  = db.Halls.ToList();
         Seat                seats  = db.Seats.Where(x => x.Id == id).FirstOrDefault();
         SeatUpdateViewModel Update = new SeatUpdateViewModel()
         {
             Halls = halls,
             Seat  = seats
         };
         return(RedirectToAction("AddSeat", "Seat"));
     }
     return(Content("Xanalari doldurun"));
 }