Ejemplo n.º 1
0
        public static List <Signups> GetSignupsByHour()
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_ReportingGetSignupNumbersByHours");

            List <Signups> arr = new List <Signups>();

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                while (dr.Read())
                {
                    Signups s = new Signups();
                    s.NumberOfSignups = (int)dr[0];
                    s.Date            = new DateTime((int)dr[4], (int)dr[3], (int)dr[2], (int)dr[1], 0, 0);
                    arr.Add(s);
                }

                dr.Close();
            }

            return(arr);
        }
Ejemplo n.º 2
0
        public static List<Signups> GetSignupsByHour()
        {
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_ReportingGetSignupNumbersByHours");

            List<Signups> arr = new List<Signups>();

            //execute the stored procedure
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                while (dr.Read())
                {
                    Signups s = new Signups();
                    s.NumberOfSignups = (int)dr[0];
                    s.Date = new DateTime((int)dr[4], (int)dr[3], (int)dr[2], (int)dr[1],0,0);
                    arr.Add(s);
                }

                dr.Close();
            }

            return arr;
        }