Пример #1
0
        public Guest AddGuestToRoom(ReservationRoom reservationRoom, string name, bool isChild,
                                    bool isNewlyweds, bool orderedBreakfest, decimal priceForStay)
        {
            ReservationValidators.ValidIfReservationRoomExistInReservation(this, reservationRoom);

            return(reservationRoom.AddGuest(name, isChild, isNewlyweds, orderedBreakfest, priceForStay));
        }
Пример #2
0
        public ReservationRoom UpdateRoom(ReservationRoom updatedReservationRoom)
        {
            ReservationValidators.ValidIfReservationRoomExistInReservation(this, updatedReservationRoom);

            var reservationRoom = ReservationRooms.FirstOrDefault(x => x.Id == updatedReservationRoom.Id);

            return(reservationRoom.Update(updatedReservationRoom));
        }
Пример #3
0
        public static Reservation Create(Customer customer, DateTime checkIn, DateTime checkOut)
        {
            if (customer == null)
            {
                throw new MissingValueException("Klient nie został określony.");
            }

            ReservationValidators.ValidDates(checkIn, checkOut);

            return(new Reservation
            {
                Customer = customer,
                CheckIn = checkIn,
                CheckOut = checkOut
            });
        }
Пример #4
0
        public void ChangeCheckOut(DateTime checkOut)
        {
            ReservationValidators.ValidDates(CheckIn, checkOut);

            CheckOut = checkOut;
        }
Пример #5
0
        public void ChangeCheckIn(DateTime checkIn)
        {
            ReservationValidators.ValidDates(checkIn, CheckOut);

            CheckIn = checkIn;
        }
Пример #6
0
        public void RemoveGuestFromRoom(ReservationRoom reservationRoom, Guest guest)
        {
            ReservationValidators.ValidIfReservationRoomExistInReservation(this, reservationRoom);

            reservationRoom.RemoveGuest(guest);
        }