Example #1
0
        public static DataTable InsertaHuella(HuellaDactilar huella, string Coneccion)
        {
            SqlCommand _comando = AccesoDatos.InsertaHuella(huella, Coneccion);

            _comando.CommandType = CommandType.StoredProcedure;
            return(AccesoDatos.EjecutarComando(_comando));
        }
Example #2
0
        /// <summary>
        /// Recupera la huella de un UsuarioID especifico.
        /// Nota: El usuarioId Interno del lector no debe superar los 9 caracteres
        /// </summary>
        /// <param name="usuarioID"></param>
        /// <returns></returns>
        public string RecuperarHuella(string usuarioID)
        {
            int    iTmpLength;
            string ibyTmpData;

            lectorObject.EnableDevice(Dispositivo, false);
            lectorObject.ReadAllTemplate(Dispositivo);
            if (lectorObject.GetUserTmpExStr(Dispositivo, usuarioID, iFingerIndex, out iFlag, out ibyTmpData, out iTmpLength))
            {
                HuellaDactilar h = new HuellaDactilar();
                lectorObject.RefreshData(Dispositivo);
                lectorObject.EnableDevice(Dispositivo, true);
                lectorObject.PlayVoiceByIndex(9);
                h.Identidad   = usuarioID;
                h.FingerIndex = iFingerIndex;
                h.byTmpData   = ibyTmpData;
                h.TmpLength   = iTmpLength;
                return(h.ToJSON());
            }
            else
            {
                lectorObject.RefreshData(Dispositivo);
                lectorObject.EnableDevice(Dispositivo, true);
                return(null);
            }
        }
        public static SqlCommand InsertaHuella(HuellaDactilar huella, string Coneccion)
        {
            string        _cadenaconexion = Coneccion;
            SqlConnection _conexion       = new SqlConnection(_cadenaconexion);
            SqlCommand    _comando        = new SqlCommand("SP_INSERTA_HUELLA_VOTECHAIN", _conexion);

            _comando.Parameters.AddWithValue("@Nombre", huella.nombre);
            _comando.Parameters.AddWithValue("@huella", huella.huella);
            _comando.Connection.Close();
            return(_comando);
        }
        protected void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));

            // Process the sample and create a feature set for the enrollment purpose.
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            // Check quality of the sample and start verification if it's good
            // TODO: move to a separate task
            if (features != null)
            {
                // Compare the feature set with our template
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                Stream stream;

                DataTable      dt             = new DataTable();
                HuellaDactilar huellaDactilar = new HuellaDactilar();
                dt = PreparandoAcceso.BuscaHuellas(huellaDactilar.conex);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string huella     = dt.Rows[i][1].ToString();
                    byte[] byteHuella = dt.Rows[i][1] as byte[];
                    stream   = new MemoryStream(byteHuella);
                    Template = new DPFP.Template(stream);

                    Verificator.Verify(features, Template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MakeReport($"Huella Aceptada de {dt.Rows[i][0]}");
                        Votacion Votacion = new Votacion();

                        MessageBox.Show(new Form()
                        {
                            TopMost = true
                        }, $"Huella Aceptada de { dt.Rows[i][0]}");
                        Votacion.ShowDialog();

                        break;
                    }
                }
            }
        }
        public static DataTable EjecutarComando(SqlCommand _comando)
        {
            HuellaDactilar huella = new HuellaDactilar();

            DataTable _tabla = new DataTable();

            try
            {
                _comando.Connection.Open();
                SqlDataAdapter _adaptador = new SqlDataAdapter();
                _adaptador.SelectCommand = _comando;
                _adaptador.Fill(_tabla);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _comando.Connection.Close();
            }
            return(_tabla);
        }
Example #6
0
 /// <summary>
 /// Recupera la huella de un UsuarioID especifico.
 /// Nota: El usuarioId Interno del lector no debe superar los 9 caracteres
 /// </summary>
 /// <param name="usuarioID"></param>
 /// <returns></returns>
 public string RecuperarHuella(string usuarioID)
 {
     int iTmpLength;
     string ibyTmpData;
     lectorObject.EnableDevice(Dispositivo, false);
     lectorObject.ReadAllTemplate(Dispositivo);
     if (lectorObject.GetUserTmpExStr(Dispositivo, usuarioID, iFingerIndex, out iFlag, out ibyTmpData, out iTmpLength))
     {
         HuellaDactilar h = new HuellaDactilar();
         lectorObject.RefreshData(Dispositivo);
         lectorObject.EnableDevice(Dispositivo, true);
         lectorObject.PlayVoiceByIndex(9);
         h.Identidad = usuarioID;
         h.FingerIndex = iFingerIndex;
         h.byTmpData = ibyTmpData;
         h.TmpLength = iTmpLength;
         return h.ToJSON();
     }
     else
     {
         lectorObject.RefreshData(Dispositivo);
         lectorObject.EnableDevice(Dispositivo, true);
         return null;
     }
 }