Esempio n. 1
0
        public static Dictionary <int, Dictionary <int, List <StockListItem> > > getUniqueStockDates(List <StockListItem> stockListItems)
        {
            Dictionary <int, Dictionary <int, List <StockListItem> > > dates = new Dictionary <int, Dictionary <int, List <StockListItem> > >();

            foreach (StockListItem stockListItem in stockListItems)
            {
                StockDate stockDate = stockListItem.getStockDate();

                /*
                 * StockDate stockDate = new StockDate();
                 * stockDate.month = stockListItem.dateTime.Month;
                 * stockDate.day = stockListItem.dateTime.Day;
                 */
                if (!dates.ContainsKey(stockDate.month))
                {
                    dates[stockDate.month] = new Dictionary <int, List <StockListItem> >();
                }

                if (!dates[stockDate.month].ContainsKey(stockDate.day))
                {
                    dates[stockDate.month][stockDate.day] = new List <StockListItem>();
                }
                dates[stockDate.month][stockDate.day].Add(stockListItem);
            }

            return(dates);
        }
Esempio n. 2
0
        public StockDate getStockDate()
        {
            StockDate stockDate = new StockDate();

            stockDate.month = this.dateTime.Month;
            stockDate.day   = this.dateTime.Day;
            stockDate.year  = this.dateTime.Year;
            return(stockDate);
        }