public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            MakeReport("fingerprint captured.");
            SetPrompt("Scan fingerprint again");
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "select RESIDENT_FINGERPRINT, RESIDENT.RESIDENT_ID,PROGRAM.PROGRAM_ID,LIST.RESIDENT_ID,LIST.PROGRAM_ID FROM RESIDENT LEFT JOIN LIST ON RESIDENT.RESIDENT_ID = LIST.RESIDENT_ID LEFT JOIN PROGRAM ON PROGRAM.PROGRAM_ID = RESIDENT.RESIDENT_ID WHERE LIST.PROGRAM_ID ='" + label2.Text + "' AND LIST_VERIFICATION IS NULL";
                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();
                    string pid  = dr["PROGRAM_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("Verified!!!");
                            SqlCommand cmds = new SqlCommand();
                            cmds.CommandText = "UPDATE LIST SET LIST_VERIFICATION ='True' WHERE LIST.RESIDENT_ID = '" + id.ToString() + "' AND LIST.PROGRAM_ID = '" + label2.Text + "'";
                            cmds.Connection  = Connection.con;
                            SqlDataReader dar = cmds.ExecuteReader();
                        }
                        else
                        {
                            MakeReport("Not registered as a resident!");
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        protected override void Process(DPFP.Sample Sample)
        {
            base.Process(Sample);

            DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
            if (features != null)
            {
                DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                DPFP.Template template = new DPFP.Template();
                Stream        stream;
                //foreach (var item in context.Students)
                //{
                //    stream = new MemoryStream(item.Pattern);
                //    template = new DPFP.Template(stream);
                //        Verificator.Verify(features, template, ref result);

                //    UpdateStatus(result.FARAchieved);
                //    if(result.Verified)
                //    {
                //        MakeReport("FingerPrint was verified" + item.Name);
                //        MessageBox.Show("User " + item.Name + " found.");
                //        break;
                //    }

                //}
            }
        }
Ejemplo n.º 3
0
        //Donde se convierte la huella y luego la muestra en el pictureBox.
        void CaptureForm_OnTemplate(DPFP.Template template)
        {
            // Este evento es llamado automaticamente por el SDK una vez que se escanea la huella 4 veces.
            // Y nos envia la "template" por parametro, que usamos para convertir a binario y subir al a base de datos.

            // Invoke es necesario siempre que queramos hacer cambios a objetos/elementos de nuestro formulario
            // esto se debe a que el proceso de Captura del escaner se realiza en un proceso por separado.

            if (success == true)
            {
                //MessageBox.Show("Huella escaneada satisfactoriamente!", "Escanéo satisfactorio", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //btnRegistrarVisitante.Invoke(new MethodInvoker(delegate { btnRegistrarVisitante.Enabled = true; }));
                btnREGISTRAR.Invoke(new MethodInvoker(delegate { btnREGISTRAR.Enabled = true; }));
                lblEstatus.Invoke(new MethodInvoker(delegate { lblEstatus.Text = "Escaneo Satisfactorio"; }));
            }

            this.Invoke(new MethodInvoker(delegate {
                // Si todo sale bien, la variable global "plantilla" se coloca como la plantilla generada por el escaner
                try
                {
                    plantilla = template;
                }
                catch (Exception ex) { }
            }));
        }
Ejemplo n.º 4
0
        protected void btnThumbCheckIn_Click(object sender, EventArgs e)
        {
            log4net.ILog logger  = log4net.LogManager.GetLogger("File");
            bool         success = false;
            //try
            //{
            Template   template1  = new Template();
            FeatureSet featureSet = new FeatureSet();

            SqlParameter[] para = new SqlParameter[1];

            if (ddllocation.Text.Trim() != "")
            {
                //para[0] = new SqlParameter("@Role", Session["user_role"].ToString());
                para[0] = new SqlParameter("Staff_ID", Session["StaffID"].ToString());
                DataTable dt = dal.executeprocedure("usp_GetRoleThumbPrints", para, false);

                foreach (DataRow dr in dt.Rows)
                {
                    template1 = new DPFP.Template();
                    template1.DeSerialize((byte[])dr["ThumbImage"]);

                    featureSet = new DPFP.FeatureSet();
                    featureSet.DeSerialize(HexsToArray(hdnFP.Value));
                    if (VerifyFingerprints(template1, featureSet))
                    {
                        string ipaddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
                        string staffid   = dt.Rows[0]["Staff_ID"].ToString();
                        getLocationIDByName(ddllocation.Text.Trim());
                        int locid = Convert.ToInt32(SearchLocID.Text);


                        SqlParameter[] para1 = new SqlParameter[5];
                        para1[0] = new SqlParameter("@UserID", staffid);
                        para1[1] = new SqlParameter("@IPAddress", ipaddress);
                        para1[2] = new SqlParameter("@Location_ID", locid);
                        para1[3] = new SqlParameter("@Logintime", DateTime.Now);
                        para1[4] = new SqlParameter("@Fromdate", DateTime.Now);
                        dal.executeprocedure("SP_AddThumbStoreInfo", para1);

                        Response.Redirect("~/ADMIN/ThumbAfter.aspx");
                    }
                    success = true;
                }
            }
            else
            {
                lblerror.Visible = true;
                lblerror.Text    = "Please Select The Location";
            }
            if (!success)
            {
                if (!(lblerror.Text.ToLower().Contains("already")))
                {
                    lblerror.Text    = "Invalid Thumbprint. Please Put Correct Finger.";
                    lblerror.Visible = true;
                }
            }
        }
Ejemplo n.º 5
0
 public void VerificarRegistro()
 {
     using (FileStream fs = File.OpenRead(@"C:\Registro\Registro.fpt"))
     {
         DPFP.Template template = new DPFP.Template(fs);
         OnTemplate(template);
     }
 }
Ejemplo n.º 6
0
        private void button3_Click(object sender, EventArgs e)
        {
            Stop();
            this.IsVerificationComplete = false;
            pbxVerify.Image             = null;
            Template = null;

            Samples.Clear();
            txtRegNo.Clear();
        }
Ejemplo n.º 7
0
        private void button3_Click(object sender, EventArgs e)
        {
            Stop();
            this.IsVerificationComplete = false;
            pbxVerify.Image             = null;
            Template = null;


            Samples.Clear();
            txtRegNo.Clear();
            //sqlcon.Open();
            //string query = "SELECT Student_RegNo, Student_Fingerprint_LTB FROM Student_db";



            //SqlDataAdapter SDA = new SqlDataAdapter(query, sqlcon);
            //SqlCommandBuilder cbd = new SqlCommandBuilder(SDA);
            ////DataTable dtb = new DataTable();

            //DataSet dtb = new DataSet();
            //SDA.Fill(dtb);


            ////Image bytimg;

            //if (dtb != null && dtb.Tables != null && dtb.Tables.Count == 1 && dtb.Tables[0].Rows[1]["Student_Fingerprint_LTB"] != System.DBNull.Value)
            //{

            //    //     byte[] images = (byte[])(dtb.Tables[0].Rows[0]["IMAGE"]);

            //byte[] imgs = (byte[])(dtb.Tables[0].Rows[1]["Student_Fingerprint_LTB"]);

            //txtRegNo.Text = dtb.Tables[0].Rows[0]["Student_RegNo"].ToString();



            //cmd = new SqlCommand("SELECT Student_RegNo FROM Student_db  WHERE Student_RegNo = '" + txtReg.Text.Trim() + "'");
            //cmd.ExecuteNonQuery();

            //SqlDataAdapter SDA = new SqlDataAdapter(query, sqlcon);
            //DataTable dtb = new DataTable();
            //SDA.Fill(dtb);


            //Template = new DPFP.Template();
            //byte[] imgs = Template.Bytes;

            //MemoryStream MS = new MemoryStream(imgs);
            //pbxVerify.Image = Image.FromStream(MS);

            //Image newImage = byteArraytoImage(imgs);
            //pbxVerify.Image = Image.FromStream(MS);
            //pbxVerify.Image = newImage;
        }
Ejemplo n.º 8
0
        public static bool Verify(DPFP.Template template, DPFP.Sample sample)
        {
            var verificator = new DPFP.Verification.Verification();

            DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
            // Process the sample and create a feature set for verification.
            DPFP.FeatureSet features = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification);
            if (features != null)
            {
                // Compare the feature set with our template
                verificator.Verify(features, template, ref result);
            }
            return(result.Verified);
        }
Ejemplo n.º 9
0
        private bool VerifyFingerprints(DPFP.Template TemplateLeftIndex, DPFP.FeatureSet FeatureSet)
        {
            Verification.Result Result       = new Verification.Result();
            Verification        Verification = new Verification();

            // Verify the left index finger.
            Verification.Verify(FeatureSet, TemplateLeftIndex, ref Result);
            if (Result.Verified)
            {
                return(true);
            }

            // No match occurred.
            return(false);
        }
Ejemplo n.º 10
0
 private void OnTemplate(DPFP.Template template)
 {
     this.Invoke(new Action(() => {
         Template = template;
         //VerifyButton.Enabled = SaveButton.Enabled = (Template != null);
         if (Template != null)
         {
             MessageBox.Show("The fingerprint template is ready for fingerprint verification.", "Fingerprint Enrollment");
         }
         else
         {
             MessageBox.Show("The fingerprint template is not valid. Repeat fingerprint enrollment.", "Fingerprint Enrollment");
         }
     }));
 }
Ejemplo n.º 11
0
        private void Template(DPFP.Template template)
        {
            try
            {
                var FileReader = new CargaFileHandler();
                var biometrias = new List <BiometriaFileJson>();
                biometrias.Add(new BiometriaFileJson(template.Bytes));
                FileReader.SavaBiometriasFile(biometrias, "digitalPersona", false);

                MessageBox.Show("Biometria cadastrada");
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 12
0
 private void frmVerficarDedo_Load(object sender, EventArgs e)
 {
     try
     {
         Capturer = new DPFP.Capture.Capture();
         CNUsuario Uh = new CNUsuario();
         Uh.IDUsuario = IDUsuario;
         Template     = Uh.RegresarHuellaTemp();
         Init();
         Capturer.StartCapture();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ocurrio un error:" + ex.ToString(), "Error inesperado", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 13
0
 private void OnTemplate(DPFP.Template template)
 {
     this.Invoke((Action)(delegate() {
         Template = template;
         btnAgregar.Enabled = (Template != null);
         if (Template != null)
         {
             MessageBox.Show("FingerPrint template is ready for finger print verification");
             textBox1.Text = "Correct";
         }
         else
         {
             MessageBox.Show("FingerPrint template is not valid");
         }
     }));
 }
Ejemplo n.º 14
0
 private void OnTemplate(DPFP.Template template)
 {
     //this.Invoke(new Function(delegate ()
     //{
     Template = template;
     //VerifyButton.Enabled = SaveButton.Enabled = (Template != null);
     if (Template != null)
     {
         Console.WriteLine("The fingerprint template is ready for fingerprint verification.", "Fingerprint Enrollment");
     }
     else
     {
         Console.WriteLine("The fingerprint template is not valid. Repeat fingerprint enrollment.", "Fingerprint Enrollment");
     }
     //}));
 }
Ejemplo n.º 15
0
 private void OnTemplate(DPFP.Template template)
 {
     this.Invoke(new Function(delegate()
     {
         Template = template;
         //VerifyButton.Enabled = SaveButton.Enabled = (Template != null);
         if (Template != null)
         {
             MetroFramework.MetroMessageBox.Show(this, "A impressão digital foi capturada com sucesso.", "Inscrição biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Question);
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, "A impressão digital não foi capturada corretamente. Tente novamente.", "Inscrição biométrica", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
         }
     }));
 }
Ejemplo n.º 16
0
        // event handling
        public void EnrollmentControl_OnEnroll(Object Control, int Finger, DPFP.Template Template, ref DPFP.Gui.EventHandlerStatus Status)
        {
            if (Data.IsEventHandlerSucceeds)
            {
                Data.Templates[Finger - 1] = Template;          // store a finger template
                ExchangeData(true);                             // update other data
                ListEvents.Items.Insert(0, String.Format("OnEnroll: finger {0}", Finger));


                Template.Serialize(ms);           //Serialze contents of the Template into a memorystream
                Data.Datum = ms.ToArray();        //Save the Serialized data to Storage
            }
            else
            {
                Status = DPFP.Gui.EventHandlerStatus.Failure;   // force a "failure" status
            }
        }
Ejemplo n.º 17
0
 private void OnTemplate(DPFP.Template template)
 {
     this.Invoke(new Function(delegate()
     {
         Template             = template;
         btnGuardarBD.Enabled = (Template != null);
         if (Template != null)
         {
             MessageBox.Show("The fingerprint template is ready for fingerprint verification.", "Fingerprint Enrollment");
             txtHuella.Text = "Huella capturada correctamente";
         }
         else
         {
             MessageBox.Show("The fingerprint template is not valid. Repeat fingerprint enrollment.", "Fingerprint Enrollment");
         }
     }));
 }
Ejemplo n.º 18
0
        public DPFP.Template ConvertRawBmpAsTemplate(Bitmap RawBmp, DataPurpose ProcessPurpose = DataPurpose.Enrollment, short VertDpi = 700, short HorDpi = 700)
        {
            VariantConverter VConverter;

            Enroller = new DPFP.Processing.Enrollment();
            RawBmp   = EncodeBitmap(RawBmp, VertDpi, HorDpi);
            try
            {
                // converts raw image to dpSample using DFC 2.0---------------------------------------
                // encode the bmp variable using the bitmap Loader
                BitmapLoader BmpLoader = new BitmapLoader(RawBmp, (int)RawBmp.HorizontalResolution, (int)RawBmp.VerticalResolution);
                BmpLoader.ProcessBitmap();
                // return the required result
                inputData = BmpLoader.RawData;
                inpRaw    = BmpLoader.DPInputParam;
                // dispose the object
                BmpLoader.Dispose();

                // start the conversion process
                VConverter = new VariantConverter(VariantConverter.OutputType.dp_sample, DataType.RawSample, inpRaw, inputData, false);
                MemoryStream DStream = new MemoryStream(VConverter.Convert());
                DPsample = new DPFP.Sample(DStream);
                // DPsample = DirectCast(VConverter.Convert(), DPFP.Sample)

                // converts dpSample to DPFeatures using the OTW'''''''''''''''''''''''''''''''''''''''
                DPFeatures = ExtractFeatures(DPsample, ProcessPurpose);
                // convert DPfeatures to ISO FMD using the DFC 2.0'''''''''''''''''''''''''''''''''''''''
                byte[] SerializedFeatures = null;
                DPFeatures.Serialize(ref SerializedFeatures); // serialized features into the array of bytes
                ISOFMD = DigitalPersona.Standards.Converter.Convert(SerializedFeatures, DigitalPersona.Standards.DataType.DPFeatureSet, DataType.ISOFeatureSet);

                // convert ISO FMD to DPTemplate using DFC 2.0'''''''''''''''''''''''''''''''''''''''
                byte[] DPTemplateData = DigitalPersona.Standards.Converter.Convert(ISOFMD, DigitalPersona.Standards.DataType.ISOTemplate, DataType.DPTemplate);
                // deserialize data to Template
                DPTemplate = new DPFP.Template();
                DPTemplate.DeSerialize(DPTemplateData); // required for database purpose
                                                        // ============================================================================
                DStream.Close();
                return(DPTemplate);
            }
            catch (Exception ex)
            {
                return(null /* TODO Change to default(_) if this is not a reference type */);
            }
        }
Ejemplo n.º 19
0
        void CaptureForm_OnTemplate(DPFP.Template template)
        {
            // Este evento es llamado automaticamente por el SDK una vez que se escanea la huella 4 veces.
            // Y nos envia la "template" por parametro, que usamos para convertir a binario y subir al a base de datos.

            // Invoke es necesario siempre que queramos hacer cambios a objetos/elementos de nuestro formulario
            // esto se debe a que el proceso de Captura del escaner se realiza en un proceso por separado.
            this.Invoke(new MethodInvoker(delegate {
                // Si todo sale bien, la variable global "plantilla" se coloca como la plantilla generada por el escaner
                plantilla = template;
                // La convertimos a un arreglo de bytes
                MemoryStream fingerprintData = new MemoryStream();
                template.Serialize(fingerprintData);
                fingerprintData.Position = 0;
                BinaryReader br          = new BinaryReader(fingerprintData);
                Byte[] bytes             = br.ReadBytes((Int32)fingerprintData.Length);
            }));
        }
Ejemplo n.º 20
0
        public void Process(DPFP.Sample 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();
                foreach (var item in funcionarios)
                {
                    if (item.Digital != null)
                    {
                        Template = new Template();
                        Template.DeSerialize(item.Digital);
                        Verificator.Verify(features, Template, ref result);
                        if (result.Verified)
                        {
                            funcionario         = item;
                            impressaoLocalizada = true;
                            return;
                        }
                    }
                }

                if (result.Verified)
                {
                    updateStatus("Impressão digital localizada com sucesso.");
                }
                else
                {
                    impressaoLocalizada = false;
                    updateStatus("Impressão digital não localizada. \nTente novamente.");
                    this.Invoke(new Function(delegate() { limparTela(); }));
                    Application.DoEvents();
                    cp.StopCapture();
                    cp = new DPFP.Capture.Capture();
                    cp.StartCapture();
                    cp.EventHandler = this;
                }
            }
        }
Ejemplo n.º 21
0
        private string[] VerifyDB(DPFP.FeatureSet features)
        {
            string[]       arr = new string[5];
            OdbcConnection cn;
            OdbcCommand    cmd;

            byte[] temp     = new byte[0];
            string query    = "Select * from fpbasic";
            string dsnname  = "fpbasic";
            string uid      = "Administrator";
            string password = "******";

            cn = new OdbcConnection("dsn=" + dsnname + "; UID=" + uid + "; PWD=" + password + ";");
            cn.Open();
            cmd = new OdbcCommand(query, cn);
            OdbcDataReader reader = cmd.ExecuteReader();

            DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
            Verifier = new DPFP.Verification.Verification();
            while (reader.Read())
            {
                for (int index = 0; index < reader.FieldCount; index++)
                {
                    Stream        stream = new MemoryStream((byte[])reader.GetValue(5));
                    DPFP.Template obj    = new DPFP.Template(stream);
                    Verifier.Verify(features, obj, ref result);
                    if (result.Verified)
                    {
                        arr[0] = "true";
                        arr[1] = reader.GetString(1);
                        arr[2] = reader.GetString(2);
                        arr[3] = reader.GetString(3);
                        arr[4] = reader.GetInt32(4).ToString();
                        return(arr);
                    }
                }
            }

            cn.Close();
            arr[0] = "false";
            return(arr);
        }
Ejemplo n.º 22
0
        private void OnTemplate2(DPFP.Template template)
        {
            this.Invoke(new Function(delegate()
            {
                Template = template;
                //VerifyButton.Enabled = SaveButton.Enabled = (Template != null);
                btnborrar.Enabled = button1.Enabled = (Template != null);
                if (Template != null)
                {
                    MessageBox.Show("El dedo esta listo para guardar", "Dedo listo");


                    // TextD(Template);
                }
                else
                {
                    MessageBox.Show("El dedo se ha limpiado", "Limpio");
                }
            }));
        }
Ejemplo n.º 23
0
        private void OnTemplateCollect(DPFP.Template template)
        {
            this.Invoke(new Function(delegate()
            {
                try
                {
                    Template = template;

                    MemoryStream ms = new MemoryStream();
                    byte[] imgs     = template.Bytes;
                    Template.Serialize(ms);
                    this.imgs = ms.ToArray();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    MessageBox.Show("The fingerprint template is not valid. Repeat fingerprint enrollment!");
                }
            }
                                     ));
        }
        private void OnTemplate(DPFP.Template template)
        {
            Template = template;
            if (Template != null)
            {
                MemoryStream fingerprintData = new MemoryStream();
                Template.Serialize(fingerprintData);
                fingerprintData.Position = 0;
                BinaryReader br    = new BinaryReader(fingerprintData);
                Byte[]       bytes = br.ReadBytes((Int32)fingerprintData.Length);

                Biometric.FingerID            = Guid.NewGuid();
                Biometric.FingerPrintTemplate = bytes;

                Stop();
            }
            else
            {
                //Faile case, repeat.
            }
        }
Ejemplo n.º 25
0
        protected void Process2(DPFP.Sample Sample)
        {
            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.HUELLASCLIENTES)
                {
                    stream   = new MemoryStream(emp.HUELLA);
                    template = new DPFP.Template(stream);

                    Verificator.Verify(features, template, ref result);
                    UpdateStatus(result.FARAchieved);
                    if (result.Verified)
                    {
                        Int64 ID = emp.ID;
                        this.PID = ID;
                        SetStatus(Convert.ToString(ID));
                        Regis(ID);
                        //dtgLista.DataSource = LisRegist(UsserID);
                        //Listar();
                        //MakeReport("The fingerprint was VERIFIED. " + emp.Nombre);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 26
0
        protected void OnTemplate(DPFP.Template template)
        {
            this.Invoke(new Function(delegate()
            {
                Template = template;
                //VerifyButton.Enabled = SaveButton.Enabled = (Template != null);
                if (Template != null)
                {
                    MessageBox.Show("Huellas registradas.", "Sporting Gym");

                    byte[] bytes = new byte[1632];
                    Template.Serialize(ref bytes);

                    //int valor = Convert.ToInt32(Clientes_comboBox.SelectedValue);

                    if (persona == true)
                    {
                        var huellas = (from x in contexto.Catalogo_Clientes where x.id_cliente == id_cliente select x).Single();

                        huellas.huella = bytes;
                        contexto.SaveChanges();
                    }
                    else if (persona == false)
                    {
                        var huellas = (from x in contexto.Catalogo_Instructores where x.id_instructor == id_cliente select x).Single();

                        huellas.huella = bytes;
                        contexto.SaveChanges();
                    }

                    contexto.sp_Actualizar_Huella(id_cliente, bytes, persona);

                    this.Close();
                }
                else
                {
                    MessageBox.Show("The fingerprint template is not valid. Repeat fingerprint enrollment.", "Fingerprint Enrollment");
                }
            }));
        }
Ejemplo n.º 27
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         byte[] streamHuella = Template.Bytes;
         //Student student = new Student
         //{
         //    Name=Name.Text,
         //    Pattern=streamHuella
         //};
         //TaskModel.Students.Add(student);
         //TaskModel.SaveChanges();
         MessageBox.Show("Record saved successfully");
         Listar();
         Template           = null;
         btnAgregar.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 28
0
        protected virtual void Init()
        {
            try
            {
                Captura     = new Capture();
                verificador = new DPFP.Verification.Verification();
                template    = new Template();

                if (Captura != null)
                {
                    Captura.EventHandler = this;
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("No se pudo");
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("No se pudo Inicializar el lector de huella");
            }
        }
Ejemplo n.º 29
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataView   DataView        = null;
            string     savedPassword   = null;
            string     enteredPassword = null;
            Template   template1       = new Template();
            FeatureSet featureSet      = new FeatureSet();

            // Attempt to select information from the database using name as a parameter (via asp.net).
            DataView = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

            // Check if a record exists.

            if (DataView != null && !DataView.Table.Rows.Count.Equals(0))
            {
                // Get data from the form and the returned recordset.
                savedPassword   = (object.ReferenceEquals(DataView.Table.Rows[0]["Password"].GetType(), typeof(DBNull)) ? string.Empty : DataView.Table.Rows[0]["Password"].ToString().Trim());
                enteredPassword = TextBox2.Text;

                template1 = new DPFP.Template();
                template1.DeSerialize((byte[])DataView.Table.Rows[0]["Template1"]);

                featureSet = new DPFP.FeatureSet();
                featureSet.DeSerialize(HexsToArray(hdnFP.Value));

                // Verify data and return a message.
                if (VerifyFingerprints(template1, featureSet))
                {
                    if (VerifyPassword(savedPassword, enteredPassword) || enteredPassword.Equals(string.Empty))
                    {
                        // Handle a successful login.
                        Response.Redirect("./Success.aspx");

                        return;
                    }
                }
            }
        }
Ejemplo n.º 30
0
        public void Init()
        {
            try
            {
                capture = new DPFP.Capture.Capture();

                if (capture != null)
                {
                    capture.EventHandler = this;
                    template             = new DPFP.Template();
                    verification         = new DPFP.Verification.Verification();
                }
                else
                {
                    MessageBox.Show("ERROR AL INICIAR DIGITAL-PERSONA");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("ERROR AL INICIAR DIGITAL-PERSONA");
                Debug.Write(e);
            }
        }
Ejemplo n.º 31
0
        private void btnValidar_Click(object sender, EventArgs e)
        {
            try
            {
                XmlSerial serial = new XmlSerial();
                XmlDocument xmlDoc = new XmlDocument();
                string path = Path.GetFullPath("DB/UsuarioRepository.xml");

                xmlDoc.Load(path);
                //(UsuariosList)Funciones.DeserializeObject<UsuariosList>(xmlDoc.InnerXml);
                UsuariosList usuarios = serial.DesSerializeObjeto<UsuariosList>(xmlDoc.InnerXml);
                var usuario = usuarios.Usuarios.Where(u => u.Rut == this.txtRut.Text).FirstOrDefault();
                MemoryStream ms = new MemoryStream(usuario.TemplateBytes);
                //DPFP.Capture.SampleConversion convertor = new DPFP.Capture.SampleConversion();
                //convertor.ConvertToANSI381(usuarios.Usuarios.Where(u => u.Rut == this.txtRut.Text).FirstOrDefault().Sample, ref bytes);
                //new DPFP.Template(new MemoryStream(bytes));
                Template template = new DPFP.Template(ms);
                Compare(template, MemSample);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Validador Huella", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }