コード例 #1
0
        public static TransitionStats ConvertFromDT(DataTable dt)
        {
            TransitionStats result = new TransitionStats();

            foreach (DataRow row in dt.Rows)
            {
                result.Add(TransitionStat.GetTransitionStat(row));
            }
            return(result);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static TransitionStats LoadTransitionStatsByThermostatId(System.Int32 thermostatId)
 {
     return(TransitionStats.LoadTransitionStats("LoadTransitionStatsByThermostatId", CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@ThermostatId", thermostatId) }));
 }
コード例 #4
0
 public static TransitionStats LoadAllTransitionStats()
 {
     return(TransitionStats.LoadTransitionStats("LoadTransitionStatsAll", CommandType.StoredProcedure, null));
 }
コード例 #5
0
 public static TransitionStats LoadTransitionStats(string sql, System.Data.CommandType commandType, System.Data.SqlClient.SqlParameter[] parameters)
 {
     return(TransitionStats.ConvertFromDT(Utils.ExecuteQuery(sql, commandType, parameters)));
 }