Example #1
0
        public bool IsTimeslotsOverlapping(List <Timeslot> timeslotsWhereTeacherIsPresent, Timeslot newTimeslot)
        {
            if (timeslotsWhereTeacherIsPresent.Count == 0)
            {
                return(false);
            }

            var result = timeslotsWhereTeacherIsPresent.All(existingTimeslots => newTimeslot.Range.From >= existingTimeslots.Range.To || newTimeslot.Range.To <= existingTimeslots.Range.From);

            return(result);
        }
Example #2
0
 public void CreateTimeSlot(Timeslot timeslot)
 {
     this.Timeslots.Add(timeslot);
 }
Example #3
0
        public bool IsTimeslotsOverlapping(List <Timeslot> timeslotsWhereTeacherIsPresent, Timeslot newTimeslot)
        {
            var result = timeslotsWhereTeacherIsPresent.All(existingTimeslots => newTimeslot.From >= existingTimeslots.To || newTimeslot.To <= existingTimeslots.From);

            return(result);
        }