예제 #1
0
 /// <summary>
 /// Elimina el estado de todas las geocercas de este ticket de la cache
 /// </summary>
 protected void ClearGeocercasCache()
 {
     foreach (var key in Geocercas.Select(g => GetKeyGeocerca(g)).Where(key => LogicCache.KeyExists(typeof(EstadosEntrega), key)))
     {
         LogicCache.Delete(typeof(EstadosEntrega), key);
     }
 }
예제 #2
0
 private void DeleteCache(string key)
 {
     if (LogicCache.KeyExists(typeof(MensajeVO), key))
     {
         LogicCache.Delete(typeof(MensajeVO), key);
     }
 }
예제 #3
0
파일: GarminFmi.cs 프로젝트: jesumarquez/lt
        private static void setETADistanceTo(Int32 Id, UInt32?value)
        {
            var key = makeIDFor(Id, "ETA_DistanceTo");

            if (value == null)
            {
                LogicCache.Delete(key);
            }
            else
            {
                LogicCache.Store(typeof(String), key, value.Value.ToString());
            }
        }
예제 #4
0
파일: GarminFmi.cs 프로젝트: jesumarquez/lt
        private static void setETAEstimated(Int32 Id, DateTime?value)
        {
            var key = makeIDFor(Id, "ETA_Estimated");

            if (value == null)
            {
                LogicCache.Delete(key);
            }
            else
            {
                LogicCache.Store(typeof(String), key, value.Value.ToString("O"));
            }
        }
예제 #5
0
파일: Events.cs 프로젝트: jesumarquez/lt
        private static string GetEmployeeRfidAction(string rfid)
        {
            var key = string.Format("employeeRfid:{0}", rfid);

            if (LogicCache.KeyExists(typeof(string), key))
            {
                LogicCache.Delete(typeof(string), key);

                return(MessageCode.RfidEmployeeLogout.GetMessageCode());
            }

            LogicCache.Store(typeof(string), key, rfid);

            return(MessageCode.RfidEmployeeLogin.GetMessageCode());
        }
예제 #6
0
파일: SensorDAO.cs 프로젝트: jesumarquez/lt
        public override void SaveOrUpdate(Sensor obj)
        {
            var oldDev = obj.OldDispositivo;

            base.SaveOrUpdate(obj);
            lock (CacheByCodeLock)
            {
                if (oldDev != null) // si cambia el dispo, borro la cache vieja
                {
                    LogicCache.Delete(typeof(string), GetByCodeCacheKey(oldDev.Id, obj.OldCodigo));
                }
                if (obj.Baja) // si se elimina el sensor, borro la cache
                {
                    LogicCache.Delete(typeof(string), GetByCodeCacheKey(obj.Dispositivo.Id, obj.Codigo));
                }
                if (!obj.Baja) // si no se elimino el sensor, agrego el id a la cache
                {
                    LogicCache.Store(typeof(string), GetByCodeCacheKey(obj.Dispositivo.Id, obj.Codigo), obj.Id);
                }
            }
        }
예제 #7
0
        public override void SaveOrUpdate(SubEntidad obj)
        {
            var oldSensor = obj.OldSensor;

            base.SaveOrUpdate(obj);
            lock (CacheBySensorLock)
            {
                if (oldSensor != null) // si cambia el sensor, borro la cache vieja
                {
                    LogicCache.Delete(typeof(string), GetBySensorCacheKey(oldSensor.Id));
                }
                if (obj.Baja) // si se elimina la subEntidad, borro la cache
                {
                    LogicCache.Delete(typeof(string), GetBySensorCacheKey(obj.Sensor.Id));
                }
                if (!obj.Baja) // si no se elimino la subEntidad, agrego el id a la cache
                {
                    LogicCache.Store(typeof(string), GetBySensorCacheKey(obj.Sensor.Id), obj.Id);
                }
            }
        }
예제 #8
0
파일: CocheDAO.cs 프로젝트: jesumarquez/lt
 private static void DeleteDevKey(int deviceId)
 {
     LogicCache.Delete(typeof(String), "DeviceVehicle:" + deviceId);
 }
예제 #9
0
 public void ClearGeocerca(int id)
 {
     LogicCache.Delete(typeof(Geocerca), GetGeocercaByIdKey(id));
 }