public StatisticDTO Get(int affiliateId) { var firstDay = DateTimeDayOfMonth.FirstDayOfMonth(DateTime.Now); var firstDayLastMonth = DateTimeDayOfMonth.FirstDayOfMonth(DateTime.Now.AddMonths(-1)); var lastDay = DateTimeDayOfMonth.LastDayOfMonth(DateTime.Now); var lastDayLastMonth = DateTimeDayOfMonth.LastDayOfMonth(DateTime.Now.AddMonths(-1)); return(GetStatisticData(affiliateId, firstDay, firstDayLastMonth, lastDay, lastDayLastMonth)); }
public StatisticDTO Get() { var affiliateId = _context.ApplicationUsers .Where(u => u.Id.Equals(_userProviderService.GetUserId())) .Select(u => u.AffiliateId) .Single(); var firstDay = DateTimeDayOfMonth.FirstDayOfMonth(DateTime.Now); var firstDayLastMonth = DateTimeDayOfMonth.FirstDayOfMonth(DateTime.Now.AddMonths(-1)); var lastDay = DateTimeDayOfMonth.LastDayOfMonth(DateTime.Now); var lastDayLastMonth = DateTimeDayOfMonth.LastDayOfMonth(DateTime.Now.AddMonths(-1)); return(GetStatisticData(affiliateId, firstDay, firstDayLastMonth, lastDay, lastDayLastMonth)); }