UNIQUE IT

UNIQUE IT

  • 1.7k
  • 61
  • 3.6k

zk attendance device check-in and check-out (In Time - Out Time)

Sep 28 2020 6:19 AM
zk attendance device check-in and check-out (In Time - Out Time) - Need Seperated Column 
**Check-In and Check-Out _ Time Perfectly Not Work,**
showing same InTime and OutTime - Column
InTime Column work okay, but Out time not to show exactly Check-Out time.
**[How to gain proper check-out time into Out-Time column][1]**
 
Out Time Coulumn showing In Time [TIME]-that is wrong...
 
This all program worked with zk-sdk: zkemkeeper
I'm not sure how I implement out time - because of there are only single attendance machine.
How to set check-in and check-out time by textBox.
Thank you.
 
Result I am expecting is like:
EID = 1, Date = 08/01/2020, CheckIn = 08:00:00, CheckOut = 10:00:00
EID = 1, Date = 08/02/2020, InTime = 08:04:00, OutTime = 10:05:00
EID = 2, Date = 08/01/2020, InTime = 08:10:00, OutTime = 10:15:00
EID = 2, Date = 08/02/2020, InTime = 08:00:00, OutTime = 10:20:00
EID = 3, Date = 08/01/2020, InTime = 10:00:00, OutTime =
EID = 4, Date = 08/01/2020, InTime = 08:00:00, OutTime =
EID = 5, Date = 08/01/2020, InTime = 08:00:00, OutTime =
 
  1. private void buttonViewAttendance_Click(object sender, EventArgs e)  
  2. {  
  3. string sdwEnrollNumber = "";  
  4. int idwTMachineNumber = 0;  
  5. int idwVerifyMode = 0;  
  6. int idwInOutMode = 0;  
  7. int idwYear = 0;  
  8. int idwMonth = 0;  
  9. int idwDay = 0;  
  10. int idwHour = 0;  
  11. int idwMinute = 0;  
  12. int idwSecond = 0;  
  13. int idwWorkcode = 0;  
  14. int idwErrorCode = 0;  
  15. int iGLCount = 0;  
  16. int iIndex = 0;  
  17. //------------------------------------------------------  
  18. string sName = "";  
  19. string sPassword = "";  
  20. int iPrivilege = 0;  
  21. bool bEnabled = false;  
  22. int idwFingerIndex;  
  23. string sTmpData = "";  
  24. int iTmpLength = 0;  
  25. int iFlag = 0;  
  26. Cursor = Cursors.WaitCursor;  
  27. listView2.Items.Clear();  
  28. //listView2.BeginUpdate();  
  29. //axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device  
  30. axCZKEM1.EnableDevice(iMachineNumber, false);  
  31. axCZKEM1.ReadAllUserID(iMachineNumber);//read all the user information to the memory  
  32. //Cursor = Cursors.WaitCursor;  
  33. if (axCZKEM1.ReadGeneralLogData(iMachineNumber)) //read all the attendance records to the memory  
  34. {  
  35. while  
  36. (axCZKEM1.SSR_GetGeneralLogData(  
  37. iMachineNumber,  
  38. out sdwEnrollNumber,  
  39. out idwVerifyMode,  
  40. out idwInOutMode,  
  41. out idwYear,  
  42. out idwMonth,  
  43. out idwDay,  
  44. out idwHour,  
  45. out idwMinute,  
  46. out idwSecond,  
  47. ref idwWorkcode))  
  48. {  
  49. iGLCount++;  
  50. listView2.Items.Add(iGLCount.ToString());  
  51. listView2.Items[iIndex].SubItems.Add(sdwEnrollNumber);//modify by Darcy on Nov.26 2009  
  52. foreach (ListViewItem item in listView2.Items)  
  53. {  
  54. if (item.SubItems[1].Text == "1")  
  55. {  
  56. //textBoxEnroll.Text = "Staff-1";  
  57. //item.SubItems[6].Text = "AAA";  
  58. item.SubItems.Add(Text = " " + textBox1st.Text);  
  59. }  
  60. else if (item.SubItems[1].Text == "2")  
  61. {  
  62. item.SubItems.Add(Text = " " + textBox2nd.Text);  
  63. }  
  64. else if (item.SubItems[1].Text == "3")  
  65. {  
  66. item.SubItems.Add(Text = " " + textBox3rd.Text);  
  67. }  
  68. else if (item.SubItems[1].Text == "4")  
  69. {  
  70. item.SubItems.Add(Text = " " + textBox4th.Text);  
  71. }  
  72. else if (item.SubItems[1].Text == "5")  
  73. {  
  74. item.SubItems.Add(Text = " " + textBox5th.Text);  
  75. }  
  76. else if (item.SubItems[1].Text == "6")  
  77. {  
  78. item.SubItems.Add(Text = " " + textBox6th.Text);  
  79. }  
  80. else if (item.SubItems[1].Text == "7")  
  81. {  
  82. item.SubItems.Add(Text = " " + textBox7th.Text);  
  83. }  
  84. else if (item.SubItems[1].Text == "8")  
  85. {  
  86. item.SubItems.Add(Text = " " + textBox8th.Text);  
  87. }  
  88. else  
  89. {  
  90. item.SubItems.Add(Text = "Limited Edition");  
  91. }  
  92. }  
  93. listView2.Items[iIndex].SubItems.Add(idwDay.ToString() + "-" + idwMonth.ToString() + "-" + idwYear.ToString()); // Date  
  94. listView2.Items[iIndex].SubItems.Add(idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString()); // In-Time  
  95. listView2.Items[iIndex].SubItems.Add(idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString()); // Out-Time  
  96. foreach (ListViewItem item in listView2.Items)  
  97. {  
  98. if (item.SubItems[4].Text == item.SubItems[5].Text)  
  99. {  
  100. item.SubItems[5].Text.StartsWith(textBoxInTime.Text);  
  101. }  
  102. }  
  103. listView2.Items[iIndex].SubItems.Add(""); // To performed blank last-column  
  104. iIndex++;  
  105. }  
  106. }  
  107. else  
  108. {  
  109. Cursor = Cursors.Default;  
  110. axCZKEM1.GetLastError(ref idwErrorCode);  
  111. if (idwErrorCode != 0)  
  112. {  
  113. MessageBox.Show("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString(), "Error");  
  114. }  
  115. else  
  116. {  
  117. MessageBox.Show("No data from terminal returns!""Error");  
  118. }  
  119. }  
  120. axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device  
  121. Cursor = Cursors.Hand;  
  122. }

Answers (2)