Пример #1
0
 public void ResetListYear()
 {
     ListYear.Clear();
     for (int i = 2010; i <= (DateTime.Now.Year); i++)
     {
         ListYear.Add(i);
     }
 }
        /// <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));
                }
            }
        }