예제 #1
0
        private EvaluacionEventoDC_DTO GetDescripcion(tipoEvento tipo, SendEvent_DTO evento)
        {
            bool          eventoAlarmado = false;
            List <string> descripcion    = new List <string>
            {
                tipo.ToString(),                                    //NOMBRE DEL EVENTO
                (bool)evento.tapabocas ? "0" : "1",                 //ALERTA DE TAPABOCAS
                (evento.temperatura <= evento.tempRef) ? "0" : "1", //ALERTA DE TEMPERATURA
                (bool)evento.validaIdentidad? "0" : "1",            //ALERTA DOCUMENTO Y BADGE NO COINCIDEN
                (bool)evento.ecoPassVigente? "0" : "1",
                (bool)evento.PersonaConocida? "0" : "1",
                (bool)evento.BiomeConectado? "0" : "1"
            };

            for (int i = 1; i < descripcion.Count; i++)
            {
                if (descripcion[i] == "1")
                {
                    eventoAlarmado = true;
                }
            }

            return(new EvaluacionEventoDC_DTO
            {
                descripcionEvento = descripcion[0] + "|" + descripcion[1] + "|" + descripcion[2] +
                                    "|" + evento.documento.ToString() + "|" + evento.temperatura.ToString() +
                                    "|" + evento.tempRef.ToString() + "|" + descripcion[3] + "|" + descripcion[4] +
                                    "|" + descripcion[5] + "|" + descripcion[6],
                alarmaEvento = eventoAlarmado
            });
        }
        /// <summary>
        /// Devuelve resultado del analisis de temperatura y tapabocas
        /// </summary>
        /// <param name="tipo">
        /// 0-Ingreso Biometrico, 1-Ingreso Biometrico No Identificado,
        /// 2-Salida Biometrico, 3-Salida Biometrico No identificado
        /// </param>
        /// <param name="evento"></param>
        /// <returns></returns>
        private EvaluacionEvento_DTO GetDescripcion(tipoEvento tipo, SendEvent_DTO evento)
        {
            List <string> descripcion = new List <string>
            {
                tipo.ToString(),                                    //NOMBRE DEL EVENTO
                (bool)evento.tapabocas ? "0" : "1",                 //ALERTA DE TAPABOCAS
                (evento.temperatura <= evento.tempRef) ? "0" : "1", //ALERTA DE TEMPERATURA
                (bool)evento.validaIdentidad? "0" : "1"             //ALERTA DOCUMENTO Y BADGE NO COINCIDEN
            };

            return(new EvaluacionEvento_DTO
            {
                descripcionEvento = descripcion[0] + "|" + descripcion[1] + "|" + descripcion[2] +
                                    "|" + evento.documento.ToString() + "|" + evento.temperatura.ToString() +
                                    "|" + evento.tempRef.ToString() + "|" + descripcion[3],
                alarmaEvento = (descripcion[1] == "1" || descripcion[2] == "1" || descripcion[3] == "1")
            });
        }