コード例 #1
0
        public void AddSessionForThisClient(Client client)
        {
            var history = new History {
                Client = client, Record = DateTime.Now
            };

            HistoriesRepository.AddAsync(history);
        }
コード例 #2
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);
        }
コード例 #3
0
 public ICollection <History> GetHistory(DateTime startDate, DateTime endDate)
 {
     return(HistoriesRepository.Get(n => n.Record >= startDate && n.Record <= endDate).ToList());
 }