示例#1
0
        internal static List <Client> GetAllClients()
        {
            List <Client> list = Firebird.GetAllClients();

            clientCache.UpdateMany(list.ToArray());
            return(list);
        }
示例#2
0
        public static List <Device> GetAllDevices()
        {
            List <Device> list = Firebird.GetAllDevices();

            deviceCache.UpdateMany(list.ToArray());
            return(list);
        }
示例#3
0
 public static List <Device> GetDevices(int clientId, bool useCache = false)
 {
     if (useCache)
     {
         return(deviceCache.GetByClientID(clientId));
     }
     else
     {
         return(Firebird.GetDevices(clientId));
     }
 }
示例#4
0
        internal static Client GetClient(int clientID, bool useCache = false)
        {
            if (useCache)
            {
                if (clientCache.Contains(clientID))
                {
                    return((Client)clientCache.Get(clientID));
                }
            }

            Client c = Firebird.GetClient(clientID);

            clientCache.Set(c.id, c);
            return(c);
        }
示例#5
0
 public static Device GetDevice(string serial_number, bool useCache = false)
 {
     if (useCache)
     {
         Device dev = deviceCache.GetBySerialNumber(serial_number);
         if (dev == null)
         {
             return(Firebird.GetDevice(serial_number));
         }
         else
         {
             return(dev);
         }
     }
     return(Firebird.GetDevice(serial_number));
 }
示例#6
0
 public static Address GetAddress(int id)
 {
     return(Firebird.GetAddress(id));
 }
示例#7
0
 internal static List <ServiceReport> GetServiceReport(int deviceId)
 {
     return(Firebird.GetServiceReports(deviceId));
 }
示例#8
0
 internal static Client GetClient(string clientNIP)
 {
     return(Firebird.GetClient(clientNIP));
 }