Exemplo n.º 1
0
        public bool InsertReservation(Models.Reservation r)
        {
            using (PersonServiceClient proxy = new PersonServiceClient())
            {
                Reservation res = new Reservation();
                res.ReservationId = r.ReservationId;
                res.MovieId       = r.MovieId;
                res.Date          = r.Date;
                res.CustomerId    = r.CustomerId;
                res.Seats         = new List <Seat>();

                foreach (Models.Seat s in r.Seats)
                {
                    Seat seat = new Seat();
                    seat.HallId = s.HallId;
                    seat.Number = s.Number;
                    seat.ResId  = s.ResId;
                    seat.Row    = s.Row;
                    seat.SeatId = s.SeatId;
                    res.Seats.Add(seat);
                }

                return(proxy.InsertReservation(res));
            }
        }