示例#1
0
        protected override List <SnapShot> GetingItems(ParkDataContext parking, Ralid.Park.BusinessModel.SearchCondition.SearchCondition search)
        {
            List <SnapShot> items = new List <SnapShot>();

            if (search is SnapShotSearchCondition)
            {
                SnapShotSearchCondition con    = search as SnapShotSearchCondition;
                IQueryable <SnapShot>   result = parking.SnapShot;
                if (con.ShotDateTime != null)
                {
                    DateTime shotdatetime = new DateTime(con.ShotDateTime.Value.Year,
                                                         con.ShotDateTime.Value.Month,
                                                         con.ShotDateTime.Value.Day,
                                                         con.ShotDateTime.Value.Hour,
                                                         con.ShotDateTime.Value.Minute,
                                                         con.ShotDateTime.Value.Second);
                    //只精确到秒,因为脱机模式时,卡片的进场时间只保存到秒部分
                    result = result.Where(s => s.ShotAt >= shotdatetime && s.ShotAt < shotdatetime.AddSeconds(1));
                    //result = result.Where(s => s.ShotAt == con.ShotDateTime.Value);
                }
                if (!string.IsNullOrEmpty(con.CardID))
                {
                    result = result.Where(s => s.CardID == con.CardID);
                }
                items = result.ToList();
            }
            return(items);
        }
示例#2
0
        public List <SnapShot> GetSnapShots(DateTime shotDateTime, string cardID)
        {
            SnapShotSearchCondition con = new SnapShotSearchCondition();

            con.ShotDateTime = shotDateTime;
            con.CardID       = cardID;
            return(provider.GetItems(con).QueryObjects);
        }
示例#3
0
        public Image GetFirstSnapShot(DateTime shotDateTime, string cardID)
        {
            Image img = null;
            SnapShotSearchCondition con = new SnapShotSearchCondition();

            con.ShotDateTime = shotDateTime;
            con.CardID       = cardID;
            List <SnapShot> shots = provider.GetItems(con).QueryObjects;

            if (shots != null && shots.Count > 0)
            {
                img = shots[0].Image;
            }
            return(img);
        }
示例#4
0
        protected override List <SnapShot> GetingItems(ParkDataContext parking, Ralid.Park.BusinessModel.SearchCondition.SearchCondition search)
        {
            List <SnapShot> items = new List <SnapShot>();

            if (search is SnapShotSearchCondition)
            {
                SnapShotSearchCondition con    = search as SnapShotSearchCondition;
                IQueryable <SnapShot>   result = parking.SnapShot;
                if (con.ShotDateTime != null)
                {
                    result = result.Where(s => s.ShotAt == con.ShotDateTime.Value);
                }
                items = result.ToList();
            }
            return(items);
        }