Example #1
0
        /// <summary> 递归获取的时间比比较时间小则过滤掉 </summary>
        DayTimeModelEntity <T> GetListEntity(Queue <DayTimeModelEntity <T> > times, DateTime time)
        {
            if (times.Count == 0)
            {
                return(null);
            }

            DayTimeModelEntity <T> outTime = times.Dequeue();

            if (outTime.CompareTo(time) < 0)
            {
                return(GetListEntity(times, time));
            }
            else
            {
                return(outTime);
            }
        }
Example #2
0
        /// <summary> 递归批量增加间断的时间 </summary>
        void GetAppEntity(DayTimeModelEntity <T> outTime, ref DateTime tempTime, ref List <DayTimeModelEntity <T> > entityList)
        {
            if (outTime.CompareTo(tempTime) == 0)
            {
                entityList.Add(outTime);

                tempTime = tempTime.AddDays(1);
            }
            else
            {
                DayTimeModelEntity <T> entity = new DayTimeModelEntity <T>();
                entity.Time  = tempTime;
                entity.Value = defautValue;
                entityList.Add(entity);

                tempTime = tempTime.AddDays(1);

                GetAppEntity(outTime, ref tempTime, ref entityList);
            }
        }