Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. private void VerificationControl1_OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus EventHandlerStatus)
  2. {
  3. Boolean TerminarBucle = false;
  4. Template template1 = new Template();
  5. Template template2 = new Template();
  6. Template template3 = new Template();
  7. Template template4 = new Template();
  8. Template template5 = new Template();
  9. int xint = 1;
  10. byte[] fingerprint1;
  11. byte[] fingerprint2;
  12. byte[] fingerprint3;
  13. byte[] fingerprint4;
  14. byte[] fingerprint5;
  15. int idEmpleado = 0;
  16. string NombreE;
  17.  
  18. foreach (DataRow item in Emp.Rows)//Aqui recorro el datatable que contiene las huellas
  19. {
  20. if (TerminarBucle == true) return;
  21.  
  22. idEmpleado = Convert.ToInt32(item["IdEmpleado"].ToString());
  23. NombreE = item["Nombre"].ToString();
  24. fingerprint1 = (byte[])item["TemplateHuella1"];
  25. fingerprint2 = (byte[])item["TemplateHuella2"];
  26. fingerprint3 = (byte[])item["TemplateHuella3"];
  27. fingerprint4 = (byte[])item["TemplateHuella4"];
  28. fingerprint5 = (byte[])item["TemplateHuella5"];
  29.  
  30. template1.DeSerialize(fingerprint1);
  31. template2.DeSerialize(fingerprint2);
  32. template3.DeSerialize(fingerprint3);
  33. template4.DeSerialize(fingerprint4);
  34. template5.DeSerialize(fingerprint5);
  35.  
  36. verificar1.Verify(FeatureSet, template1, ref resultado1);//Aqui me marca el error, se supone que aqui me compara la huella que tengo almacenada en la base de datos y la que obtengo del lector
  37. verificar2.Verify(FeatureSet, template2, ref resultado2);
  38. verificar3.Verify(FeatureSet, template3, ref resultado3);
  39. verificar4.Verify(FeatureSet, template4, ref resultado4);
  40. verificar5.Verify(FeatureSet, template5, ref resultado5);
  41.  
  42. try//y aqui le digo que si las huellas coinciden me muestre la foto y el nombre de la persona
  43. {
  44. if (resultado1.Verified == true || resultado2.Verified == true || resultado3.Verified == true || resultado4.Verified == true || resultado5.Verified == true)
  45. {
  46. pFotoEmp.Image = publico.BytesAImagen((byte[])item["Fotografia"]);
  47. lNombreEmp.Text = item["Nombre"].ToString();
  48. //MostrarDetalleAsistencias(idEmpleado);
  49.  
  50. int BTA = biss.BuscarTipoAsistencia(idEmpleado);
  51. //verificamos si ya checo entrada y salida
  52. if (BTA == 1)
  53. {
  54. if (biss.VerificarUltimaAsistencia(idEmpleado))
  55. {
  56. biss.ChecarSalida(idEmpleado, DateTime.Now.ToString("HH:mm"));
  57. MessageBox.Show("La salida se ha checado", "Mensage", MessageBoxButtons.OK, MessageBoxIcon.Information);
  58. }
  59. else
  60. {
  61. biss.ChecarEntrada(idEmpleado, DateTime.Now.ToString("HH:mm"));
  62. MessageBox.Show("La entrada se ha checado", "Mensage", MessageBoxButtons.OK, MessageBoxIcon.Information);
  63. }
  64. }
  65. }
  66. TerminarBucle = true;
  67. }
  68. catch (Exception ex)
  69. {
  70. MessageBox.Show("Algo malo paso " + ex.Message, "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  71. TerminarBucle = true;
  72. }
  73. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement