/// <summary> /// Return the first ScheduleDetail instant containing the given date (first parameter) /// </summary> /// <param name="date">The date that is to be covered by the returned sdItem</param> /// <param name="isWorkDay">Indicates whether the given date is a work day or non-work day</param> /// <param name="sdItem">The ScheduleDetail instant containing the given date</param> /// <param name="hourInterval">The scheduled hours on the given date in the ScheduleDetail instant</param> public virtual bool GetFirstMatchedScheduleDetailOnDate(DateTime date, out ScheduleDetail sdItem, out TimeInterval hourInterval) { sdItem = null; hourInterval = null; foreach (ScheduleDetail sd in this.ScheduleDetails) { hourInterval = sd.GetScheduledHoursOn(date); if (hourInterval != null && hourInterval != TimeInterval.EmptyInterval) { sdItem = sd; return(true); } } return(false); }
public virtual void Add(ScheduleDetail sd) { ScheduleDetails.Add(sd); sd.Schedule = this; }