Exemple #1
1
        public static bool Verify(DPFP.Sample _sample, DPFP.Template _template)
        {
            try
            {
                bool _result = false;
                DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = zsi.dtrs.Util.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();
                    Verificator.Verify(features, _template, ref result);

                    if (result.Verified)
                    {
                        _result = true;
                    }
                    else
                    {
                        _result = false;
                    }
                }
                return(_result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample,
                                           DPFP.Processing.DataPurpose Purpose)
 {
     DPFP.Processing.FeatureExtraction Extractor = new
                                                   DPFP.Processing.FeatureExtraction(); // Create a feature extractor
     DPFP.Capture.CaptureFeedback feedback =
         DPFP.Capture.CaptureFeedback.None;
     DPFP.FeatureSet features = new DPFP.FeatureSet();
     try
     {
         Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref
                                    features);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     if (feedback == DPFP.Capture.CaptureFeedback.Good)
     {
         return(features);
     }
     else
     {
         return(null);
     }
 }
Exemple #3
0
        public AddStudent(string admin_name)
        {
            InitializeComponent();
            this.adminname = admin_name;
            this.sample    = null;
            string          sql = "select max(Student_Id) from students_accounts";
            string          connectionString = "server=" + host_text + ";port=" + port_text + ";database=" + db_name_text + ";uid=" + db_user_text + ";pwd=" + db_pass_text + ";";
            MySqlConnection cnn = new MySqlConnection(connectionString);
            MySqlCommand    cmd = new MySqlCommand(sql, cnn);

            cnn.Open();
            int             id     = 0;
            MySqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                if (reader[0] == DBNull.Value)
                {
                    id = 1;
                }
                else
                {
                    id = reader.GetInt32(0) + 1;
                }
            }
            s_id.Text = id.ToString();
            cnn.Close();
        }
Exemple #4
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(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();

                DPFP.Template template = new DPFP.Template();
                Stream        stream;

                foreach (var emp in contexto.Empleadoes)
                {
                    stream   = new MemoryStream(emp.Huella);
                    template = new DPFP.Template(stream);

                    Verificator.Verify(features, template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        MakeReport("The fingerprint was VERIFIED. " + emp.Nombre);
                        break;
                    }
                }
            }
        }
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(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();
                Verificator.Verify(features, Template, ref result);
                UpdateStatus(result.FARAchieved);
                if (result.Verified)
                {
                    MakeReport("A impressão digital foi verificada.");
                    MetroFramework.MetroMessageBox.Show(this, "A impressão digital foi verificada com sucesso.", "Verificação biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Question);
                }
                else
                {
                    MakeReport("A impressão digital não foi verificada.");
                    MetroFramework.MetroMessageBox.Show(this, "A impressão digital não encontrada. Tente novamente.", "Verificação biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
                }
            }
        }
        private void verify(DPFP.Sample Sample)
        {
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            byte[] fpbyte = getFTemplate();
            if (fpbyte != null)
            {
                Stream        stream = new MemoryStream(fpbyte);
                DPFP.Template tmpObj = new DPFP.Template(stream);


                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                // Compare the feature set with our template
                Verificator.Verify(features, tmpObj, ref result);
                if (result.Verified)
                {
                    MessageBox.Show("The fingerprint was VERIFIED.");
                    client.Send("desktop-verify-verified");
                }
                else
                {
                    MessageBox.Show("The fingerprint was NOT VERIFIED.");
                    client.Send("desktop-verify-notverified");
                }
            }


            hideForm();
        }
Exemple #7
0
        public static void GetEmployeeMatches(List <Employee> list, DPFP.Sample Sample, int FingerNo)
        {
            OracleConnection conn       = new OracleConnection(ConStr);
            Employee         info       = null;
            string           FingerDesc = Util.GetFingerDesc(FingerNo);

            try
            {
                string        _result = string.Empty;
                string        sql     = "select Empl_Id_No,RTF,RIF,RMF,RRF,RSF,LTF,LIF,LMF,LRF,LSF from EMPTSI";
                OracleCommand command = new OracleCommand(sql, conn);
                command.CommandType = CommandType.Text;
                conn.Open();
                OracleDataReader reader = command.ExecuteReader();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        info = dcEmployee.GetInfo(reader, Sample, FingerDesc);
                        AddInfo(list, info);
                    }
                }
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #8
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(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();
                Verificator.Verify(features, Template, ref result);
                UpdateStatus(result.FARAchieved);
                if (result.Verified)
                {
                    MakeReport("The fingerprint was VERIFIED.");
                }
                else
                {
                    MakeReport("The fingerprint was NOT VERIFIED.");
                }
            }
        }
Exemple #9
0
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
 {
     Console.WriteLine("on complete");
     MakeReport("The fingerprint sample was captured.");
     SetPrompt("Scan the same fingerprint again.");
     Process(Sample);
 }
Exemple #10
0
        public bool ProcesarChecado(DPFP.Sample Sample, DPFP.Template templateGuardado, frmChecarEntradaSalida FrmChecar)
        {
            try
            {
                DrawPictureChecar(ConvertSampleToBitmapLogin(Sample), FrmChecar);
                DPFP.FeatureSet features = ExtractFeaturesChecar(Sample, DPFP.Processing.DataPurpose.Verification);
                if (features != null)
                {
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templateGuardado, ref result);

                    if (result.Verified)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                LogError.AddExcFileTxt(ex, "LectorHuella ~ ProcesarChecado");
                return(false);
            }
        }
Exemple #11
0
 protected Bitmap ConvertSampleToBitmap(DPFP.Sample Sample)
 {
     DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion();
     Bitmap bitmap = null;
     Convertor.ConvertToPicture(Sample, ref bitmap);
     return bitmap;
 }
Exemple #12
0
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
 {
     this.ReaderSerialNumber = ReaderSerialNumber;
     MakeReport("The fingerprint sample was captured.");
     SetPrompt("Scan the same fingerprint again.");
     this.Process(Sample);
 }
Exemple #13
0
 protected DPFP.FeatureSet ExtractFeatures(DPFP.Sample Sample, DPFP.Processing.DataPurpose Purpose)
 {
     DPFP.Processing.FeatureExtraction Extractor = new DPFP.Processing.FeatureExtraction();      // Create a feature extractor
     DPFP.Capture.CaptureFeedback      feedback  = DPFP.Capture.CaptureFeedback.None;
     DPFP.FeatureSet features = new DPFP.FeatureSet();
     Extractor.CreateFeatureSet(Sample, Purpose, ref feedback, ref features);                    // TODO: return features as a result?
     debugFeedback = feedback;
     if (feedback == DPFP.Capture.CaptureFeedback.Good)
     {
         notifyEvent = new FingerArgs(ReaderSerialNumber, FingerArgs.FingerNotify.RN_CaptureGood, "Capture is Good");
         if (NotifyEvent != null)
         {
             NotifyEvent(this, notifyEvent);
         }
         return(features);
     }
     else
     {
         notifyEvent = new FingerArgs(ReaderSerialNumber, FingerArgs.FingerNotify.RN_CaptureBad, feedback.ToString());
         if (NotifyEvent != null)
         {
             NotifyEvent(this, notifyEvent);
         }
         return(null);
     }
 }
Exemple #14
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                for (int x = 0; x < List_Usuarios.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();
                    templeate.DeSerialize(List_Usuarios[x].fingerPrint);

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templeate, ref result);

                    if (result.Verified)
                    {
                        int id_usuario = List_Usuarios[x].id_Cliente;
                        var usuario    = (from cliente in contexto.tb_Usuarios where cliente.id_usuario == id_usuario select cliente).Single();
                        MessageBox.Show("VERIFICADO  " + usuario.nombre_usuario);
                        return;
                    }
                }

                MessageBox.Show("NO ENCONTRADO");
            }
        }
Exemple #15
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            foreach (var i in biometrics)
            {
                if (FingerPrintScanner.VerificationResult(Sample, verify, i.biometrics.ToArray()).Verified)
                {
                    capture.StopCapture();
                    capture.StartCapture();
                    Invoke(new Action(() =>
                    {
                        fmain.fullname = i.fullname;
                        fmain.lbl_current_username.Text = i.fullname;
                        fmain.UserLevel = i.level_cn.ToString();


                        fmain.UserCn = i.cn.ToString();
                        if (fmain.UserLevel != "3")
                        {
                            this.Close();
                            fmain.Text = Tool.Systemname;
                            fmain.buttonSelectection(fmain.pb1);
                            fmain.DailyTimeRecordSELECT();
                            fmain.Show();
                        }
                    }));
                    DataClasses1DataContext db = new DataClasses1DataContext(Tool.ConnectionString);
                    db.sp_insertLog__("Login", fmain.fullname, "Login");
                }
            }
        }
Exemple #16
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            foreach (var i in biometrics)
            {
                if (FingerPrintScanner.VerificationResult(Sample, verify, i.biometrics.ToArray()).Verified)
                {
                    capture.StopCapture();
                    capture.StartCapture();
                    Invoke(new Action(() =>
                    {
                        if (this.Tag != null)
                        {
                            if (i.cn == Convert.ToInt32(this.Tag.ToString()))
                            {
                                SaveDtr();
                                DailyTimeRecordSELECT();

                                new Messaging().sendSms(PhoneNo.Replace("-", ""), lblName.Text + " \n Time: " + DateTime.Now);

                                lblUseFingerprint.Text = "Confirmed.";
                                this.Tag = null;
                            }
                        }
                    }));

                    //Insert DTR
                }
            }
        }
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
 {
     SetStatus("La huella ha sido capturada.");
     SetStatus("Retire el dedo del lector.");
     Process(Sample);
     //Process2(Sample);
 }
Exemple #18
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            DrawPicture(ConvertSampleToBitmap(Sample));
            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);

            if (features != null)
            {
                byte[] bytes = new byte[1632];
                features.Serialize(ref bytes);

                for (int x = 0; x < List_Usuarios.Count; x++)
                {
                    DPFP.Template templeate = new DPFP.Template();
                    templeate.DeSerialize(List_Usuarios[x].fingerPrint);

                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, templeate, ref result);


                    if (result.Verified)
                    {
                        _idCliente = List_Usuarios[x].id_Cliente;

                        return;
                    }
                }

                //videoSourcePlayer1.BackgroundImage = Properties.Resources.Desconocido;
                MessageBox.Show("Cliente no encontrado", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemple #19
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            MakeReport("The fingerprint sample was captured.");
            Process(Sample);
            //Afis.Threshold = 10;
            Random random = new Random();

            //RollCallForm.HostelStudent probe = Enroll(fingerPrint, "#" + random.Next(1000, 9999));
            //RollCallForm.HostelStudent match = Afis.Identify(probe, database).FirstOrDefault() as RollCallForm.HostelStudent;
            // Null result means that there is no candidate with similarity score above threshold
            if (true) //match
            {
                this.BeginInvoke((Action)(() =>
                {
                    // btnRegister.Enabled = false;
                    MessageBox.Show("Double enrollment of fingerprint is not allowed", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }));
            }
            else
            {
                this.BeginInvoke((Action)(() =>
                {
                    //btnRegister.Enabled = true;
                }));
            }
        }
Exemple #20
0
        private DPFP.Template templateadd()
        {
            lst = getbyet();
            DPFP.FeatureSet features;
            for (int i = 0; i < lst.Count; i++)
            {
                foreach (Byte b in lst[i].Prints)
                {
                    Stream      s      = new MemoryStream(b);
                    DPFP.Sample sample = new DPFP.Sample(s);
                    features = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment);
                    enrol.AddFeatures(features);
                }
                cnic = lst[i].CNIC;
            }
            //switch (enrol.TemplateStatus)
            //{
            //    case DPFP.Processing.Enrollment.Status.Ready:	// report success and stop capturing
            //        OnTemplate(enrol.Template);
            //        break;

            //    case DPFP.Processing.Enrollment.Status.Failed:	// report failure and restart capturing
            //        enrol.Clear();
            //        OnTemplate(null);
            //        Start();
            //        break;
            //}
            return(enrol.Template);
        }
        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 tamplete
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                verifor.Verify(features, tamplete, ref result);
                if (result.Verified)
                {
                    MakeReport("The fingerprint was VERIFIED.");
                    displayData(files[fileCounter - 1]);
                    fileCounter = 0;
                    isVarifed   = true;
                }
                else
                {
                    MakeReport("The fingerprint was NOT VERIFIED.");
                    Stop();
                    loadNextFile();
                    Init();
                    Start();
                }
            }
        }
Exemple #22
0
        public void Process(DPFP.Sample Sample)
        {
            capturador.Process(Sample);

            DPFP.FeatureSet features = capturador.ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);

            if (features != null)
            {
                try
                {
                    Enroller.AddFeatures(features);             // Add feature set to template.
                }
                finally
                {
                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:       // report success and stop capturing
                        OnTemplate(Enroller.Template);
                        //SetPrompt("Click Close, and then click Fingerprint Verification.");
                        capturador.deter_captura();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:      // report failure and restart capturing
                        Enroller.Clear();
                        capturador.deter_captura();
                        UpdateStatus();
                        OnTemplate(null);
                        capturador.iniciar_captura();
                        break;
                    }
                }
            }
        }
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = " select * from resident ";
                cmd.Connection  = Connection.con;
                SqlDataAdapter sd = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                sd.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    byte[] _img = (byte[])dr["resident_fingerprint"];
                    //string id = dr["RESIDENT_ID"].ToString();
                    MemoryStream  ms       = new MemoryStream(_img);
                    DPFP.Template Template = new DPFP.Template();
                    Template.DeSerialize(ms);
                    DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();

                    //  Process(Sample);

                    DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                    if (features != null)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        // UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MessageBox.Show("This Resident is already Registered!!!");
                            Reset();
                            FMPIclear();
                            break;
                        }
                        else
                        {
                            MakeReport("fingerprint captured.");
                            SetPrompt("Scan fingerprint again");
                            Process(Sample);
                            if (scans.Text == "0 scans left")
                            {
                                cp.StopCapture();
                            }
                            break;
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

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

            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    MakeReport("The fingerprint feature set was created.");
                    Enroller.AddFeatures(features);                     // Add feature set to template.
                }
                finally {
                    UpdateStatus();

                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                    case DPFP.Processing.Enrollment.Status.Ready:                       // report success and stop capturing
                        OnTemplate(Enroller.Template);
                        SetPrompt("Click Close, and then click Fingerprint Verification.");

                        /*string connstring = "Host=localhost;Username=postgres;Password=posgrest;Database=SGEEDE";
                         * // Making connection with Npgsql provider
                         * NpgsqlConnection conn = new NpgsqlConnection(connstring);
                         * conn.Open();
                         * string sql = "update res_partner set comment = '123123123123123' where name = 'Agrolait';";
                         * //cmd.CommandText = "INSERT INTO Emp_T(EmpID, EmpName, EmpTemplate) VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + template + "')";
                         * // data adapter making request from our connection
                         * NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn);
                         * // i always reset DataSet before i do something with it.... i don't know why :-)
                         * ds.Reset();
                         *
                         * // filling DataSet with result from NpgsqlDataAdapter
                         * da.Fill(ds);
                         * // since it C# DataSet can handle multiple tables, we will select first
                         * //dt = ds.Tables[0];
                         * // connect grid to DataTable
                         * //dataGridView1.DataSource = dt;
                         * // since we only showing the result we don't need connection anymore
                         * conn.Close(); */

                        Stop();
                        break;

                    case DPFP.Processing.Enrollment.Status.Failed:                      // report failure and restart capturing
                        Enroller.Clear();
                        Stop();
                        UpdateStatus();
                        OnTemplate(null);
                        Start();
                        break;
                    }
                }
            }
        }
Exemple #25
0
        protected Bitmap ConvertSampleToBitmap(DPFP.Sample Sample)
        {
            DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion();              // Create a sample convertor.
            Bitmap bitmap = null;                                                                       // TODO: the size doesn't matter

            Convertor.ConvertToPicture(Sample, ref bitmap);                                             // TODO: return bitmap as a result
            return(bitmap);
        }
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample _Sample)
 {
     MakeReport("La muestra ha sido capturada");
     SetPrompt("Escanea tu misma huella otra vez");
     DPFP.Sample sample = new DPFP.Sample();
     sample = _Sample;
     Process(_Sample);
 }
Exemple #27
0
 public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
 {
     //MakeReport("La huella digital fue capturada.");
     //SetPrompt("Scan the same fingerprint again.");
     SetStatus("La huella digital fue capturada!");
     MakeReport("Se ha capturado la huella digital");
     Process(Sample);
 }
Exemple #28
0
 public void UpdateSamples(int FingerPosition, DPFP.Sample Sample)
 {
     this.Samples[FingerPosition] = Sample;
     if (DataChanged != null)
     {
         this.DataChanged();
     }
 }
Exemple #29
0
        protected virtual void Process(DPFP.Sample Sample)
        {
            // Draw fingerprint sample image.
            var bitmap = ConvertSampleToBitmap(Sample);

            DrawPicture(bitmap);
            fingerPrint = ToByteArray(bitmap);
        }
Exemple #30
0
        public static Employee VerifyBiometricsData(int FingNo, DPFP.Sample Sample)
        {
            OracleConnection conn  = new OracleConnection(ConStr);
            Employee         _info = new Employee();

            try
            {
                string        _result   = string.Empty;
                string        _Finger   = Util.GetFingerDesc(FingNo);
                DPFP.Template _template = null;
                string        sql       = string.Format("select Empl_Id_No, {0} from EMPTSI", _Finger);;
                OracleCommand command   = new OracleCommand(sql, conn);
                command.CommandType = CommandType.Text;
                conn.Open();
                OracleDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);

                bool IsFound = false;
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        if (reader[0] != DBNull.Value)
                        {
                            _template = Util.ProcessDBTemplate((byte[])reader[_Finger]);
                            IsFound   = Util.Verify(Sample, _template);
                        }
                        if (IsFound == true)
                        {
                            string        sqlEmp = "select * from employees where Empl_Id_No=" + reader["Empl_Id_No"];
                            OracleCommand cmd2   = new OracleCommand(sqlEmp, conn);
                            cmd2.CommandType = CommandType.Text;
                            OracleDataReader reader2 = cmd2.ExecuteReader(CommandBehavior.CloseConnection);
                            if (reader2.HasRows)
                            {
                                _info.Empl_Id_No    = Convert.ToInt32(reader["Empl_Id_No"]);
                                _info.Empl_Name     = (string)reader2["Empl_Name"];
                                _info.Empl_Deptname = (string)reader2["Empl_Deptname"];
                                _info.Shift_Id      = Convert.ToInt32(reader2["Shift_Id"]);
                            }
                            reader2.Dispose();
                            reader.Dispose();
                            cmd2.Dispose();
                            command.Dispose();
                            break;
                        }
                    }
                }
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
                return(_info);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void Process(DPFP.Sample Sample)
        {
            MemSample = Sample;
            // Draw fingerprint sample image.
            DrawPicture(ConvertSampleToBitmap(Sample));

            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment);
            // Check quality of the sample and add to enroller if it's good
            if (features != null)
            {
                try
                {
                    MakeReport("The fingerprint feature set was created.");
                    Enroller.AddFeatures(features);		// Add feature set to template.
                }
                finally
                {
                    //UpdateStatus();

                    // Check if template has been created.
                    switch (Enroller.TemplateStatus)
                    {
                        case DPFP.Processing.Enrollment.Status.Ready:	// report success and stop capturing
                            MemTemplate = Enroller.Template;
                            EnabledDisabledButton(true);
                            //OnTemplate(Enroller.Template);
                            //SetPrompt("Click Close, and then click Fingerprint Verification.");
                            //Stop();
                            break;

                        case DPFP.Processing.Enrollment.Status.Failed:	// report failure and restart capturing

                            SetStatus(string.Format("Faltan {0} Muestras!", Enroller.FeaturesNeeded));
                            Enroller.Clear();
                            MemTemplate = null;
                            EnabledDisabledButton(false);
                            //Stop();
                            //UpdateStatus();
                            //OnTemplate(null);
                            //Start();
                            break;
                        case DPFP.Processing.Enrollment.Status.Insufficient:
                            SetStatus(string.Format("Faltan {0} Muestras!", Enroller.FeaturesNeeded));
                            EnabledDisabledButton(false);
                            break;
                    }
                }
            }
        }