コード例 #1
0
        public List <YearlyStatisticsViewModel> GetYearlyUserRegistrationChartData(int year)
        {
            List <YearlyStatisticsViewModel> list = new List <YearlyStatisticsViewModel>();

            for (int i = 1; i <= 12; i++)
            {
                YearlyStatisticsViewModel model = new YearlyStatisticsViewModel();
                model.Month     = i;
                model.MonthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i);
                model.Year      = year;

                var createdUser = _unitOfWork.UserRepository.FindBy(u => u.CreationDate.Month == i && u.CreationDate.Year == year);

                model.Count = createdUser.Count();
                list.Add(model);
            }
            return(list);
        }
コード例 #2
0
        public List <YearlyStatisticsViewModel> GetYearlyActiveClassifiedChartData(int year)
        {
            List <YearlyStatisticsViewModel> list = new List <YearlyStatisticsViewModel>();

            for (int i = 1; i <= 12; i++)
            {
                YearlyStatisticsViewModel model = new YearlyStatisticsViewModel();
                model.Month     = i;
                model.MonthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i);
                model.Year      = year;

                var activeClassifieds = _unitOfWork.ClassifiedRepository.FindBy(u => u.Status == AdStatusList.Active && u.PostingDate.Value.Month == i && u.PostingDate.Value.Year == year);

                model.Count = activeClassifieds.Count();
                list.Add(model);
            }
            return(list);
        }
コード例 #3
0
 public YearlyStatisticsPage()
 {
     InitializeComponent();
     BindingContext = new YearlyStatisticsViewModel();
 }