Esempio n. 1
0
        public ICollection <History> SessiosOfThisMonthForThisClient(Client client)
        {
            var subcribtions         = SubcriptionsRepository.Get(e => e.Client.Id == client.Id).ToList();
            var subcribtion          = subcribtions.FirstOrDefault(e => (e.EndDate - DateTime.Now).TotalDays > 0);
            var sessionsofthisClient = HistoriesRepository.Get(n => n.Client.Id == client.Id).ToList();
            var sessions             = sessionsofthisClient.Where(n => subcribtion != null && n.Record >= subcribtion.StartDate && n.Record <= subcribtion.EndDate)
                                       .ToList();

            return(sessions);
        }
Esempio n. 2
0
 public ICollection <History> GetHistory(DateTime startDate, DateTime endDate)
 {
     return(HistoriesRepository.Get(n => n.Record >= startDate && n.Record <= endDate).ToList());
 }