public async Task <object> GetOccupancyForRoomByDate(RoomDatePOCO roomDatePOCO) { List <Examination> result = new List <Examination>(); var examinations = _examinationRepository.Find(x => x.RoomId.Equals(roomDatePOCO.RoomId) && x.Status != ExaminationStatus.Finished).ToList(); foreach (var exm in examinations) { result.Add(exm); } return(result); }
public async Task <object> FirstAvailableByDate(RoomDatePOCO roomDatePOCO) { var examinations = _examinationRepository.Find(x => x.DateTime.Equals(roomDatePOCO.RoomId) && !x.Status.Equals(Accepted)).ToList(); var ex = GenerateFreeExamination(examinations, roomDatePOCO.Date, 0).First(); while (ex == null) { roomDatePOCO.Date.AddDays(1); ex = GenerateFreeExamination(examinations, roomDatePOCO.Date, 0).First(); } return(ex); }