Exemplo n.º 1
0
        private void guardarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (PermisoGuardar == true)
                {
                    if (_template == null)
                    {
                        MessageBox.Show("Error...");
                        return;
                    }
                    mEnroll dl = new mEnroll();
                    FingerprintTemplateDTO _templateDTO = new FingerprintTemplateDTO();

                    _templateDTO.Buffer  = _template.Buffer;
                    _templateDTO.Quality = _template.Quality;
                    dl.SaveTemplate(_templateDTO);

                    EliminarHuellaAntigua();

                    int    IIdUltimoTemplate = GetIdHuellaActual();
                    ByARpt ResAsigHuella     = AsignarHuellaPersona(IIdUltimoTemplate);
                    MessageBox.Show("Se asigno huella a la persona...");
                    this.Close();
                    //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                    //dl.SaveTemplate(_template);
                }
                else
                {
                    MessageBox.Show("No se puede guardar, esta huella ya esta registrada...");
                }
            }
            catch { }
        }
Exemplo n.º 2
0
        public void Verificar()
        {
            VerifyDialog verify = new VerifyDialog();

            if (verify.ShowDialog(this) == DialogResult.OK)
            {
                int verifyCode = Convert.ToInt32(verify.VerifyCode);

                if ((_template != null) && (_template.Size > 0))
                {
                    try
                    {
                        fingerPrint.IdentifyPrepare(_template);


                        mEnroll dl = new mEnroll();
                        List <FingerprintTemplateDTO> lst = dl.GetTemplates();
                        //IDataReader dataReader = dl.GetTemplates();
                        foreach (var item in lst)
                        {
                            int    tempId  = item.ID;
                            byte[] buff    = item.Buffer;
                            int    quality = item.Quality;

                            GriauleFingerprintLibrary.DataTypes.FingerprintTemplate testTemplate = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate();

                            testTemplate.Size   = buff.Length;
                            testTemplate.Buffer = buff;

                            int score;
                            if (Identify(testTemplate, out score))
                            {
                                //WriteLog(string.Format("Fingerprint matched, ID:{0} - Score: {1}", tempId, score));
                                DisplayImage(_template, true);
                                return;
                            }
                            //                          WriteLog("Fingerprint not found.");
                        }
                    }
                    catch { }
                }
                else
                {
                    //                WriteLog("Must acquire a finger print image and extract a template, before verify within the database");
                }
            }
        }
Exemplo n.º 3
0
        private void enrollToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                if (_template == null)
                {
                    MessageBox.Show("Error, Null template");
                    return;
                }
                mEnroll dl = new mEnroll();
                FingerprintTemplateDTO _templateDTO = new FingerprintTemplateDTO();

                _templateDTO.Buffer  = _template.Buffer;
                _templateDTO.Quality = _template.Quality;
                dl.SaveTemplate(_templateDTO);

                //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                //dl.SaveTemplate(_template);
            }
            catch { }
        }
Exemplo n.º 4
0
        private int GetIdHuellaActual()
        {
            mEnroll objEnroll = new mEnroll();

            return(objEnroll.GetIdUltimoTemplate());
        }
Exemplo n.º 5
0
        private void EliminarHuellaAntigua()
        {
            mEnroll objEnroll = new mEnroll();

            objEnroll.DeleteTemplate(idHuellaPersonaGlobal);
        }