Exemplo n.º 1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            picHuella.Image        = Properties.Resources.huella;
            gridreserva.DataSource = null;
            codigoReserva          = string.Empty;
            txtNombre.Text         = "";
            txtcedula.Text         = "";
            txtapellido.Text       = "";
            txtdireccion.Text      = "";
            txtsexo.Text           = "";
            txttelefono.Text       = "";

            try
            {
                string         strDatos       = string.Empty;
                clsBasedeDatos clsBasedeDatos = null;
                clsNeur.Cerrar = false;
                frm            = new frmCapturando();

                ThreadStart delegado  = new ThreadStart(timer1_Tick);
                Thread      _HiloToma = new Thread(delegado);
                _HiloToma.Start();



                frm.ShowDialog();

                if (ret == true)
                {
                    clsBasedeDatos = new clsBasedeDatos();

                    strDatos = clsBasedeDatos.ConsultarPersonaVerificacion(lbDatabase.SelectedItem.ToString());
                    if (strDatos != "")
                    {
                        string[] datos = strDatos.Split('*');
                        txtcedula.Text    = lbDatabase.SelectedItem.ToString();
                        txtNombre.Text    = datos[0];
                        txtapellido.Text  = datos[1];
                        txttelefono.Text  = datos[3];
                        txtsexo.Text      = datos[4];
                        txtdireccion.Text = datos[5];
                        picHuella.Image   = ((CData)lbDatabase.SelectedItem).EngineUser.GetBitmap();

                        DataTable ds = clsBasedeDatos.ConsultarReserva(txtcedula.Text);
                        if (ds != null)
                        {
                            codigoReserva          = ds.Rows[0]["Reserva"].ToString();
                            gridreserva.DataSource = ds;
                            MessageBox.Show("Validacion realizada correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                        else
                        {
                            gridreserva.DataSource = null;
                            MessageBox.Show("la Persona no tiene reservas Activas", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {
                        gridreserva.DataSource = null;

                        MessageBox.Show("la huella colocada no se encuentra registrada", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    if (Huella == "0")
                    {
                        gridreserva.DataSource = null;

                        MessageBox.Show("Se ha vencido el tiempo de espera de la huella o el scanner esta desconectado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        gridreserva.DataSource = null;

                        MessageBox.Show("la huella colocada no se encuentra registrada", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    picHuella.Image        = Properties.Resources.huella;
                    txtNombre.Text         = "";
                    txtcedula.Text         = "";
                    txtapellido.Text       = "";
                    txtdireccion.Text      = "";
                    txtsexo.Text           = "";
                    txttelefono.Text       = "";
                    gridreserva.DataSource = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void btnVerificar_Click(object sender, EventArgs e)
        {
            pictureBox1.Image = Properties.Resources.huella;
            clsNeur.Cerrar    = false;

            if (string.IsNullOrEmpty(txtcedulaver.Text.Trim()) == false)
            {
                string         ret            = string.Empty;
                clsBasedeDatos clsBasedeDatos = new clsBasedeDatos();

                ret = clsBasedeDatos.ConsultarPersonaVerificacion(txtcedulaver.Text.Trim());

                if (ret != "")
                {
                    string[] datos = ret.Split('*');

                    txtNombrever.Text    = datos[0];
                    txtapellidosver.Text = datos[1];
                    frmCapturando frm = new frmCapturando();
                    usuario = ((CData)lbDatabase.SelectedItem).EngineUser;
                    ThreadStart delegado  = new ThreadStart(timer2);
                    Thread      _HiloToma = new Thread(delegado);
                    _HiloToma.Start();


                    frm.ShowDialog();

                    if (verificationResult.engineStatus == NffvStatus.TemplateCreated)
                    {
                        pictureBox1.Image = ((CData)lbDatabase.SelectedItem).EngineUser.GetBitmap();

                        if (verificationResult.score > 40)
                        {
                            MessageBox.Show("Verificacion Valida", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                        else
                        {
                            pictureBox1.Image = Properties.Resources.huella;
                            MessageBox.Show("Verificacion No Valida", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            txtNombrever.Text    = "";
                            txtapellidosver.Text = "";
                        }
                    }
                    else
                    {
                        pictureBox1.Image = Properties.Resources.huella;

                        MessageBox.Show("ha ocurrido un error al tomar la verificacion" + verificationResult.engineStatus, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    pictureBox1.Image = Properties.Resources.huella;

                    MessageBox.Show("No existe una persona registrada con el numero de cedula ingresado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                pictureBox1.Image = Properties.Resources.huella;

                MessageBox.Show("Debe digitar un numero de Cedula ", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }