Exemplo n.º 1
0
        public async Task <Dictionary <string, int> > Get()
        {
            List <Dictionary <string, int> > list = new List <Dictionary <string, int> >();
            DateTime dt         = DateTime.Now;
            var      PeopleList = await _d_target_camera_record_peopleServices.Query(a => a.RecTime > dt.Date);

            var CarList = await _d_car_attributeServices.Query(a => a.Time > dt.Date);

            Dictionary <string, int> dc = new Dictionary <string, int>();

            dc.Add("dayPeople", PeopleList.Count);
            dc.Add("dayCar", CarList.Count);
            DateTime temp  = new DateTime(dt.Year, dt.Month, dt.Day);
            int      count = dt.DayOfWeek - DayOfWeek.Monday;

            if (count == -1)
            {
                count = 6;
            }
            temp.AddDays(-count);
            DateTime week = Convert.ToDateTime(temp.AddDays(-count).ToString("yyyy-MM-dd 00:00:00"));

            PeopleList = await _d_target_camera_record_peopleServices.Query(a => a.RecTime > week);

            CarList = await _d_car_attributeServices.Query(a => a.Time > week);

            dc.Add("weekPeople", PeopleList.Count);
            dc.Add("weekjg", CarList.Count);
            DateTime month = Convert.ToDateTime(dt.AddDays(1 - dt.Day).ToString("yyyy-MM-dd 00:00:00"));

            PeopleList = await _d_target_camera_record_peopleServices.Query(a => a.RecTime > month);

            CarList = await _d_car_attributeServices.Query(a => a.Time > month);

            dc.Add("monthzj", PeopleList.Count);
            dc.Add("monthjg", CarList.Count);
            return(dc);
        }
 public async Task <List <d_target_camera_record_people> > Get()
 {
     return(await _d_target_camera_record_peopleServices.Query());
 }
Exemplo n.º 3
0
        public async Task <List <d_target_camera_record_people> > Get()
        {
            Expression <Func <d_target_camera_record_people, bool> > whereExpression = a => a.IsDeleted != true;

            return(await _d_target_camera_record_peopleServices.Query(whereExpression));
        }