Ejemplo n.º 1
0
        public static void AddGuest(Guest guest)
        {
            XmlGuestWriter writer = new XmlGuestWriter(GuestFile);

            writer.AppendElement(guest);
            CheckIn(guest);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static void RemoveGuest(Guest guest)
        {
            XmlGuestWriter writer = new XmlGuestWriter(GuestFile);

            CheckOut(guest);
        }