Ejemplo n.º 1
0
        private void LoadAlarmas(EntidadPadre entidad, SubEntidad subEntidad)
        {
            var alarmas = DAOFactory.LogEventoDAO.GetByEntitiesAndCodes(new List <int> {
                entidad.Id
            },
                                                                        new List <string> {
                _codigoPolicia, _codigoBomberos, _codigoAmbulancia, _codigoExcesoTemperatura, _codigoBajaTemperatura, _codigoDesconexionTemperatura
            },
                                                                        dtDesde.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtDesde.SelectedDate.Value) : DateTime.MinValue,
                                                                        dtHasta.SelectedDate.HasValue ? SecurityExtensions.ToDataBaseDateTime(dtHasta.SelectedDate.Value) : DateTime.MinValue);
            var validas = alarmas.Where(alarma => alarma.Sensor != null &&
                                        (subEntidad == null ||
                                         alarma.SubEntidad.Id == subEntidad.Id))
                          .ToList();

            gridAlarmas.Columns[0].HeaderText = CultureManager.GetLabel("DATE");
            gridAlarmas.Columns[1].HeaderText = CultureManager.GetEntity("PARENTI79");
            gridAlarmas.Columns[2].HeaderText = CultureManager.GetEntity("PARENTI81");
            gridAlarmas.Columns[3].HeaderText = CultureManager.GetLabel("TEXTO");
            gridAlarmas.DataSource            = validas;
            gridAlarmas.DataBind();

            lblTitAlarma.Text = subEntidad != null
                                    ? CultureManager.GetLabel("ALARMAS_SUBENTIDAD") + @" " + subEntidad.Descripcion + @":"
                                    : CultureManager.GetLabel("ALARMAS_ENTIDAD") + @" " + entidad.Descripcion + @":";

            lblTitAlarma.Visible  = true;
            gridAlarmas.Visible   = validas.Count > 0;
            lblSinAlarmas.Visible = validas.Count == 0;
        }
Ejemplo n.º 2
0
        protected void AddMarker(EntidadPadre entidad, string style)
        {
            if (entidad != null)
            {
                var icono = IconDir;
                if (entidad.ReferenciaGeografica != null && entidad.ReferenciaGeografica.Icono != null)
                {
                    icono += entidad.ReferenciaGeografica.Icono.PathIcono;
                }

                var desc             = entidad.Descripcion;
                var refGeo           = entidad.ReferenciaGeografica;
                var vehiculoAsociado = DAOFactory.CocheDAO.FindMobileByDevice(entidad.Dispositivo.Id);
                var ultimaPosicion   = vehiculoAsociado != null?DAOFactory.LogPosicionDAO.GetLastVehiclesPositions(new List <Coche> {
                    vehiculoAsociado
                })[vehiculoAsociado.Id] : null;

                var latitud  = ultimaPosicion != null ? ultimaPosicion.Latitud : refGeo != null ? refGeo.Latitude : 0;
                var longitud = ultimaPosicion != null ? ultimaPosicion.Longitud : refGeo != null ? refGeo.Longitude : 0;
                var marker   = MarkerFactory.CreateLabeledMarker(entidad.Id.ToString("#0"), icono, latitud, longitud, desc, style, GetMovilPopupContent(entidad));

                if (refGeo != null && refGeo.Icono != null)
                {
                    marker.Size   = DrawingFactory.GetSize(refGeo.Icono.Width, refGeo.Icono.Height);
                    marker.Offset = DrawingFactory.GetOffset(refGeo.Icono.OffsetX, refGeo.Icono.OffsetY);
                }

                Monitor.AddMarkers(LayerEntidades, marker);
            }
        }
Ejemplo n.º 3
0
        private Medicion GetUltimaMedicion(EntidadPadre entidad, DateTime fecha, int idSensor)
        {
            var subEntidades = DAOFactory.SubEntidadDAO.GetList(new[] { entidad.Empresa.Id },
                                                                new[] { entidad.Linea != null ? entidad.Linea.Id : -1 },
                                                                new[] { entidad.TipoEntidad != null ? entidad.TipoEntidad.Id : -1 },
                                                                new[] { entidad.Id },
                                                                new[] { entidad.Dispositivo != null ? entidad.Dispositivo.Id : -1 },
                                                                new[] { idSensor });
            Medicion ultimaMedicion = null;

            foreach (var subEntidad in subEntidades)
            {
                if (subEntidad.Sensor == null)
                {
                    return(null);
                }

                var medicion = DAOFactory.MedicionDAO.GetUltimaMedicionHasta(subEntidad.Sensor.Dispositivo.Id, subEntidad.Sensor.Id, fecha);

                if (medicion != null && (ultimaMedicion == null || ultimaMedicion.FechaMedicion < medicion.FechaMedicion))
                {
                    ultimaMedicion = medicion;
                }
            }

            return(ultimaMedicion);
        }
Ejemplo n.º 4
0
        private string GetMovilPopupContent(EntidadPadre entidad)
        {
            var empresa = IdEmpresa;

            var linea = IdLinea.Count == 1 ? IdLinea.FirstOrDefault() : -1;

            return("javascript:getEntP(" + entidad.Id + ",'" + empresa + "','" + linea + "')");
        }
Ejemplo n.º 5
0
 public EntidadVo(EntidadPadre entidad)
 {
     Id          = entidad.Id;
     Codigo      = entidad.Codigo;
     Descripcion = entidad.Descripcion;
     Dispositivo = entidad.Dispositivo.Codigo;
     TipoEntidad = entidad.TipoEntidad.ToString();
 }
Ejemplo n.º 6
0
        private void LoadDetalles(EntidadPadre entidad)
        {
            var detalles = entidad.Detalles.Cast <DetalleValor>().Where(d => !d.Detalle.Baja);

            gridDetalles.Columns[0].HeaderText = CultureManager.GetLabel("DESCRIPCION");
            gridDetalles.Columns[1].HeaderText = CultureManager.GetLabel("VALOR");
            gridDetalles.DataSource            = detalles;
            gridDetalles.DataBind();

            lblTitDetalles.Text    = CultureManager.GetLabel("DETALLES_ENTIDAD") + @" " + entidad.Descripcion + @":";
            lblTitDetalles.Visible = true;
            pnlDetalles.Visible    = true;
            gridDetalles.Visible   = detalles != null && detalles.Count() > 0;
            lblSinDetalles.Visible = detalles == null || detalles.Count() == 0;
        }
Ejemplo n.º 7
0
        private void LoadSubentidades(EntidadPadre entidad)
        {
            var subentidades = DAOFactory.SubEntidadDAO.GetList(ddlEmpresa.SelectedValues,
                                                                ddlPlanta.SelectedValues,
                                                                ddlTipoEntidad.SelectedValues,
                                                                new[] { entidad.Id },
                                                                new[] { entidad.Dispositivo != null ? entidad.Dispositivo.Id : -1 },
                                                                new[] { -1 });

            gridSubEntidades.Columns[0].HeaderText = CultureManager.GetEntity("PARENTI79");
            gridSubEntidades.Columns[1].HeaderText = CultureManager.GetLabel("DESCRIPCION");
            gridSubEntidades.Columns[2].HeaderText = CultureManager.GetLabel("ULTIMO_REPORTE");
            gridSubEntidades.Columns[3].HeaderText = CultureManager.GetLabel("VALOR");
            gridSubEntidades.Columns[4].HeaderText = CultureManager.GetLabel("ESTADO");
            gridSubEntidades.DataSource            = subentidades;
            gridSubEntidades.DataBind();

            pnlSubEntidades.Visible    = subentidades.Count > 0;
            lblSinSubEntidades.Visible = subentidades.Count == 0;
        }
Ejemplo n.º 8
0
        private string GetMarkerStyle(EntidadPadre entidad)
        {
            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 style = "";

            foreach (var subEntidad in subEntidades)
            {
                var ultimaMedicion = DAOFactory.MedicionDAO.GetUltimaMedicionHasta(subEntidad.Sensor.Dispositivo.Id, subEntidad.Sensor.Id, DateTime.UtcNow);
                var ultimoEventoDescongelamiento = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                                     new[] { Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString("#0"),
                                                                                                             Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonUnpressed).ToString("#0") });
                var ultimoEventoConexion = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                             new[] { Convert.ToInt32(MessageIdentifier.TemperaturePowerReconected).ToString("#0"),
                                                                                                     Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString("#0") });
                var ultimoEventoBotonera = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                             new[] { Convert.ToInt32(MessageIdentifier.KeyboardButton1).ToString("#0"),
                                                                                                     Convert.ToInt32(MessageIdentifier.KeyboardButton2).ToString("#0"),
                                                                                                     Convert.ToInt32(MessageIdentifier.KeyboardButton3).ToString("#0") });

                var enDescogelamiento = ultimoEventoDescongelamiento != null &&
                                        ultimoEventoDescongelamiento.Mensaje != null &&
                                        ultimoEventoDescongelamiento.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString("#0");

                var energiaDesconectada = ultimoEventoConexion != null &&
                                          ultimoEventoConexion.Mensaje != null &&
                                          ultimoEventoConexion.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString("#0");

                var enEmergencia = ultimoEventoBotonera != null && ultimoEventoBotonera.Fecha > DateTime.UtcNow.AddMinutes(-10);

                if (ultimaMedicion != null)
                {
                    switch (ultimaMedicion.TipoMedicion.Codigo)
                    {
                    case "TEMP":
                        if (enDescogelamiento)
                        {
                            style = "ol_marker_labeled_blue";
                        }
                        else
                        {
                            if (energiaDesconectada ||
                                (ultimaMedicion.ValorDouble > subEntidad.Maximo && subEntidad.ControlaMaximo) ||
                                (ultimaMedicion.ValorDouble < subEntidad.Minimo && subEntidad.ControlaMinimo))
                            {
                                return("ol_marker_labeled_red");
                            }

                            if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-3))
                            {
                                if (style != "ol_marker_labeled_blue")
                                {
                                    style = "ol_marker_labeled";
                                }
                            }
                            else
                            {
                                if (style == "")
                                {
                                    style = "ol_marker_labeled_green";
                                }
                            }
                        }
                        break;

                    case "EST":
                        if (enEmergencia)
                        {
                            return("ol_marker_labeled_red");
                        }

                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-3))
                        {
                            if (style != "ol_marker_labeled_blue")
                            {
                                style = "ol_marker_labeled";
                            }
                        }
                        else
                        {
                            if (style == "")
                            {
                                style = "ol_marker_labeled_green";
                            }
                        }
                        break;

                    case "NU":
                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-2))
                        {
                            if (style != "ol_marker_labeled_blue")
                            {
                                style = "ol_marker_labeled";
                            }
                        }
                        else
                        {
                            if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-1))
                            {
                                if (style == "ol_marker_labeled_green" || style == "")
                                {
                                    style = "ol_marker_labeled_yellow";
                                }
                            }
                            else
                            {
                                if (style == "")
                                {
                                    style = "ol_marker_labeled_green";
                                }
                            }
                        }
                        break;

                    default:
                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-2))
                        {
                            if (style != "ol_marker_labeled_blue")
                            {
                                style = "ol_marker_labeled";
                            }
                        }
                        else
                        {
                            if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-1))
                            {
                                if (style == "ol_marker_labeled_green" || style == "")
                                {
                                    style = "ol_marker_labeled_yellow";
                                }
                            }
                            else
                            {
                                if (style == "")
                                {
                                    style = "ol_marker_labeled_green";
                                }
                            }
                        }
                        break;
                    }
                }
            }

            return(style != "" ? style : "ol_marker_labeled");
        }
Ejemplo n.º 9
0
        public void BindDetalles(int idTipoEntidad, EntidadPadre editObject)
        {
            Entidad       = editObject;
            IdTipoEntidad = idTipoEntidad;
            tpDetalles.Controls.Clear();

            if (idTipoEntidad <= 0)
            {
                return;
            }

            var detalles = DAOFactory.DetalleDAO.GetList(new[] { -1 }, new[] { -1 }, new[] { idTipoEntidad }, new[] { -1 });

            foreach (var detalle in detalles)
            {
                var label = new Label {
                    Text = detalle.Nombre
                };
                tpDetalles.Controls.Add(label);

                switch (detalle.Representacion)
                {
                case 1:
                    switch (detalle.Tipo)
                    {
                    case 1:
                        var txt = new TextBox {
                            ID = detalle.Id.ToString()
                        };
                        var valor = editObject != null?editObject.GetDetalle(detalle.Id) : null;

                        if (editObject != null && editObject.Id > 0 && valor != null)
                        {
                            txt.Text = valor.ValorStr;
                        }

                        tpDetalles.Controls.Add(txt);
                        break;

                    case 2:
                        var num = new TextBox {
                            ID = detalle.Id.ToString()
                        };
                        var val = editObject != null?editObject.GetDetalle(detalle.Id) : null;

                        if (editObject != null && editObject.Id > 0 && val != null)
                        {
                            num.Text = val.ValorNum.ToString();
                        }

                        tpDetalles.Controls.Add(num);
                        break;

                    case 3:
                        var dt = new DateTimePicker {
                            ID = detalle.Id.ToString()
                        };
                        var value = editObject != null?editObject.GetDetalle(detalle.Id) : null;

                        if (editObject != null && editObject.Id > 0 && value != null)
                        {
                            dt.SelectedDate = value.ValorDt;
                        }

                        tpDetalles.Controls.Add(dt);
                        break;
                    }
                    break;

                case 2:
                    var lst = new DropDownList {
                        ID = detalle.Id.ToString()
                    };
                    var opciones = detalle.Opciones.Split('|');
                    if (opciones.Length > 0)
                    {
                        foreach (var opcion in opciones)
                        {
                            var valores = opcion.Split('.');
                            if (valores.Length > 1)
                            {
                                lst.Items.Add(new ListItem(valores[valores.Length - 1],
                                                           valores[valores.Length - 2]));
                            }
                        }
                    }

                    var det = editObject != null?editObject.GetDetalle(detalle.Id) : null;

                    lst.SelectedValue = det != null?Convert.ToInt32(det.ValorNum).ToString() : null;

                    tpDetalles.Controls.Add(lst);

                    var dic = LastPostBack;
                    if (dic.ContainsKey(lst.ID))
                    {
                        dic.Remove(lst.ID);
                    }
                    dic.Add(lst.ID, lst.SelectedValue);
                    LastPostBack = dic;
                    break;

                case 3:
                    var mlt = new ListBox
                    {
                        ID            = detalle.Id.ToString(),
                        SelectionMode = ListSelectionMode.Multiple
                    };

                    var options = detalle.Options;

                    if (detalle.HasParent)
                    {
                        var parent = tpDetalles.FindControl(detalle.DetallePadre.Id.ToString()) as ListControl;
                        if (parent != null)
                        {
                            AddParent(detalle.Id.ToString(), parent);
                            options = options.Where(o => o.Parent == parent.SelectedValue).ToList();
                        }
                    }

                    var selectedDet = editObject != null?editObject.GetDetalle(detalle.Id) : null;

                    var selected =
                        (selectedDet != null ? selectedDet.ValorStr.Split('-') : new string[0]).ToList();

                    foreach (var option in options)
                    {
                        var li = new ListItem(option.Text, option.Index)
                        {
                            Selected = selected.Contains(option.Index)
                        };
                        mlt.Items.Add(li);
                    }

                    tpDetalles.Controls.Add(mlt);
                    break;
                }
            }
        }
Ejemplo n.º 10
0
        private string GetIcon(EntidadPadre entidad, DateTime fecha, int idSensor)
        {
            var subEntidades = DAOFactory.SubEntidadDAO.GetList(new[] { entidad.Empresa.Id },
                                                                new[] { entidad.Linea != null ? entidad.Linea.Id : -1 },
                                                                new[] { entidad.TipoEntidad != null ? entidad.TipoEntidad.Id : -1 },
                                                                new[] { entidad.Id },
                                                                new[] { entidad.Dispositivo != null ? entidad.Dispositivo.Id : -1 },
                                                                new[] { idSensor });
            var style = "";

            foreach (var subEntidad in subEntidades)
            {
                if (subEntidad.Sensor == null)
                {
                    continue;
                }

                var ultimaMedicion = DAOFactory.MedicionDAO.GetUltimaMedicionHasta(subEntidad.Sensor.Dispositivo.Id, subEntidad.Sensor.Id, fecha);

                // DESCONGELAMIENTO
                var ultimoEventoDescongelamiento = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                                     new[] { Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString(),
                                                                                                             Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonUnpressed).ToString() });
                var enDescongelamiento = ultimoEventoDescongelamiento != null &&
                                         ultimoEventoDescongelamiento.Mensaje != null &&
                                         ultimoEventoDescongelamiento.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperatureThawingButtonPressed).ToString();
                // CONEXION
                var ultimoEventoConexion = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                             new[] { Convert.ToInt32(MessageIdentifier.TemperaturePowerReconected).ToString(),
                                                                                                     Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString() });
                var energiaDesconectada = ultimoEventoConexion != null &&
                                          ultimoEventoConexion.Mensaje != null &&
                                          ultimoEventoConexion.Mensaje.Codigo == Convert.ToInt32(MessageIdentifier.TemperaturePowerDisconected).ToString();
                // ALARMA BOTONERA
                var ultimoEventoBotonera = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                             new[] { Convert.ToInt32(MessageIdentifier.KeyboardButton1).ToString(),
                                                                                                     Convert.ToInt32(MessageIdentifier.KeyboardButton2).ToString(),
                                                                                                     Convert.ToInt32(MessageIdentifier.KeyboardButton3).ToString() });
                var enEmergencia = ultimoEventoBotonera != null && ultimoEventoBotonera.Fecha > DateTime.UtcNow.AddMinutes(-10);
                // RONDIN
                var ultimoEventoRondin = DAOFactory.LogEventoDAO.GetLastBySensoresAndCodes(new[] { subEntidad.Sensor.Id },
                                                                                           new[] { Convert.ToInt32(MessageIdentifier.CheckpointReached).ToString(),
                                                                                                   Convert.ToInt32(MessageIdentifier.BateryDisconected).ToString(),
                                                                                                   Convert.ToInt32(MessageIdentifier.BateryReConected).ToString(),
                                                                                                   Convert.ToInt32(MessageIdentifier.BateryLow).ToString(),
                                                                                                   Convert.ToInt32(MessageIdentifier.DeviceOpenned).ToString() });

                if (ultimaMedicion != null)
                {
                    //MEDICION DE TEMPERATURA
                    if (ultimaMedicion.TipoMedicion.Codigo.Equals("TEMP"))
                    {
                        if (enDescongelamiento)
                        {
                            style = "button-blue.png|En Descongelamiento";
                        }
                        else
                        if (energiaDesconectada)
                        {
                            _totalConAlarmas++;
                            return("button-black.png|Desconectado");
                        }
                        else
                        {
                            if (ultimaMedicion.ValorDouble > subEntidad.Maximo && subEntidad.ControlaMaximo)
                            {
                                _totalConAlarmas++;
                                return("button-red.png|Exceso Temperatura");
                            }
                            if (ultimaMedicion.ValorDouble < subEntidad.Minimo && subEntidad.ControlaMinimo)
                            {
                                _totalConAlarmas++;
                                return("button-red.png|Exceso Temperatura");
                            }

                            if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-3))
                            {
                                if (style.Split('|')[0] != "button-blue.png")
                                {
                                    style = "button-grey.png|Inactivo";
                                }
                            }
                            else
                            {
                                if (style == "")
                                {
                                    style = "button-green.png|Activo";
                                }
                            }
                        }

                        continue;
                    }

                    //MEDICION DE ESTADO
                    if (ultimaMedicion.TipoMedicion.Codigo.Equals("EST"))
                    {
                        if (enEmergencia)
                        {
                            _totalConAlarmas++;
                            return("button-red.png|En Emergencia");
                        }

                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-3))
                        {
                            if (style.Split('|')[0] != "button-blue.png")
                            {
                                style = "button-grey.png|Inactivo";
                            }
                        }
                        else
                        {
                            if (style == "")
                            {
                                style = "button-green.png|Activo";
                            }
                        }

                        if (ultimoEventoRondin != null && ultimoEventoRondin.Mensaje != null)
                        {
                            var msg = ultimoEventoRondin.Mensaje;
                            if (msg.Codigo == Convert.ToInt32(MessageIdentifier.BateryReConected).ToString() ||
                                msg.Codigo == Convert.ToInt32(MessageIdentifier.BateryLow).ToString() ||
                                msg.Codigo == Convert.ToInt32(MessageIdentifier.DeviceOpenned).ToString())
                            {
                                if (style.Split('|')[0] == "button-green.png" || style == "")
                                {
                                    style = "button-yellow.png|Activo";
                                }
                            }
                        }

                        if (style == "")
                        {
                            style = "button-green.png|Activo";
                        }

                        continue;
                    }

                    //MEDICION NUMERICA
                    if (ultimaMedicion.TipoMedicion.Codigo.Equals("NU"))
                    {
                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-2))
                        {
                            if (style.Split('|')[0] != "button-blue.png")
                            {
                                style = "button-grey.png|Inactivo";
                            }
                        }
                        else
                        {
                            if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-1))
                            {
                                if (style.Split('|')[0] == "button-green.png" || style == "")
                                {
                                    style = "button-yellow.png|Activo";
                                }
                            }
                            else
                            {
                                if (style == "")
                                {
                                    style = "button-green.png|Activo";
                                }
                            }
                        }

                        continue;
                    }

                    if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-2))
                    {
                        if (style.Split('|')[0] != "button-blue.png")
                        {
                            style = "button-grey.png|Inactivo";
                        }
                    }
                    else
                    {
                        if (ultimaMedicion.FechaMedicion < DateTime.UtcNow.AddHours(-1))
                        {
                            if (style.Split('|')[0] == "button-green.png" || style == "")
                            {
                                style = "button-yellow.png|Activo";
                            }
                        }
                        else
                        {
                            if (style == "")
                            {
                                style = "button-green.png|Activo";
                            }
                        }
                    }
                }
                else
                {
                    style = "button-grey.png|Inactivo";
                }
            }

            if (style == "")
            {
                style = "button-grey.png|Inactivo";
            }

            if (style.Contains("green") || style.Contains("yellow"))
            {
                _totalActivos++;
            }
            else
            {
                if (style.Contains("grey"))
                {
                    _totalInactivos++;
                }
                if (style.Contains("blue"))
                {
                    _totalConAlarmas++;
                }
            }

            return(style);
        }