public async Task <VerificarHuellaInfo> BuscarHuellaEnTemplates(NSubject subjectBuscar, int idBusqueda) { #region BuscarHuellaEnTemplates var select = "SELECT ESTADO,MUNICIPIO,CERESO,ANO,FOLIO,DEDO,HUELLAIMAGEN,TEMPLATE FROM BTS.HUELLA "; var conn = new OracleConnection(_connStr); var template = new byte[] { }; var subject = new NSubject(); var finger = new NFinger(); 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(6) == false) { template = (byte[])dr[6]; finger = new NFinger(); finger.SampleBuffer = new Neurotec.IO.NBuffer(template); subject = new NSubject(); subject.Fingers.Add(finger); 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 }