Example #1
0
 private void EstablecerParametros()
 {
     _verificarHuellaInfo = new VerificarHuellaInfo
     {
         PersonaIdentificar = new PersonaInfo
         {
             id        = Convert.ToInt32(_args[1]),
             estado    = Convert.ToInt16(_args[2]),
             municipio = Convert.ToInt16(_args[3]),
             cereso    = _args[4],
             ano       = Convert.ToInt16(_args[5]),
             folio     = Convert.ToInt32(_args[6])
         },
         Dedo        = _args[7],
         Completo    = _args[8],
         Servicename = _args[9]
     };
 }
        public async Task <VerificarHuellaInfo> BuscarFacialEnTemplates(NSubject subjectBuscar, int idBusqueda)
        {
            #region BuscarHuellaEnTemplates
            var select               = "SELECT ESTADO,MUNICIPIO,CERESO,ANO,FOLIO,FOTO_CENTRO FROM BTS.FICHA ";
            var conn                 = new OracleConnection(_connStr);
            var template             = new byte[] { };
            var subject              = new NSubject();
            var facial               = new NFace();
            var _verificarHuellaInfo = new VerificarHuellaInfo();

            try
            {
                await conn.OpenAsync();

                var cmdSelect = new OracleCommand(select, conn);
                var dr        = await cmdSelect.ExecuteReaderAsync();

                while (await dr.ReadAsync())
                {
                    if (dr.IsDBNull(5) == false)
                    {
                        template = (byte[])dr[5];

                        facial = new NFace();
                        facial.SampleBuffer = new Neurotec.IO.NBuffer(template);

                        subject = new NSubject();
                        subject.Faces.Add(facial);

                        var status = await _biometricClient.VerifyAsync(subject, subjectBuscar);

                        var verificationStatus = string.Format("Verification status: {0}", status);

                        if (status == NBiometricStatus.Ok)
                        {
                            _verificarHuellaInfo.Identificado                    = true;
                            _verificarHuellaInfo.PersonaIdentificar.id           = idBusqueda;
                            _verificarHuellaInfo.PersonaIdentificar.Identificado = true;
                            _verificarHuellaInfo.PersonaIdentificar.estado       = dr.GetInt16(0);
                            _verificarHuellaInfo.PersonaIdentificar.municipio    = dr.GetInt16(1);
                            _verificarHuellaInfo.PersonaIdentificar.cereso       = dr.GetString(2);
                            _verificarHuellaInfo.PersonaIdentificar.ano          = dr.GetInt16(3);
                            _verificarHuellaInfo.PersonaIdentificar.folio        = dr.GetInt64(4);

                            await RegistrarMatch(_verificarHuellaInfo.PersonaIdentificar, 1, conn);

                            break;
                        }
                    }
                }
                return(_verificarHuellaInfo);
            }
            catch (Exception ex)
            {
                Utils.LogEvent(ex.Message);
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            #endregion
        }