예제 #1
0
        public static int GetTotalDevices()
        {
            DeviceCollection deviceLocationCollection = new DeviceCollection();

            try
            {
                return(deviceLocationCollection.GetDbCount());
            }
            catch
            {
                return(0);
            }
        }
예제 #2
0
        public static int GetActiveDevices()
        {
            DeviceCollection ecDeviceCollection = new DeviceCollection();

            try
            {
                PredicateExpression filter = new PredicateExpression(DeviceFields.LastReportTime >= DateTime.Now.Date);
                filter.AddWithAnd(DeviceFields.LastReportTime < DateTime.Now.Date.AddDays(1));
                return(ecDeviceCollection.GetDbCount(filter));
            }
            catch
            {
                return(0);
            }
        }