public static TransitionStats ConvertFromDT(DataTable dt)
        {
            TransitionStats result = new TransitionStats();

            foreach (DataRow row in dt.Rows)
            {
                result.Add(TransitionStat.GetTransitionStat(row));
            }
            return(result);
        }
        public TransitionStats Sort(string column, bool desc)
        {
            var             sortedList = desc ? this.OrderByDescending(x => x.GetPropertyValue(column)) : this.OrderBy(x => x.GetPropertyValue(column));
            TransitionStats result     = new TransitionStats();

            foreach (var i in sortedList)
            {
                result.Add((TransitionStat)i);
            }
            return(result);
        }
 public static TransitionStats LoadTransitionStatsByThermostatId(System.Int32 thermostatId)
 {
     return(TransitionStats.LoadTransitionStats("LoadTransitionStatsByThermostatId", CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@ThermostatId", thermostatId) }));
 }
 public static TransitionStats LoadAllTransitionStats()
 {
     return(TransitionStats.LoadTransitionStats("LoadTransitionStatsAll", CommandType.StoredProcedure, null));
 }
 public static TransitionStats LoadTransitionStats(string sql, System.Data.CommandType commandType, System.Data.SqlClient.SqlParameter[] parameters)
 {
     return(TransitionStats.ConvertFromDT(Utils.ExecuteQuery(sql, commandType, parameters)));
 }