Example #1
0
        private void VerifyFinger(string finger, string list)
        {
            bool match = false;

            //string[] fingerList = { "Ta5TUzIxAAAE7fIECAUHCc7QAAAc7GkBAAAAhBAwiO2yAEoCewBhAPXvlADvALgFowCy7UQPdAD+APUPyu2zACMPwADGAUTisgB+ABUMKgDZ7SsO6QDzAO8OsO0pAV8EHgB9AFTm9wARAS0P8AAj7DgPrgAzAEYHiO0vAP8LkgAlAD/lsgDYADcPbADv7UQLkgCSAMkPw+3gADUPXwBYAEriuACGABcMUgB17XMPoQAmAV0Edu0pAScPKAB0ANTi+wD1AKoLFQAz7FAPGACUAJIN2e1JAVAPKgCHAOfimACqAB0CrADW7cYPigD0AHoFzO26ACoPYQA3AD7igwB8APUPDQCJ7ZYMNgDuAIEP2e0FATYPOQBVAFTilAAzAesEkwBe7eYPcgBGAeEPVO1LAGAP/QD1ASngNQAYAOgP2CzRt/9Brar1r9ynPBaAfMF18fvkV31u6PpBckJ5cfseYLrsQQ/i/M8NlO6Eg/6koQJAg9IbXICx9SECYMky/Zd0GIPq+c4A7RYYh44AC/aOF1v6h4VPEz9zT333Tr6PfYSVfpz6mRhcBsL9tY3UEcnjqPIdG9kfGAK6HZf1aQs9XwcCFOp8gAKmfX7nXFKFSK3tOcdYXwRi0B/7GINeeEOBWW2Egx1/VQED9C/JV4gmCGYJEAESy87xpoZq/3b9yTkYEu4sdYfDjM5isQuRhjGS9Qu2GJv2XQ4SdI9+fWuw69YGfYBAhyKYQw9/Dit/4A1Z5sz7rviGgfsGcbiLjCLFTYjqBbMbH/xKOkeOlHiuk856DgC63grc5urGiscDSEumYQAnIT4BAokkAQME2AFkwgcAScVxwCzBagQAVgCjXw/tcgF3hG/AQQ4EfwV6eMB3wb7BD+2eC3ptwv9GwhTtqxeJxVjCBXdqnBMAvB+GjJfCxJHBe8EFAI7o/fsRwxMAxi2PBJJSksDCa1QUAGg1h5jAwZD/g/8EwFbmAddGjHHBv3cP7U9MYHRvQs4A2byNZ2x4DwAkW4sswXjCwsF6v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dWnsGSxInJENw9oYDCwcPDBIw=" };
            string[] fingerList  = list.Split(',');
            string   matchFinger = "";

            foreach (string fn in fingerList)
            {
                if (ZkFprint.VerFingerFromStr(ref finger, fn, false, ref Check))
                {
                    match       = true;
                    matchFinger = fn;
                }
            }
            if (match)
            {
                WriteText("result", matchFinger);
            }
            else
            {
                WriteText("result", "false");
            }
            Application.Exit();
        }
Example #2
0
        private void lectorHuellas_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template          = lectorHuellas.EncodeTemplate1(e.aTemplate);
            string regTemplateString = "";
            int    iBandera          = 0;

            foreach (DataGridViewRow row in dgvDatos.Rows)
            {
                sNombreCajero     = row.Cells["descripcion"].Value.ToString().Trim();
                sClaveAcceso      = row.Cells["claveacceso"].Value.ToString().Trim();
                regTemplateString = row.Cells["huella_dactilar"].Value.ToString();

                if (lectorHuellas.VerFingerFromStr(ref template, regTemplateString, false, ref Check))
                {
                    iBandera = 1;
                    break;
                }
            }

            if (iBandera == 1)
            {
                lblMensajeRespuesta.Text = sNombreCajero;
                txtCodigo.Text           = sClaveAcceso;
                consultarRegistro();
            }

            else
            {
                lblMensajeRespuesta.Text = "Registro no encontrado";
            }
        }
Example #3
0
        private void lectorHuellas_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template          = lectorHuellas.EncodeTemplate1(e.aTemplate);
            string regTemplateString = "";
            int    iBandera          = 0;

            foreach (DataGridViewRow row in dgvDatos.Rows)
            {
                sIdentificacionEmpleado = row.Cells["identificacion"].Value.ToString().Trim();
                sNombreEmpresa          = row.Cells["identificacion"].Value.ToString().Trim().ToUpper();
                sNombreEmpleado         = row.Cells["empleado"].Value.ToString().Trim().ToUpper();

                regTemplateString = row.Cells["huella_dactilar"].Value.ToString();

                if (lectorHuellas.VerFingerFromStr(ref template, regTemplateString, false, ref Check))
                {
                    iBandera = 1;
                    break;
                }
            }

            if (iBandera == 1)
            {
                txtIdentificacion.Text   = sIdentificacionEmpleado;
                lblMensajeRespuesta.Text = "EMPLEADO: " + sNombreEmpleado;
                consultarEmpleadoIdentificacion();
            }

            else
            {
                lblMensajeRespuesta.Text = "Registro no encontrado. Favor reintente.";
            }
        }
Example #4
0
        private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            bool isVerified = false;
            //fingerprint to verify
            string template = ZkFprint.EncodeTemplate1(e.aTemplate);

            foreach (var item in _db.Employees)
            {
                if (ZkFprint.VerFingerFromStr(ref template, item.Fingerprint, false, ref Check))
                {
                    ShowHintInfo("Verified");
                    lblName.Text              = "Time Out\nName: " + item.Name + "\n" + DateTime.Now.ToString("dddd, dd MMMM yyyy\nhh:mm tt");
                    ZkFprint.OnCapture       -= zkFprint_OnCapture;
                    ZkFprint.OnImageReceived -= zkFprint_OnImageReceived;
                    fpicture.Image            = null;
                    //add attendance to database realtime
                    Attendance at = new Attendance();
                    at.EmpID    = item.ID;
                    at.DateTime = DateTime.Now;
                    at.Type     = "Out";
                    _db.Attendances.Add(at);
                    isVerified = true;

                    break;
                }
            }

            if (!isVerified)
            {
                //BEEP AND RED
                ZkFprint.ControlSensor(12, 1);
                ZkFprint.ControlSensor(13, 1);
                Thread.Sleep(100);
                ZkFprint.ControlSensor(12, 0);
                ZkFprint.ControlSensor(13, 0);
                //Unregister Events
                ShowHintInfo("Not Verified");
                lblName.Text              = "";
                ZkFprint.OnCapture       -= zkFprint_OnCapture;
                ZkFprint.OnImageReceived -= zkFprint_OnImageReceived;
                fpicture.Image            = null;
            }
            else
            {
                //BEEP AND GREEN
                ZkFprint.ControlSensor(11, 1);
                ZkFprint.ControlSensor(13, 1);
                Thread.Sleep(100);
                ZkFprint.ControlSensor(11, 0);
                ZkFprint.ControlSensor(13, 0);
                //Unregister Events
                ZkFprint.OnCapture       -= zkFprint_OnCapture;
                ZkFprint.OnImageReceived -= zkFprint_OnImageReceived;
                fpicture.Image            = null;

                _db.SaveChanges();
                MessageBox.Show("Saved");
            }
        }
Example #5
0
        private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template = ZkFprint.EncodeTemplate1(e.aTemplate);


            if (ZkFprint.VerFingerFromStr(ref template, txtTemplate.Text, false, ref Check))
            {
                ShowHintInfo("Verified");
            }
            else
            {
                ShowHintInfo("Not Verified");
            }
        }
Example #6
0
        private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template = zk_dispositivo.EncodeTemplate1(e.aTemplate);

            if (zk_dispositivo.VerFingerFromStr(ref template, txtBase64_1.Text, false, ref Check))
            {
                mostrarNotificacion("Verificado...!!!");
                btnGuardar.Enabled = true;
            }
            else
            {
                mostrarNotificacion("No verificado...!!!");
                btnGuardar.Enabled = false;
            }
        }
Example #7
0
        private void lectorHuellas_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template = lectorHuellas.EncodeTemplate1(e.aTemplate);

            if (lectorHuellas.VerFingerFromStr(ref template, txtBase64_1.Text.Trim(), false, ref Check))
            {
                mostrarNotificacion("Verificado");
                btnGuardar.Enabled = true;
            }

            else
            {
                mostrarNotificacion("No verificado");
                btnGuardar.Enabled = false;
            }
        }
Example #8
0
        private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            // Console.WriteLine("zkFprint_OnCapture");
            string template = m_zkFprint.EncodeTemplate1(e.aTemplate);
            //Console.WriteLine("Scan string : " + template);

            Member currentMember = null;

            foreach (Member member in StorageManager.GetSingleton().GetMemberList())
            {
                if (m_zkFprint.VerFingerFromStr(ref template, member.FingerPrint, false, ref Check))
                {
                    currentMember = member;
                    break;
                }
            }

            if (currentMember == null)
            {
                //DisplayNeedRegistryForm();
                NotificationManager.GetSingleton().ShowNotification(this, "ไม่พบข้อมูลสมาชิก");
            }
            else
            {
                if (currentMember.ExpireDate == null || currentMember.ExpireDate < DateTime.Now)
                {
                    //var dialogForm = new DialogForm("Exclusive Gym", $"คุณ {currentMember.Name} {currentMember.LastName} \r\nยังไม่ได้สมัครคอร์ส ต้องการสมัครคอร์สหรือไม่");
                    //if (dialogForm.ShowDialog() == DialogResult.OK)
                    //{
                    //    var DialogNeedApplyCourse = new DialogNeedApplyCourse(currentMember, ApplyCourseCallback);
                    //    DialogNeedApplyCourse.ShowDialog();
                    //}
                    NotificationManager.GetSingleton().ShowNotification(this, $"สวัสดี คุณ {currentMember.Name} {currentMember.LastName} \nยังไม่ได้สมัครคอร์ส");
                }
                else
                {
                    NotificationManager.GetSingleton().ShowNotification(this, $"สวัสดี คุณ {currentMember.Name} {currentMember.LastName}" + $"\nสมาชิกหมดอายุวันที่ {currentMember.ExpireDate.Value.ToString("dd MMMM yyyy ", new System.Globalization.CultureInfo("th-TH"))}");
                    StorageManager.GetSingleton().MemberAccessGym(currentMember);

                    //var welcomeForm = new WelcomeDialogForm(currentMember);
                    //welcomeForm.ShowDialog();
                    //MemberApplyCourse memberApplyCourse = StorageManager.GetSingleton().GetMemberApplyCourseByMemberID(currentMember.MemberId);
                    //Course course = StorageManager.GetSingleton().GetCourseByID(memberApplyCourse.CourseID);
                    homeControl1.Refresh();
                }
            }
        }
Example #9
0
        private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e)
        {
            string template          = zk_dispositivo.EncodeTemplate1(e.aTemplate);
            string regTemplateString = "";
            int    iBandera          = 0;

            foreach (DataGridViewRow row in dgvDatos.Rows)
            {
                iIdPersonaEmpresa  = Convert.ToInt32(row.Cells[0].Value.ToString());
                sNombreEmpresa     = row.Cells[1].Value.ToString().Trim().ToUpper();
                iIdPersonaEmpleado = Convert.ToInt32(row.Cells[2].Value.ToString());
                sNombreEmpleado    = row.Cells[3].Value.ToString().Trim().ToUpper();
                regTemplateString  = row.Cells[4].Value.ToString();

                if (zk_dispositivo.VerFingerFromStr(ref template, regTemplateString, false, ref Check))
                {
                    iBandera = 1;
                    break;
                }
            }

            if (iBandera == 1)
            {
                lblEmpresa.Text    = sNombreEmpresa;
                lblEmpleado.Text   = sNombreEmpleado;
                btnAceptar.Visible = true;
                btnAceptar.Focus();
            }

            else
            {
                zk_dispositivo.CancelCapture();

                lblEmpresa.Text    = "EMPRESA";
                lblEmpleado.Text   = "EMPLEADO";
                btnAceptar.Visible = false;

                ok = new VentanasMensajes.frmMensajeNuevoOk();
                ok.lblMensaje.Text = "No se encuentra el registro. Favor intente nuevamente.";
                ok.ShowDialog();

                zk_dispositivo.BeginCapture();
            }
        }
Example #10
0
        private void fetch_Finger(string finger)
        {
            List <User> temp   = queryFingerTemplete();
            bool        Match  = false;
            bool        Voted  = true;
            string      Secret = "";
            string      Id     = "";

            for (int i = 0; i < temp.Count; i++)
            {
                if (ZkFprint.VerFingerFromStr(ref finger, temp[i].finger, false, ref Check))
                {
                    Match = true;
                    ZkFprint.CancelCapture();
                    if (temp[i].voted == false.ToString())
                    {
                        Secret = temp[i].secret;
                        Id     = temp[i].id.ToString();
                        Voted  = false;
                    }
                    else
                    {
                        Voted = true;
                    }
                }
            }
            if (Match)
            {
                if (Voted)
                {
                    writeResult("verify", "{" + "\"status\"" + ":" + "\"voted\"" + "}");
                }
                else
                {
                    writeResult("verify", "{" + "\"status\"" + ":" + "true" + "," + "\"id\"" + ":" + Id + "," + "\"secret\"" + ":" + "\"" + Secret + "\"" + "}");
                }
            }
            else
            {
                writeResult("verify", "{" + "\"status\"" + ":" + "false" + "}");
            }
            Application.Exit();
        }