Ejemplo n.º 1
0
        /// <summary>
        /// Message data binding.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            var id = !string.IsNullOrEmpty(Request.QueryString["id"]) ? Convert.ToInt32(Request.QueryString["id"]) : 0;

            var message = DAOFactory.LogMensajeDAO.FindById(id);

            if (message == null)
            {
                return;
            }

            lblCoche.Text   = message.Coche.Interno;
            lblMensaje.Text = message.Texto;

            lblCorner.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(message.Latitud, message.Longitud);

            lblFecha.Text = string.Concat(message.Fecha.ToDisplayDateTime().ToShortDateString(), " ", message.Fecha.ToDisplayDateTime().TimeOfDay.ToString());

            lblLink.Visible = message.TieneFoto;
            if (lblLink.Visible)
            {
                lblLink.Text = @"<div class=""withPhoto""></div>";

                const string link = "window.open('../../Common/Pictures?e={0}', 'Fotos_{0}', 'width=345,height=408,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');";

                lblLink.Attributes.Add("onclick", string.Format(link, message.Id));
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id;
                if (Request.QueryString["id"] == null || !int.TryParse(Request.QueryString["id"], out id))
                {
                    LblInfo.Text = CultureManager.GetError("NO_ENTREGA_INFO");
                    return;
                }

                var entrega = DAOFactory.EntregaDistribucionDAO.FindById(id);
                if (entrega != null)
                {
                    lblEntrega.Text  = entrega.Descripcion;
                    lblViaje.Text    = entrega.Viaje.Codigo;
                    lblVehiculo.Text = entrega.Viaje.Vehiculo != null ? entrega.Viaje.Vehiculo.Interno : CultureManager.GetError("NO_VEHICLE_ASSIGNED");
                    lblEstado.Text   = CultureManager.GetLabel(EntregaDistribucion.Estados.GetLabelVariableName(entrega.Estado));
                    if (entrega.ReferenciaGeografica != null)
                    {
                        lblDireccion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(entrega.ReferenciaGeografica.Latitude, entrega.ReferenciaGeografica.Longitude);
                    }
                    lblEntrada.Text = (entrega.Entrada.HasValue ? entrega.Entrada.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty);
                    lblManual.Text  = (entrega.Manual.HasValue ? entrega.Manual.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty);
                    lblSalida.Text  = (entrega.Salida.HasValue ? entrega.Salida.Value.ToDisplayDateTime().ToString("yyyy/MM/dd HH:mm") : string.Empty);
                    lnkMonitorCiclo.Attributes.Add("id", entrega.Viaje.Id.ToString("#0"));
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnRowDataBound(C1GridView grid, C1GridViewRowEventArgs e, TolvaTourVo dataItem)
        {
            var vehiculo = DAOFactory.CocheDAO.FindById(dataItem.IdVehiculo);

            var posInicio = new GPSPoint(dataItem.EntradaHora, (float)dataItem.LatitudInicio, (float)dataItem.LongitudInicio);
            var posFin    = new GPSPoint(dataItem.SalidaHora, (float)dataItem.LatitudFin, (float)dataItem.LongitudFin);

            var estadoInicio = GeocercaManager.CalcularEstadoVehiculo(vehiculo, posInicio, DAOFactory);
            var estadoFin    = GeocercaManager.CalcularEstadoVehiculo(vehiculo, posFin, DAOFactory);

            var geocerca = estadoInicio.GeocercasDentro.Intersect(estadoFin.GeocercasDentro).FirstOrDefault();
            var text     = geocerca != null
                ? geocerca.Geocerca.Descripcion
                : GeocoderHelper.GetDescripcionEsquinaMasCercana(dataItem.LatitudInicio, dataItem.LongitudInicio);

            e.Row.Cells[TolvaTourVo.Index.Ubicacion].Text = text;
            if (dataItem.Entrada == DateTime.MinValue)
            {
                e.Row.Cells[TolvaTourVo.Index.Entrada].Text     = "";
                e.Row.Cells[TolvaTourVo.Index.EntradaHora].Text = "";
            }
            if (dataItem.Salida == DateTime.MinValue)
            {
                e.Row.Cells[TolvaTourVo.Index.Salida].Text     = "";
                e.Row.Cells[TolvaTourVo.Index.SalidaHora].Text = "";
            }
        }
Ejemplo n.º 4
0
        private static void SendMail(LogMensajeBase log)
        {
            const int minutes = 15;
            var       monitor = Config.Monitor.HistoricMonitorLink;
            var       link    = log.Coche != null
                ? String.Format(@"{0}?Planta={1}&TypeMobile={2}&Movil={3}&InitialDate={4}&FinalDate={5}&MessageCenterIndex={6}&ShowMessages=1&Empresa={7}&ShowPOIS=1",
                                monitor,
                                log.Coche.Linea != null?log.Coche.Linea.Id : -1,
                                log.Coche.TipoCoche.Id, log.Coche.Id,
                                log.Fecha.AddMinutes(-minutes).ToString(CultureInfo.InvariantCulture),
                                log.Fecha.AddMinutes(minutes).ToString(CultureInfo.InvariantCulture),
                                log.Id,
                                log.Coche.Empresa != null?log.Coche.Empresa.Id : log.Coche.Linea != null?log.Coche.Linea.Empresa.Id : -1)
                                : monitor;

            var chofer = log.Chofer != null?string.Format("Chofer: {0}", log.Chofer.Entidad.Descripcion) : "Sin Chofer Identificado";

            var responsable = log.Coche != null && log.Coche.Chofer != null && log.Coche.Chofer.Entidad != null ? log.Coche.Chofer.Entidad.Descripcion : "Sin Responsable Asignado";

            var parameters = log.Coche != null
                                 ? new List <string>
            {
                log.Coche.Linea != null ? log.Coche.Linea.Descripcion : log.Coche.Empresa != null ? log.Coche.Empresa.RazonSocial : "Sistema",
                string.Concat(log.Coche.Interno, " - ", chofer),
                responsable,
                log.Coche.ToLocalString(log.Fecha, true),
                GeocoderHelper.GetDescripcionEsquinaMasCercana(log.Latitud, log.Longitud),
                log.Texto,
                link
            }
                                 : new List <string>
            {
                "Sistema",
                "(Ninguno)",
                responsable,
                string.Format("{0} {1}", log.Fecha.ToShortDateString(), log.Fecha.ToShortTimeString()),
                GeocoderHelper.GetDescripcionEsquinaMasCercana(log.Latitud, log.Longitud),
                log.Texto,
                link
            };

            var destinatarios = log.Accion.DestinatariosMail;

            if (log.Accion.ReportaDepartamento && log.Accion.Departamento.Empleado != null && log.Accion.Departamento.Empleado.Mail != string.Empty)
            {
                destinatarios = destinatarios + ";" + log.Accion.Departamento.Empleado.Mail;
            }
            if (log.Accion.ReportaCentroDeCostos && log.Accion.CentroDeCostos.Empleado != null && log.Accion.CentroDeCostos.Empleado.Mail != string.Empty)
            {
                destinatarios = destinatarios + ";" + log.Accion.CentroDeCostos.Empleado.Mail;
            }

            var asunto = log.Accion.AsuntoMail.Trim() != string.Empty
                                 ? log.Accion.AsuntoMail.Trim()
                                 : log.Texto;

            SendMailToAllDestinations(destinatarios, log.Chofer, asunto, parameters);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int p;
                if (Request.QueryString["p"] == null || !int.TryParse(Request.QueryString["p"], out p))
                {
                    lblDescripcion.Text = CultureManager.GetError("NO_POI_INFO");
                    return;
                }
                var idsLineas = Request.QueryString["l"].Split(',').Select(l => Convert.ToInt32(l)).ToList();

                if (idsLineas.Count <= 0)
                {
                    lblDescripcion.Text = CultureManager.GetError("NO_POI_INFO");
                    return;
                }

                var poi = DAOFactory.ReferenciaGeograficaDAO.FindById(p);
                lblTipo.Text        = poi.TipoReferenciaGeografica.Descripcion;
                lblDescripcion.Text = poi.Codigo + @" - " + poi.Descripcion;
                lblDireccion.Text   = GeocoderHelper.GetDescripcionEsquinaMasCercana(poi.Latitude, poi.Longitude);
                imgTipo.ImageUrl    = IconDir + (poi.Icono != null ? poi.Icono.PathIcono : poi.TipoReferenciaGeografica.Icono.PathIcono);

                int idEmpresa;
                if (Request.QueryString["e"] == null || !int.TryParse(Request.QueryString["e"], out idEmpresa))
                {
                    idEmpresa = poi.Empresa != null ? poi.Empresa.Id : -1;
                }

                var pois = DAOFactory.ReferenciaGeograficaDAO.GetVehiculosCercanos(new[] { idEmpresa }, idsLineas, poi.Id);
                if (pois.Count > 10)
                {
                    pois.RemoveRange(10, pois.Count - 10);
                }
                gridMov.DataSource = pois;
                gridMov.DataBind();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initial data binding.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!string.IsNullOrEmpty(Request.QueryString["latitude"]) && !string.IsNullOrEmpty(Request.QueryString["longitude"]))
            {
                var latitude  = Convert.ToDouble(Request.QueryString["latitude"], CultureInfo.InvariantCulture);
                var longitude = Convert.ToDouble(Request.QueryString["longitude"], CultureInfo.InvariantCulture);

                lblEsquina.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(latitude, longitude);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["inicio"]))
            {
                lblInicio.Text = Request.QueryString["inicio"];
            }
            if (!string.IsNullOrEmpty(Request.QueryString["duracion"]))
            {
                lblDuracion.Text = Request.QueryString["duracion"];
            }
            if (!string.IsNullOrEmpty(Request.QueryString["distancia"]))
            {
                lblDistancia.Text = string.Concat(Request.QueryString["distancia"], "km");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["velocidadMinima"]))
            {
                lblVelocidadMinima.Text = string.Concat(Request.QueryString["velocidadMinima"], "km/h");
            }
            if (!string.IsNullOrEmpty(Request.QueryString["velocidadMaxima"]))
            {
                lblVelocidadMaxima.Text = string.Concat(Request.QueryString["velocidadMaxima"], "km/h");
            }
            if (!string.IsNullOrEmpty(Request.QueryString["velocidadPromedio"]))
            {
                lblVelocidadPromedio.Text = string.Concat(Convert.ToInt32(Request.QueryString["velocidadPromedio"]), " km/h");
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Sends a SMS with info about the event.
        /// </summary>
        /// <param name="log"></param>
        private static void SendSms(LogMensajeBase log)
        {
            var parameters = log.Coche != null
                                 ? new List <string>
            {
                log.Coche.Linea != null? log.Coche.Linea.Descripcion : log.Coche.Empresa != null ? log.Coche.Empresa.RazonSocial : "Sistema",
                log.Coche.Interno,
                log.Coche.ToLocalString(log.Fecha, false),
                log.Texto,
                GeocoderHelper.GetDescripcionEsquinaMasCercana(log.Latitud, log.Longitud),
                log.Coche.Chofer != null ? log.Coche.Chofer.Entidad.Descripcion : string.Empty
            }
                                 : new List <string>
            {
                "Sistema",
                "(Ninguno)",
                string.Format("{0} {1}", log.Fecha.ToShortDateString(), log.Fecha.ToShortTimeString()),
                log.Texto,
                GeocoderHelper.GetDescripcionEsquinaMasCercana(log.Latitud, log.Longitud),
                string.Empty
            };

            SendSms(log.Accion.DestinatariosSms, parameters);
        }
Ejemplo n.º 8
0
        private void GetCenter(IEnumerable <List <RoutePosition> > routes)
        {
            var centerPosition = PosCenterIndex;

            if (centerPosition == null)
            {
                return;
            }

            foreach (var position in routes.SelectMany(route => route.Where(position => position.Id.Equals(centerPosition.Value))))
            {
                Monitor.AddMarkers(Layers.Eventos, new Marker(position.Date.ToDisplayDateTime().ToString(), Images.CurrentPosition, position.Latitude, position.Longitude,
                                                              string.Format("javascript:gCP('{0}', '{1}', '{2}')", GeocoderHelper.GetDescripcionEsquinaMasCercana(position.Latitude, position.Longitude),
                                                                            position.Date.ToDisplayDateTime(), position.Speed),
                                                              DrawingFactory.GetSize(21, 25), DrawingFactory.GetOffset(-10.5, -25)));

                _x = position.Latitude;
                _y = position.Longitude;

                Monitor.TriggerEvent(position.Date.ToDisplayDateTime().ToString(), Layers.Eventos, PopupEvent);
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id;
                if (Request.QueryString["id"] == null || !int.TryParse(Request.QueryString["id"], out id))
                {
                    LblInfo.Text = CultureManager.GetError("NO_ENTREGA_INFO");
                    return;
                }

                var entrega = DAOFactory.EntregaDistribucionDAO.FindById(id);
                if (entrega != null)
                {
                    var icono = entrega.PuntoEntrega.ReferenciaGeografica.Icono != null?Path.Combine(IconDir, entrega.PuntoEntrega.ReferenciaGeografica.Icono.PathIcono) : ResolveUrl("~/point.png");

                    imgIcono.Src        = icono;
                    lblCodigo.Text      = string.Format("{0} - {1}<br>{2}", entrega.PuntoEntrega.Codigo, entrega.PuntoEntrega.Descripcion, GeocoderHelper.GetDescripcionEsquinaMasCercana(entrega.PuntoEntrega.ReferenciaGeografica.Latitude, entrega.PuntoEntrega.ReferenciaGeografica.Longitude));
                    lblDescripcion.Text = entrega.Descripcion;
                    lblProgramado.Text  = entrega.Programado.ToDisplayDateTime().ToString("HH:mm");
                    //lblGps.Text = entrega.KmGps.HasValue ? entrega.KmGps.Value.ToString(CultureInfo.InvariantCulture) : "N/D";
                    lblEntrada.Text = entrega.Entrada.HasValue ? entrega.Entrada.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty;
                    lblManual.Text  = entrega.Manual.HasValue ? entrega.Manual.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty;
                    lblSalida.Text  = entrega.Salida.HasValue ? entrega.Salida.Value.ToDisplayDateTime().ToString("HH:mm") : string.Empty;
                    //lblCalculado.Text = entrega.KmCalculado.HasValue ? entrega.KmCalculado.Value.ToString(CultureInfo.InvariantCulture) : "N/D";
                    //lblControlado.Text = entrega.Viaje.Controlado && entrega.KmControlado.HasValue ? entrega.KmControlado.Value.ToString(CultureInfo.InvariantCulture) : "N/D";
                    lblEstado.Text = CultureManager.GetLabel(EntregaDistribucion.Estados.GetLabelVariableName(entrega.Estado));
                    lnkEditarPunto.OnClientClick = string.Format("window.open('../Parametrizacion/GeoRefAlta.aspx?id={0}')", entrega.PuntoEntrega.ReferenciaGeografica.Id);
                }
            }
        }
Ejemplo n.º 10
0
        protected void ShowMensaje(LogMensaje mensaje)
        {
            var iconDir = IconDir;

            var color = mensaje.Accion != null
                            ? Color.FromArgb(100, mensaje.Accion.Red, mensaje.Accion.Green, mensaje.Accion.Blue)
                            : Color.Gray;

            panelTitle.BackColor = color;
            panelTitle.ForeColor = color.GetBrightness() < 40 ? Color.White: Color.Black;

            if (mensaje.Accion != null && mensaje.Accion.PopIcon > 0)
            {
                imgAccion.ImageUrl = string.Format("{0}/{1}", iconDir, mensaje.Accion.PopUpIcon.PathIcono);
            }
            else
            {
                imgAccion.Visible = false;
            }

            lbMensaje.Text    = mensaje.Texto;
            lblHora.Text      = mensaje.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm");
            lblRecepcion.Text = mensaje.FechaAlta.HasValue
                                    ? "(" + mensaje.FechaAlta.Value.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm") + ")"
                                    : string.Empty;

            var pos = mensaje.Fecha;

            var link = string.Format(
                "../Monitor/MonitorHistorico/monitorHistorico.aspx?Planta={0}&TypeMobile={1}&Movil={2}&InitialDate={3}&FinalDate={4}&ShowMessages=0&ShowPOIS=0&Empresa={5}",
                mensaje.Coche.Linea != null ? mensaje.Coche.Linea.Id : -1, mensaje.Coche.TipoCoche.Id, mensaje.Coche.Id, pos.Subtract(TimeSpan.FromMinutes(15)).ToString(CultureInfo.InvariantCulture),
                pos.Add(TimeSpan.FromMinutes(1)).ToString(CultureInfo.InvariantCulture), mensaje.Coche.Empresa != null ? mensaje.Coche.Empresa.Id : mensaje.Coche.Linea != null ? mensaje.Coche.Linea.Empresa.Id : -1);

            lbMensaje.OnClientClick = string.Format("window.open('{0}', '" + CultureManager.GetMenu("OPE_MON_HISTORICO") + "')", link);

            lblMovil.Text = mensaje.Coche.Interno;
            var imgMovl = string.Format("{0}/{1}", iconDir, mensaje.Coche.TipoCoche.IconoNormal.PathIcono);

            imgMovil.ImageUrl = imgMovl;

            var chofer = mensaje.Chofer ?? mensaje.Coche.Chofer;

            lblChofer.Text = chofer != null
                                 ? string.Format("{0} - {1}", chofer.Legajo, chofer.Entidad.Descripcion)
                                 : CultureManager.GetString("Labels", "SIN_CHOFER");

            lblDireccion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(mensaje.Latitud, mensaje.Longitud);

            lblLatitud.Text  = mensaje.Latitud.ToString(CultureInfo.InvariantCulture);
            lblLongitud.Text = mensaje.Longitud.ToString(CultureInfo.InvariantCulture);

            Monitor1.ImgPath          = Config.Monitor.GetMonitorImagesFolder(this);
            Monitor1.GoogleMapsScript = GoogleMapsKey;
            Monitor1.EnableTimer      = false;
            Monitor1.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), 8),
                               //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, 8),
                               LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")),
                               LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), 8),
                               LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), 8),
                               LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), 8),
                               LayerFactory.GetMarkers(LayerVehiculos, true));
            Monitor1.AddControls(ControlFactory.GetLayerSwitcher(),
                                 ControlFactory.GetNavigation());
            Monitor1.SetCenter(mensaje.Latitud, mensaje.Longitud, 7);
            Monitor1.AddMarkers(LayerVehiculos, MarkerFactory.CreateMarker(mensaje.Coche.Id.ToString("#0"), imgMovl, mensaje.Latitud, mensaje.Longitud));

            var empresa = mensaje.Coche.Empresa;
            var linea   = mensaje.Coche.Linea;
            var user    = WebSecurity.AuthenticatedUser != null?DAOFactory.UsuarioDAO.FindById(WebSecurity.AuthenticatedUser.Id) : null;

            var mensajes = DAOFactory.MensajeDAO.FindByTipo(null, empresa, linea, user);
            var messages = mensajes.Where(m => m.TipoMensaje.DeAtencion).OrderBy(m => m.Descripcion);

            cbMensaje.ClearItems();
            cbMensaje.AddItem(CultureManager.GetControl("DDL_NO_MESSAGE"), cbMensaje.NoneValue);
            foreach (var msg in messages)
            {
                cbMensaje.AddItem(msg.Descripcion, msg.Id);
            }

            if (mensaje.Estado > 0)
            {
                btAceptar.Visible  = false;
                btIgnorar.ImageUrl = "~/Operacion/btAtras.gif";

                var atencion = DAOFactory.AtencionEventoDAO.GetByEvento(mensaje.Id);
                if (atencion != null)
                {
                    panelUsuario.Visible = true;
                    lblUsuario.Text      = atencion.Usuario.NombreUsuario;
                    panelFecha.Visible   = true;
                    lblFecha.Text        = atencion.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm");
                    cbMensaje.SetSelectedValue(atencion.Mensaje.Id);
                    cbMensaje.Enabled      = false;
                    txtObservacion.Text    = atencion.Observacion;
                    txtObservacion.Enabled = false;
                }
            }

            if (!WebSecurity.IsSecuredAllowed(Securables.EventAttention))
            {
                btAceptar.Visible  = false;
                btIgnorar.ImageUrl = "~/Operacion/btAtras.gif";
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["c"] == null)
            {
                lblDescripcion.Text = CultureManager.GetError("NO_VEHICLE_INFO");
                return;
            }

            IdEntidad = Convert.ToInt32(Request.QueryString["c"]);

            IdsLineas   = Request.QueryString["l"].Split(' ').Select(l => Convert.ToInt32(l)).ToList();
            IdsEmpresas = !string.IsNullOrEmpty(Request.QueryString["e"])
                              ? Request.QueryString["e"].Split(' ').Select(l => Convert.ToInt32(l)).ToList()
                              : new List <int> {
                -1
            };

            var entidad = DAOFactory.EntidadDAO.FindById(IdEntidad);

            IdDispositivo = entidad.Dispositivo != null ? entidad.Dispositivo.Id : -1;

            lblDescripcion.Text = entidad.Descripcion;
            lblTipo.Text        = entidad.TipoEntidad.Descripcion;
            imgTipo.ImageUrl    = IconDir + entidad.ReferenciaGeografica.Icono.PathIcono;

            var subEntidades = DAOFactory.SubEntidadDAO.GetList(new[] { entidad.Empresa.Id },
                                                                new[] { entidad.Linea != null ? entidad.Linea.Id : -1 },
                                                                new[] { entidad.TipoEntidad.Id },
                                                                new[] { entidad.Id },
                                                                new[] { entidad.Dispositivo != null ? entidad.Dispositivo.Id : -1 },
                                                                new[] { -1 });

            var fechaUltimaMedicion = DateTime.MinValue;

            foreach (var subEntidad in subEntidades)
            {
                var ultimaMedicion = DAOFactory.MedicionDAO.GetUltimaMedicionHasta(subEntidad.Sensor.Dispositivo.Id, subEntidad.Sensor.Id, DateTime.UtcNow);

                var label = new Label {
                    Text = subEntidad.Descripcion + @": "
                };
                divValor.Controls.Add(label);
                label = new Label {
                    Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                };

                switch (subEntidad.Sensor.TipoMedicion.Codigo)
                {
                case "TEMP":
                    if (ultimaMedicion != null)
                    {
                        fechaUltimaMedicion = ultimaMedicion.FechaMedicion > fechaUltimaMedicion
                                                      ? ultimaMedicion.FechaMedicion
                                                      : fechaUltimaMedicion;

                        label.Text = ultimaMedicion.Valor;
                        divValor.Controls.Add(label);

                        //EVALUO CONEXION
                        label = new Label {
                            Text = @" Energía: "
                        };
                        divValor.Controls.Add(label);
                        label = new Label {
                            Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                        };

                        var ultimoEventoConexion = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                                     new[] { Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString(),
                                                                                                             Convert.ToInt32(MessageIdentifier.TemperaturePowerReconected).ToString() });

                        if (ultimoEventoConexion != null &&
                            ultimoEventoConexion.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString())
                        {
                            label.Text = @"Off";
                        }
                        else
                        {
                            label.Text = @"On";
                        }
                        divValor.Controls.Add(label);

                        //EVALUO DESCONGELAMIENTO
                        label = new Label {
                            Text = @" Desc: "
                        };
                        divValor.Controls.Add(label);
                        label = new Label {
                            Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                        };

                        var ultimoEventoDescongelamiento =
                            DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                              new[] { Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString(),
                                                                                      Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonUnpressed).ToString() });

                        if (ultimoEventoDescongelamiento != null &&
                            ultimoEventoDescongelamiento.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString())
                        {
                            label.Text = @"On";
                        }
                        else
                        {
                            label.Text = @"Off";
                        }
                        divValor.Controls.Add(label);
                    }
                    else
                    {
                        label.Text = @"-";
                        divValor.Controls.Add(label);

                        //EVALUO CONEXION
                        label = new Label {
                            Text = @" Energía: "
                        };
                        divValor.Controls.Add(label);
                        label = new Label {
                            Text = @"-", Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                        };
                        divValor.Controls.Add(label);
                        //EVALUO DESCONGELAMIENTO
                        label = new Label {
                            Text = @" Desc: "
                        };
                        divValor.Controls.Add(label);
                        label = new Label {
                            Text = @"-", Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                        };
                        divValor.Controls.Add(label);
                    }
                    break;

                case "EST":
                    if (ultimaMedicion != null)
                    {
                        fechaUltimaMedicion = ultimaMedicion.FechaMedicion > fechaUltimaMedicion
                                                      ? ultimaMedicion.FechaMedicion
                                                      : fechaUltimaMedicion;


                        //EVALUO CHECK
                        var ultimoCheckPoint =
                            DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                              new[] { Convert.ToInt32(MessageIdentifier.CheckpointReached).ToString() });

                        if (ultimoCheckPoint != null)
                        {
                            label = new Label {
                                Text = @"Último Control: ", ForeColor = Color.FromArgb(66, 66, 66)
                            };
                            divValor.Controls.Add(label);
                            label = new Label
                            {
                                Height    = Unit.Pixel(10),
                                ForeColor = Color.FromArgb(66, 66, 66),
                                Text      = ultimoCheckPoint.Fecha.ToDisplayDateTime().ToString("dd/MM/yyyy HH:mm")
                            };
                            divValor.Controls.Add(label);
                        }
                        else
                        {
                            //EVALUO 911
                            label = new Label {
                                Text = @" 911: ", ForeColor = Color.FromArgb(66, 66, 66)
                            };
                            divValor.Controls.Add(label);
                            label = new Label {
                                Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                            };

                            var ultimoEvento911 =
                                DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                  new[] { Convert.ToInt32(MessageIdentifier.KeyboardButton1).ToString() });

                            if (ultimoEvento911 != null &&
                                ultimoEvento911.Fecha > DateTime.UtcNow.AddMinutes(-10))
                            {
                                label.Text = @"On";
                            }
                            else
                            {
                                label.Text = @"Off";
                            }
                            divValor.Controls.Add(label);

                            //EVALUO AMBULANCIA
                            label = new Label {
                                Text = @" Amb: ", ForeColor = Color.FromArgb(66, 66, 66)
                            };
                            divValor.Controls.Add(label);
                            label = new Label {
                                Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                            };

                            var ultimoEventoAmbulancia =
                                DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                  new[] { Convert.ToInt32(MessageIdentifier.KeyboardButton2).ToString() });

                            if (ultimoEventoAmbulancia != null &&
                                ultimoEventoAmbulancia.Fecha > DateTime.UtcNow.AddMinutes(-10))
                            {
                                label.Text = @"On";
                            }
                            else
                            {
                                label.Text = @"Off";
                            }
                            divValor.Controls.Add(label);

                            //EVALUO BOMBEROS
                            label = new Label {
                                Text = @" Bomb: ", ForeColor = Color.FromArgb(66, 66, 66)
                            };
                            divValor.Controls.Add(label);
                            label = new Label {
                                Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                            };

                            var ultimoEventoBombero =
                                DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                  new[] { Convert.ToInt32(MessageIdentifier.KeyboardButton3).ToString() });

                            if (ultimoEventoBombero != null &&
                                ultimoEventoBombero.Fecha > DateTime.UtcNow.AddMinutes(-10))
                            {
                                label.Text = @"On";
                            }
                            else
                            {
                                label.Text = @"Off";
                            }
                            divValor.Controls.Add(label);
                        }
                    }
                    else
                    {
                        label = new Label {
                            Text = @" 911: - Amb: - Bomb: -", Height = Unit.Pixel(10), ForeColor = Color.FromArgb(66, 66, 66)
                        };
                        divValor.Controls.Add(label);
                    }
                    break;

                case "NU":
                    if (ultimaMedicion != null)
                    {
                        fechaUltimaMedicion = ultimaMedicion.FechaMedicion > fechaUltimaMedicion
                                                      ? ultimaMedicion.FechaMedicion
                                                      : fechaUltimaMedicion;

                        label.Text = ultimaMedicion.Valor;
                        divValor.Controls.Add(label);
                    }
                    else
                    {
                        label.Text = @"-";
                        divValor.Controls.Add(label);
                    }
                    break;

                case "TIME":
                    if (ultimaMedicion != null)
                    {
                        fechaUltimaMedicion = ultimaMedicion.FechaMedicion > fechaUltimaMedicion
                                                      ? ultimaMedicion.FechaMedicion
                                                      : fechaUltimaMedicion;

                        var time = new TimeSpan(0, 0, 0, int.Parse(ultimaMedicion.Valor));
                        label.Text = time.ToString();
                        divValor.Controls.Add(label);
                    }
                    else
                    {
                        label.Text = @"-";
                        divValor.Controls.Add(label);
                    }
                    break;

                default:
                    if (ultimaMedicion != null)
                    {
                        fechaUltimaMedicion = ultimaMedicion.FechaMedicion > fechaUltimaMedicion
                                                      ? ultimaMedicion.FechaMedicion
                                                      : fechaUltimaMedicion;

                        label.Text = ultimaMedicion.Valor;
                        divValor.Controls.Add(label);
                    }
                    else
                    {
                        label.Text = @"-";
                        divValor.Controls.Add(label);
                    }
                    break;
                }

                label = new Label {
                    Text = @"<br/>"
                };
                divValor.Controls.Add(label);
            }

            lblFechaPosicion.Text = fechaUltimaMedicion != DateTime.MinValue ? fechaUltimaMedicion.ToDisplayDateTime().ToString("dddd dd \"de\" MMMM \"de\" yyyy HH:mm:ss") : "-";

            try
            {
                lblPosicion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(entidad.ReferenciaGeografica.Latitude, entidad.ReferenciaGeografica.Longitude);
            }
            catch
            {
                lblPosicion.Text = @"Posición erronea.";
            }
        }
Ejemplo n.º 12
0
        public void ProcessArchivo(LogicLinkFile archivo)
        {
            archivo.Status = LogicLinkFile.Estados.Procesando;
            DaoFactory.LogicLinkFileDAO.SaveOrUpdate(archivo);

            using (var transaction = SmartTransaction.BeginTransaction())
            {
                try
                {
                    STrace.Trace(Component, "Procesando con Estrategia: " + archivo.Strategy);
                    var rutas               = 0;
                    var entregas            = 0;
                    var clientes            = 0;
                    var asignaciones        = 0;
                    var result              = string.Empty;
                    var observaciones       = string.Empty;
                    ViajeDistribucion viaje = null;

                    switch (archivo.Strategy)
                    {
                    case LogicLinkFile.Estrategias.DistribucionFemsa:
                        DistribucionFemsa.Parse(archivo, out rutas, out entregas);
                        _update = true;
                        result  = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                        break;

                    case LogicLinkFile.Estrategias.DistribucionQuilmes:
                        DistribucionQuilmes.Parse(archivo, out rutas, out entregas, out observaciones);
                        _update = true;
                        result  = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                        if (observaciones != string.Empty)
                        {
                            result = result + " (" + observaciones + ")";
                        }
                        break;

                    case LogicLinkFile.Estrategias.DistribucionMusimundo:
                        DistribucionMusimundo.Parse(archivo, out rutas, out entregas, out observaciones);
                        _update = true;
                        result  = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                        if (observaciones != string.Empty)
                        {
                            result = result + " (" + observaciones + ")";
                        }
                        break;

                    case LogicLinkFile.Estrategias.DistribucionBrinks:
                        //DistribucionBrinks.Parse(archivo, out rutas, out entregas);
                        break;

                    case LogicLinkFile.Estrategias.DistribucionSos:
                        viaje  = DistribucionSos.Parse(archivo, out rutas, out entregas);
                        result = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                        break;

                    case LogicLinkFile.Estrategias.DistribucionReginaldLee:
                        DistribucionReginaldLee.Parse(archivo, out rutas, out entregas);
                        _update = true;
                        result  = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                        break;

                    case LogicLinkFile.Estrategias.DistribucionCCU:
                        var extension = GetFileName(archivo.FilePath);
                        switch (extension)
                        {
                        case "Rutas.xlsx":
                            DistribucionCCU.ParseRutas(archivo, out rutas, out entregas, out observaciones);
                            _update = true;
                            result  = string.Format("Archivo procesado exitosamente. Rutas: {0} - Entregas: {1}", rutas, entregas);
                            break;

                        case "Clientes.xlsx":
                            DistribucionCCU.ParseClientes(archivo, out clientes);
                            result = string.Format("Archivo procesado exitosamente. Clientes: {0}", clientes);
                            break;

                        case "Asigno.xlsx":
                            DistribucionCCU.ParseAsignaciones(archivo, out asignaciones, out observaciones);
                            result = string.Format("Archivo procesado exitosamente. Asignaciones: {0}", asignaciones);
                            break;

                        default:
                            result = string.Format("Extensión '" + extension + "' no válida.");
                            break;
                        }
                        break;

                    case LogicLinkFile.Estrategias.PedidosPetrobras:
                        var pedidos = 0;
                        PedidosPetrobras.Parse(archivo, out pedidos, out observaciones);
                        result = string.Format("Archivo procesado exitosamente. Pedidos: {0}", pedidos);
                        if (observaciones != string.Empty)
                        {
                            result = result + " (" + observaciones + ")";
                        }
                        break;

                    case LogicLinkFile.Estrategias.AsignacionClienteEmpleado:
                        var asignados = 0;
                        AsignacionClienteEmpleado.Parse(archivo, out asignados, out observaciones);
                        result = string.Format("Archivo procesado exitosamente. Asignados: {0}", asignados);
                        if (observaciones != string.Empty)
                        {
                            result = result + " (" + observaciones + ")";
                        }
                        break;

                    case LogicLinkFile.Estrategias.AsignacionCodigoViaje:
                        var viajes = 0;
                        AsignacionCodigoViaje.Parse(archivo, out viajes, out observaciones);
                        result = string.Format("Archivo procesado exitosamente. Viajes: {0}", viajes);
                        if (observaciones != string.Empty)
                        {
                            result = result + " (" + observaciones + ")";
                        }
                        break;
                    }

                    archivo.Status        = LogicLinkFile.Estados.Procesado;
                    archivo.DateProcessed = DateTime.UtcNow;
                    archivo.Result        = result;
                    DaoFactory.LogicLinkFileDAO.SaveOrUpdate(archivo);

                    transaction.Commit();

                    if (archivo.Strategy == LogicLinkFile.Estrategias.DistribucionSos)
                    {
                        if (viaje != null)
                        {
                            foreach (var detalle in viaje.Detalles)
                            {
                                if (detalle.PuntoEntrega != null && detalle.PuntoEntrega.ReferenciaGeografica != null)
                                {
                                    _update = true;
                                }
                            }

                            if (viaje.Vehiculo != null && viaje.Estado == ViajeDistribucion.Estados.Pendiente)
                            {
                                var tieneViajeEnCurso = DaoFactory.ViajeDistribucionDAO.FindEnCurso(viaje.Vehiculo) != null;
                                if (!tieneViajeEnCurso)
                                {
                                    //var ciclo = new CicloLogisticoDistribucion(viaje, DaoFactory,
                                    //    new MessageSaver(DaoFactory));
                                    //var evento = new InitEvent(DateTime.UtcNow);
                                    //ciclo.ProcessEvent(evento);
                                }
                                if (viaje.Vehiculo.Dispositivo != null)
                                {
                                    var msg   = new StringBuilder();
                                    var desde = viaje.Detalles[1].ReferenciaGeografica;
                                    var hasta = viaje.Detalles[2].ReferenciaGeografica;
                                    msg.Append("Viaje: " + viaje.Codigo);
                                    msg.Append("<br>Desde: " + GeocoderHelper.GetDescripcionEsquinaMasCercana(desde.Latitude, desde.Longitude));
                                    msg.Append("<br>Hasta: " + GeocoderHelper.GetDescripcionEsquinaMasCercana(hasta.Latitude, hasta.Longitude));

                                    var message = MessageSender.CreateSubmitTextMessage(viaje.Vehiculo.Dispositivo, new MessageSaver(DaoFactory));
                                    message.AddMessageText(msg.ToString());
                                    message.Send();

                                    //STrace.Trace(Component, "Ruta Aceptada: " + MessageCode.RutaAceptada.ToString());
                                    //STrace.Trace(Component, "Ruta Rechazada: " + MessageCode.RutaRechazada.ToString());

                                    //var msgText = "Acepta la asignacion del servicio <br><b>" + viaje.Codigo + "</b>?";
                                    //var replies = new[] { Convert.ToUInt32(MessageCode.RutaAceptada.ToString()),
                                    //                      Convert.ToUInt32(MessageCode.RutaRechazada.ToString()) };
                                    //message = MessageSender.CreateSubmitCannedResponsesTextMessage(viaje.Vehiculo.Dispositivo, new MessageSaver(DaoFactory));
                                    //message.AddMessageText(msgText)
                                    //       .AddTextMessageId(Convert.ToUInt32(viaje.Id))
                                    //       .AddCannedResponses(replies)
                                    //       .AddAckEvent(MessageCode.GarminCannedMessageReceived.GetMessageCode());

                                    //message.Send();
                                }
                            }
                        }
                    }

                    STrace.Trace(Component, result);
                }
                catch (Exception ex)
                {
                    AddError(ex);
                    transaction.Rollback();
                    ClearData();

                    archivo.Status = LogicLinkFile.Estados.Cancelado;
                    var result = "Archivo procesado erroneamente. Exception: " + ex.Message;
                    archivo.Result = result;
                    DaoFactory.LogicLinkFileDAO.SaveOrUpdate(archivo);

                    STrace.Trace(Component, result);
                }
                finally
                {
                    ClearData();
                }
            }
        }
Ejemplo n.º 13
0
        public void RaiseCallbackEvent(string eventArgument)
        {
//            _inCallback = true;
            var idx       = eventArgument.IndexOf(':');
            var eventName = eventArgument.Substring(0, idx);
            var eventArgs = eventArgument.Length > idx?eventArgument.Substring(idx + 1) : "";

            switch (eventName)
            {
            case "Tick":
                OnTick(eventArgs);
                break;

            case "Click":
                var clickCoord = ParseCoord(eventArgs);
                if (clickCoord != null)
                {
                    OnClick(clickCoord.Latitud, clickCoord.Longitud);
                }
                break;

            case "MarkAddress":
                var markCoord = ParseCoord(eventArgs);
                if (markCoord != null)
                {
                    var dir = GeocoderHelper.GetDescripcionEsquinaMasCercana(markCoord.Latitud, markCoord.Longitud);
                    AddMarkers(GeocoderMarkersLayer, MarkerFactory.CreateMarker("0", DefaultMarkerIcon, markCoord.Latitud, markCoord.Longitud, dir));
                }
                break;

            //case "ContextMenuCallback":
            //    break;
            case "DrawPolygon":
                var points = ParsePolygon(eventArgs);
                OnDrawPolygon(points);
                break;

            case "DrawSquare":
                var bounds = ParseSquare(eventArgs);
                OnDrawSquare(bounds);
                break;

            case "DrawCircle":
                var circle = ParseCircle(eventArgs);
                if (circle != null)
                {
                    OnDrawCircle(circle.Latitud, circle.Longitud, circle.Radio);
                }
                break;

            case "DrawLine":
                var pointsPath = ParseLine(eventArgs);
                OnDrawLine(pointsPath);
                break;

            default:
                var args         = eventArgs.Split(',');
                var defaultCoord = ParseCoord(eventArgs);
                if (defaultCoord != null)
                {
                    OnCallback(eventName, args[2], defaultCoord.Latitud, defaultCoord.Longitud);
                }
                break;
            }
//            _inCallback = false;
        }
Ejemplo n.º 14
0
        protected void TimerGeocoderTick(object sender, EventArgs e)
        {
            if (LoadStep == 0)
            {
                // Paso 0: Direccion - Geocoder
                try
                {
                    var latlon = lblPosicion.Text.TrimStart('(').TrimEnd(')').Split(',');
                    var lat    = Convert.ToDouble(latlon[0].Trim(), CultureInfo.InvariantCulture);
                    var lon    = Convert.ToDouble(latlon[1].Trim(), CultureInfo.InvariantCulture);

                    lblPosicion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(lat, lon);
                }
                catch
                {
                    lblPosicion.Text = "No se encontró posición.";
                }
                LoadStep = 1;
            }
            else if (LoadStep == 1)
            {
                // Paso 1: Ultimo Login
                var lastFrid = DAOFactory.LogUltimoLoginDAO.GetLastVehicleRfidEvent(pageCoche);
                if (lastFrid != null)
                {
                    var chofer = lastFrid.Chofer ?? CultureManager.GetLabel("REVISAR_TARJETA");
                    lblLastRfid.Text = string.Format("{0} ({1})", chofer, lastFrid.Fecha.Value.ToDisplayDateTime());
                }
                divUltimoLogin.Visible = lastFrid != null;
                LoadStep = 2;
            }
            else if (LoadStep == 2)
            {
                // Paso 2: Solapa Ticket
                LoadTicket(pageCoche);
                LoadStep = 3;
            }
            else if (LoadStep == 3)
            {
                // Paso 3: Trabajando para... Clientes
                lblClientes.Text    = pageCoche.Clientes.Cast <Cliente>().Aggregate(String.Empty, (current, c) => String.Concat(current, c.DescripcionCorta));
                divClientes.Visible = !string.IsNullOrEmpty(lblClientes.Text);
                LoadStep            = 4;
            }
            else if (LoadStep == 4)
            {
                // Paso 4: Vehiculos Cercanos
                var pos = SharedPositions.GetLastPositions(new List <Coche> {
                    pageCoche
                }).FirstOrDefault();
                if (pos != null)
                {
                    VehiculosCercanos(pageCoche, pos);
                }
                LoadStep = 5;
            }
            else if (LoadStep == 5)
            {
                // Paso 5: Solapa Rutaa
                LoadRuta(pageCoche);
                timerGeocoder.Enabled = false;
            }
        }
Ejemplo n.º 15
0
        protected void ShowEvento(LogEvento evento)
        {
            var iconDir = IconDir;

            var color = evento.Accion != null
                            ? Color.FromArgb(100, evento.Accion.Red, evento.Accion.Green, evento.Accion.Blue)
                            : Color.Gray;

            panelTitle.BackColor = color;
            panelTitle.ForeColor = color.GetBrightness() < 40 ? Color.White : Color.Black;

            if (evento.Accion != null && evento.Accion.PopIcon > 0)
            {
                imgAccion.ImageUrl = string.Format("{0}/{1}", iconDir, evento.Accion.PopUpIcon.PathIcono);
            }
            else
            {
                imgAccion.Visible = false;
            }

            lbMensaje.Text     = evento.Texto;
            lblHora.Text       = evento.Fecha.ToDisplayDateTime().ToString("dd \"de\" MMMM \"de\" yyyy HH:mm");
            lblEntidad.Text    = evento.SubEntidad != null ? evento.SubEntidad.Entidad.Descripcion : string.Empty;
            lblSubEntidad.Text = evento.SubEntidad != null ? evento.SubEntidad.Descripcion : string.Empty;
            if (evento.SubEntidad != null)
            {
                foreach (DetalleValor detalle in evento.SubEntidad.Entidad.Detalles)
                {
                    var valor = string.Empty;
                    switch (detalle.Detalle.Tipo)
                    {
                    case 1:
                        valor = detalle.ValorStr;
                        break;

                    case 2:
                        valor = detalle.ValorNum.ToString("#0.00");
                        break;

                    case 3:
                        valor = detalle.ValorDt.HasValue ? detalle.ValorDt.Value.ToString("dd/MM/yyyy HH:mm") : string.Empty;
                        break;
                    }

                    var lbl = new Label {
                        Text = @"<b>" + detalle.Detalle.Nombre + @":</b> " + valor + @"<br/><br/>"
                    };
                    panelDetalles.Controls.Add(lbl);
                }

                lblDireccion.Text = GeocoderHelper.GetDescripcionEsquinaMasCercana(evento.SubEntidad.Entidad.ReferenciaGeografica.Latitude, evento.SubEntidad.Entidad.ReferenciaGeografica.Longitude);
            }

            Monitor1.ImgPath          = Config.Monitor.GetMonitorImagesFolder(this);
            Monitor1.GoogleMapsScript = GoogleMapsKey;
            Monitor1.EnableTimer      = false;
            Monitor1.AddLayers(LayerFactory.GetGoogleStreet(CultureManager.GetLabel("LAYER_GSTREET"), 8),
                               //LayerFactory.GetCompumap(CultureManager.GetLabel("LAYER_COMPUMAP"), Config.Map.CompumapTiles, 8),
                               LayerFactory.GetOpenStreetMap(CultureManager.GetLabel("LAYER_OSM")),
                               LayerFactory.GetGoogleSatellite(CultureManager.GetLabel("LAYER_GSAT"), 8),
                               LayerFactory.GetGoogleHybrid(CultureManager.GetLabel("LAYER_GHIBRIDO"), 8),
                               LayerFactory.GetGooglePhysical(CultureManager.GetLabel("LAYER_GFISICO"), 8),
                               LayerFactory.GetMarkers(LayerEntidades, true));
            Monitor1.AddControls(ControlFactory.GetLayerSwitcher(), ControlFactory.GetNavigation());

            if (evento.SubEntidad != null)
            {
                Monitor1.SetCenter(evento.SubEntidad.Entidad.ReferenciaGeografica.Latitude, evento.SubEntidad.Entidad.ReferenciaGeografica.Longitude, 7);
                var imgEntidad = string.Format("{0}{1}", iconDir, evento.SubEntidad.Entidad.ReferenciaGeografica.Icono.PathIcono);

                Monitor1.AddMarkers(LayerEntidades, MarkerFactory.CreateMarker(evento.SubEntidad.Entidad.Id.ToString("#0"),
                                                                               imgEntidad,
                                                                               evento.SubEntidad.Entidad.ReferenciaGeografica.Latitude,
                                                                               evento.SubEntidad.Entidad.ReferenciaGeografica.Longitude));
            }

            if (evento.Estado > 0)
            {
                btAceptar.Visible  = false;
                btIgnorar.ImageUrl = "~/Operacion/btAtras.gif";
            }
        }