Exemplo n.º 1
0
        // obsolete?
        private static BikeTable GetTopModel(List <BikeTable> hierarchy)
        {
            BikeTable model = new BikeTable();

            model = (BikeTable)Activator.CreateInstance(hierarchy[0].GetType());
            return(model);
        }
 private static void PopulateModel(List<BikeTable> hierarchy, BikeTable model, DataSet ds)
 {
     // Single query returns one table
     DataTable dt = ds.Tables[0];
     // read column names to use to select correct fields for data
     // TBD Inspect here to find column names for pivoted Dayname-bikes
     Dictionary<string, int> colnbr = new Dictionary<string, int>();
     foreach (DataColumn dc in dt.Columns)
     {
         colnbr.Add(dc.ColumnName, dc.Ordinal);
     }
     foreach (DataRow dr in dt.Rows)
     {
         model.UpdateForDR(hierarchy, 0, dr, colnbr);
     }
 }
Exemplo n.º 3
0
        private static void PopulateModel(List <BikeTable> hierarchy, BikeTable model, DataSet ds)
        {
            // Single query returns one table
            DataTable dt = ds.Tables[0];
            // read column names to use to select correct fields for data
            // TBD Inspect here to find column names for pivoted Dayname-bikes
            Dictionary <string, int> colnbr = new Dictionary <string, int>();

            foreach (DataColumn dc in dt.Columns)
            {
                colnbr.Add(dc.ColumnName, dc.Ordinal);
            }
            foreach (DataRow dr in dt.Rows)
            {
                model.UpdateForDR(hierarchy, 0, dr, colnbr);
            }
        }
 public override AbstractBikeRow GenerateNewRow(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr)
 {
     return(new RowTripCategories(tabletype, dr, colnbr));
 }
 /// <summary>
 /// Constructor for row
 /// </summary>
 /// <param name="dr">
 /// rowset for record
 /// </param>
 /// <param name="colnbr">
 /// dictionary mapping column names to numbers
 /// </param>
 public RowTripCategories(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr) : base(tabletype, dr, colnbr)
 {
     DistanceCategory = new DimPairDistanceCategory(dr, colnbr);
     DurationCategory = new DimTripCategory(dr, colnbr);
     //SubscriberList = new TableSubscriber();
 }
Exemplo n.º 6
0
        //public TableHour2 Hour2List;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dr"></param>
        /// <param name="colnbr"></param>
        public RowSubscriber(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr) : base(tabletype, dr, colnbr)
        {
            Subscriber = new DimSubscriber(dr, colnbr);

            //Hour2List = new TableHour2();
        }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor for hour record
 /// </summary>
 /// <param name="dr">
 /// Dataset row
 /// </param>
 /// <param name="colnbr">
 /// Dictionary of column headings in dataset
 /// </param>
 public RowHour2(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr) : base(tabletype, dr, colnbr)
 {
     Hour2OfDay = new DimTimeHour2ofDay(dr, colnbr);
 }
 // obsolete?
 private static BikeTable GetTopModel(List<BikeTable> hierarchy)
 {
     BikeTable model = new BikeTable();
     model = (BikeTable)Activator.CreateInstance(hierarchy[0].GetType());
     return model;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dr">
 /// row containing results of query
 /// </param>
 /// <param name="colnbr">
 /// Dictionary of column numbers for column headings
 /// </param>
 public RowWeekday(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr) : base(tabletype, dr, colnbr)
 {
     WeekdayName = new DimTimeWeekdayName(dr, colnbr);
 }
 public override AbstractBikeRow GenerateNewRow(BikeTable typename, DataRow dr, Dictionary <string, int> colnbr)
 {
     return(new RowWeekofyear(typename, dr, colnbr));
 }
 public RowWeekofyear(BikeTable tabletype, DataRow dr, Dictionary <string, int> colnbr) : base(tabletype, dr, colnbr)
 {
     Weekofyear = new DimTimeWeekofyear(dr, colnbr);
 }