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); }
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); }
public YearlyStatisticsPage() { InitializeComponent(); BindingContext = new YearlyStatisticsViewModel(); }