Exemplo n.º 1
0
        private void saveReservation(Reservation reservation)
        {
            //using (var txScope = new TransactionScope())
            {
                var hotelRes = new libHotelReservations.Models.HotelReservation();
                hotelRes.DepartureDate = reservation.Hotel.DepartureDate;
                hotelRes.ArrivalDate = reservation.Hotel.ArrivalDate;
                hotelRes.HotelId = reservation.Hotel.HotelId;
                hotels.book(hotelRes);

                var flightRes = new libFlightReservations.Models.FlightReservation();
                flightRes.DepartureDate = reservation.Flight.DepartureDate;
                flightRes.ArrivalDate = reservation.Flight.ArrivalDate;
                flightRes.FlightId = reservation.Flight.FlightId;
                flights.book(flightRes);
            }
        }
Exemplo n.º 2
0
 public void book(FlightReservation flightRes)
 {
     db.FlightReservations.Add(flightRes);
     db.SaveChanges();
 }