Example #1
0
        public void AddReservationToRoom(AddReservationToRoomDto addReservationToRoomDto)
        {
            var office      = officeRepository.GetOfficeById(addReservationToRoomDto.OfficeId);
            var room        = office.GetRoomByNumber(addReservationToRoomDto.RoomNumber);
            var reservation = new Reservation(addReservationToRoomDto.StartTime, addReservationToRoomDto.EndTime);

            if (reservationManager.CheckReservations(room, reservation))
            {
                room.AddReservation(reservation);
                officeRepository.AddReservationToRoom(addReservationToRoomDto.OfficeId, office.Rooms);
            }
        }