Ejemplo n.º 1
0
 private int CheckRoomAvailibility(DateTime dateAndTimeOfTransfer, int roomId)
 {
     if (_examinationRepository.GetExaminationsByRoomAndDateTime(roomId, dateAndTimeOfTransfer).Count > 0 ||
         _equipmentTransferRepository.GetEquipmentTransferByRoomNumberAndDate(roomId, dateAndTimeOfTransfer) != null)
     {
         return(roomId);
     }
     return(-1);
 }
Ejemplo n.º 2
0
 private bool CheckRoomAvailibility(DateTime dateAndTimeOfTransfer, int roomId)
 {
     if (_examinationRepository.GetExaminationsByRoomAndDateTime(roomId, dateAndTimeOfTransfer).Count > 0 ||
         _equipmentTransferRepository.GetEquipmentTransferByRoomNumberAndDate(roomId, dateAndTimeOfTransfer) != null ||
         _renovationRepository.GetAllRenovationsByRoomAndDate(roomId, dateAndTimeOfTransfer).Count > 0)
     {
         return(false);
     }
     return(true);
 }
        private bool IsRoomAvailable(int roomId, DateTime dateTime)
        {
            if (!_roomService.CheckIfRoomExists(roomId))
            {
                throw new BadRequestException("Room doesn't exist in database.");
            }

            if (_examinationRepository.GetExaminationsByRoomAndDateTime(roomId, dateTime).Count > 0)
            {
                return(false);
            }

            if (_equipmentTransferRepository.GetEquipmentTransferByRoomNumberAndDate(roomId, dateTime) != null)
            {
                return(false);
            }

            return(true);
        }
 public EquipmentTransfer GetEquipmentTransferByRoomNumberAndDate(int roomNumber, DateTime dateOfTransfer)
 {
     return(_equipmentTransferRepository.GetEquipmentTransferByRoomNumberAndDate(roomNumber, dateOfTransfer));
 }