Exemple #1
0
        public static Cycles ConvertFromDT(DataTable dt)
        {
            Cycles result = new Cycles();

            foreach (DataRow row in dt.Rows)
            {
                result.Add(Cycle.GetCycle(row));
            }
            return(result);
        }
Exemple #2
0
        public Cycles Sort(string column, bool desc)
        {
            var    sortedList = desc ? this.OrderByDescending(x => x.GetPropertyValue(column)) : this.OrderBy(x => x.GetPropertyValue(column));
            Cycles result     = new Cycles();

            foreach (var i in sortedList)
            {
                result.Add((Cycle)i);
            }
            return(result);
        }
Exemple #3
0
        public Cycles GetByTime(DateTime startTime, DateTime endTime)
        {
            Cycles result = new Cycles();

            foreach (ThermostatMonitorLib.Cycle c in this)
            {
                if (c.StartDate <= endTime && c.EndDate >= startTime)
                {
                    result.Add(c);
                }
            }
            return(result);
        }
 public Cycles GetByTime(DateTime startTime,DateTime endTime)
 {
     Cycles result = new Cycles();
     foreach (ThermostatMonitorLib.Cycle c in this)
     {
         if (c.StartDate <= endTime && c.EndDate >= startTime) result.Add(c);
     }
     return result;
 }