public static int GetTotalDevices() { DeviceCollection deviceLocationCollection = new DeviceCollection(); try { return(deviceLocationCollection.GetDbCount()); } catch { return(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); } }