Exemplo n.º 1
0
        public List <ListMonth> GetMonthsFromToday(int months)
        {
            List <ListMonth> _return = new List <ListMonth>();

            dcTimingDataContext dc = new dcTimingDataContext();
            var data = dc.spGetMonthsFromToday(months);

            foreach (var row in data)
            {
                ListMonth month = new ListMonth(row.YearNumber.Value, row.MonthNumber.Value, row.MonthDesc, row.MonthStartDate.Value, row.NextMonthStartDate.Value);
                _return.Add(month);
            }
            return(_return);
        }
        /// <summary>
        /// Load lists
        /// </summary>
        private void LoadLists()
        {
            if (CanGetReport)
            {
                ListMonth.Clear();
                ListYear.Clear();
                using (var dc = new QLPM_ModelDataContext())
                {
                    (from m in dc.HOADONs
                     group m by m.PHIEUKHAMBENH.NgayKham.Month into g
                     select g.Key).ToList().ForEach(x => ListMonth.Add(x));

                    (from m in dc.HOADONs
                     group m by m.PHIEUKHAMBENH.NgayKham.Year into g
                     select g.Key).ToList().ForEach(x => ListYear.Add(x));
                }
            }
        }