예제 #1
0
        private static void CheckOut(Guest guest)
        {
            XmlBookingWriter      bookingWriter      = new XmlBookingWriter(BookingFile);
            XmlGuestWriter        guestWriter        = new XmlGuestWriter(GuestFile);
            XmlApartmentWriter    apartmentWriter    = new XmlApartmentWriter(ApartmentFile);
            XmlGuestHistoryWriter guestHistoryWriter = new XmlGuestHistoryWriter(GuestHistoryFile);

            XmlBookingReader bookingReader = new XmlBookingReader(BookingFile);

            var booking = bookingReader.GetBookings().Single(book => book.GuestId == guest.Id);

            booking.BookStatus = BookingStatus.CHECK_OUT;
            guestWriter.RemoveElement(guest);     //=>save to history
            bookingWriter.RemoveElement(booking); //=>save to history
            apartmentWriter.ChangeApartmentBooking(booking, false);
            guestHistoryWriter.Archive(guest, booking);
        }
예제 #2
0
        public static List <Booking> GetBookings()
        {
            XmlBookingReader bookingReader = new XmlBookingReader(BookingFile);

            return(bookingReader.GetBookings());
        }