private void zkFprint_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { if (e.actionResult) { string template = ZkFprint.EncodeTemplate1(e.aTemplate); txtTemplate.Text = template; ShowHintInfo("Registration successful. You can verify now"); btnRegister.Enabled = false; btnVerify.Enabled = true; } else { ShowHintInfo("Error, please register again."); } }
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"; } }
private void lectorHuellas_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { if (e.actionResult) { string template = lectorHuellas.EncodeTemplate1(e.aTemplate); txtBase64_1.Text = template; mostrarNotificacion("Registro exitoso. Puede proceder a verificar"); btnVerificar.Enabled = true; } else { mostrarNotificacion("Error, por favor registra nuevamente."); btnVerificar.Enabled = false; } }
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."; } }
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"); } }
private void zkFprint_OnCapture(object sender, IZKFPEngXEvents_OnCaptureEvent e) { string template = ZkFprint.EncodeTemplate1(e.aTemplate); writeResult("finger", template); ZkFprint.CancelCapture(); Application.Exit(); }
private void zkFprint_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { if (e.actionResult) { string template = zk_dispositivo.EncodeTemplate1(e.aTemplate); txtBase64_1.Text = template; mostrarNotificacion("Registro satisfactorio, puede verificar su huella."); btnVerificar.Enabled = true; } else { zk_dispositivo.EnrollIndex += 1; mostrarNotificacion("Error, por favor, registre la huella nuevaente."); zk_dispositivo.CancelEnroll(); zk_dispositivo.EnrollCount = 3; zk_dispositivo.BeginEnroll(); } }
private void zkFprint_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { if (e.actionResult) { string template = ZkFprint.EncodeTemplate1(e.aTemplate); txtTemplate.Text = template; //Sonido = new SoundPlayer(@"D:\ASUS\Programas C#\RossesGym\RossesGym\Audio\huella.wav"); //Sonido.Play(); MessageBox.Show("HUELLA DIGITAL REGISTRADA EXITOSAMENTE", "HUELLA DIGITAL", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); //ShowHintInfo("Registration successful. You can verify now"); btnRegister.Enabled = false; btnVerify.Enabled = true; } else { ShowHintInfo("ERRO AL LEER LA HUELLA DIGITAL"); } }
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(); } } }
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(); } }
private void zkFprint_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { //Console.WriteLine("zkFprint_OnEnroll 2"); if (e.actionResult) { string template = m_zkFprint.EncodeTemplate1(e.aTemplate); FingerPrint.GetSingleton().RemoveFingerprintEvent(Controls); m_fingerPrintCallback(template); this.Close(); } else { ShowMessage("Error, please register again."); MessageBox.Show("Error, please register again."); m_fingerPrintCallback(""); this.Close(); } }
private void zkFprint_OnEnroll(object sender, IZKFPEngXEvents_OnEnrollEvent e) { if (e.actionResult) { Employee emp = new Employee(); emp.Name = txtName.Text; emp.Fingerprint = ZkFprint.EncodeTemplate1(e.aTemplate); _db.Employees.Add(emp); _db.SaveChanges(); ShowHintInfo("Registration successful."); //BEEP AND GREEN ZkFprint.ControlSensor(13, 1); ZkFprint.ControlSensor(11, 1); Thread.Sleep(100); ZkFprint.ControlSensor(13, 0); ZkFprint.ControlSensor(11, 0); MessageBox.Show("Saved"); txtName.Text = ""; ShowHintInfo("Click Register Button to Register"); //Unregister Events ZkFprint.OnImageReceived -= zkFprint_OnImageReceived; ZkFprint.OnFeatureInfo -= zkFprint_OnFeatureInfo; ZkFprint.OnEnroll -= zkFprint_OnEnroll; btnRegister.Enabled = false; } else { //BEEP AND RED ZkFprint.ControlSensor(13, 1); ZkFprint.ControlSensor(12, 1); Thread.Sleep(100); ZkFprint.ControlSensor(13, 0); ZkFprint.ControlSensor(12, 0); ShowHintInfo("Error, please click register again."); //Unregister Events ZkFprint.OnImageReceived -= zkFprint_OnImageReceived; ZkFprint.OnFeatureInfo -= zkFprint_OnFeatureInfo; ZkFprint.OnEnroll -= zkFprint_OnEnroll; } }
/// <summary> /// 用于处理OnEnrollEvent事件 /// 抛出:指纹仪未初始化 异常 /// </summary> /// <param name="e"></param> /// <param name="fingerprintDevice">指纹设备(如:AxZKFPEngX1)</param> /// <returns></returns> public static string GetFingerstring(IZKFPEngXEvents_OnEnrollEvent e, AxZKFPEngX fingerprintDevice) { if (fingerprintDevice == null) { throw new ArgumentNullException("fingerprintDevice"); } var atemplate = e.aTemplate; string fingerPrintString; try { fingerPrintString = fingerprintDevice.EncodeTemplate1(atemplate); } catch (Exception exception) { MessageBox.Show(exception.Message); throw; } return(fingerPrintString); }