日期,时间判断
/// <summary> /// 检查是否有重叠的时段 /// <returns>true:跟其它时段有重叠 false:没有重叠</returns> /// </summary> public bool CheckDuplicatedTime() { Filter filter = new Filter(); filter.Add("ID", this.ID, RELEATTION_TYPE.NOTEQUAL, LOGIC_TYPE.AND); filter.Add("FacilityID", this.FacilityID, RELEATTION_TYPE.EQUAL, LOGIC_TYPE.AND); filter.Add("SpecialDate", this.SpecialDate, RELEATTION_TYPE.EQUAL, LOGIC_TYPE.AND); List<SpecialCalendar> lst = SpecialCalendar.GetList(filter); return lst.Find(x => (this.StartHour >= x.StartHour && this.StartHour <= x.EndHour) || (this.EndHour >= x.StartHour && this.EndHour <= x.EndHour)) != null; }