Example #1
0
        /// <summary>
        /// Setea el estado inicial (dentro/fuera) de todas las geocercas del ticket a partir de la ultima posicion del vehiculo.
        /// </summary>
        protected void FirstPosition()
        {
            try
            {
                var position = DaoFactory.LogPosicionDAO.GetLastOnlineVehiclePosition(Vehiculo);
                if (position == null)
                {
                    return;
                }

                // Pongo todas las geocercas en Desconocido
                var geocercas = Geocercas.Select(geocerca => GetKeyGeocerca(geocerca));

                foreach (var key in geocercas)
                {
                    LogicCache.Store(typeof(EstadosEntrega), key, new EstadosEntrega(EstadosGeocerca.Desconocido), DateTime.UtcNow.AddHours(5));
                }

                // Proceso la primera posicion
                var positionEvent = new PositionEvent(position.FechaMensaje, position.Latitud, position.Longitud);
                ProcessGeocercas(positionEvent);
            }
            catch (Exception ex)
            {
                STrace.Exception(typeof(CicloLogisticoFactory).FullName, ex);
            }
        }
Example #2
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);
     }
 }