ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.9k

How to get last row attenndance of via zkemkeeper

Apr 3 2019 8:11 PM
How to get last row attenndance of via zkemkeeper ?
I need to get attendance for every user
when make attendance it will pull last record per date today
i cannot do that so i ask 
I create windows form and i put timer every second get last attendance per employee
only last row
How to do that please ?
i can only get all rows from log data but cannot get last row based on time per datetoday
  1. //Get all data    
  2.  ICollection<MachineInfo> lstMachineInfo = manipulator.GetLogData(objZkeeper, int.Parse(tbxMachineNumber.Text.Trim()));    
  3.  public ICollection<MachineInfo> GetLogData(ZkemClient objZkeeper, int machineNumber)    
  4.         {    
  5.             string dwEnrollNumber1 = "";    
  6.             int dwVerifyMode = 0;    
  7.             int dwInOutMode = 0;    
  8.             int dwYear = 0;    
  9.             int dwMonth = 0;    
  10.             int dwDay = 0;    
  11.             int dwHour = 0;    
  12.             int dwMinute = 0;    
  13.             int dwSecond = 0;    
  14.             int dwWorkCode = 0;    
  15.     
  16.             ICollection<MachineInfo> lstEnrollData = new List<MachineInfo>();    
  17.     
  18.             objZkeeper.ReadAllGLogData(machineNumber);    
  19.     
  20.             while (objZkeeper.SSR_GetGeneralLogData(machineNumber, out dwEnrollNumber1, out dwVerifyMode, out dwInOutMode, out dwYear, out dwMonth, out dwDay, out dwHour, out dwMinute, out dwSecond, ref dwWorkCode))    
  21.     
  22.     
  23.             {    
  24.                 string inputDate = new DateTime(dwYear, dwMonth, dwDay, dwHour, dwMinute, dwSecond).ToString();    
  25.     
  26.                 MachineInfo objInfo = new MachineInfo();    
  27.                 objInfo.MachineNumber = machineNumber;    
  28.                 objInfo.IndRegID = int.Parse(dwEnrollNumber1);    
  29.                 objInfo.DateTimeRecord = inputDate;    
  30.     
  31.                 lstEnrollData.Add(objInfo);    
  32.             }    
  33.     
  34.             return lstEnrollData;    
  35.         }    
  36. public class MachineInfo  
  37. {  
  38.   
  39.     {    
  40.         public int MachineNumber { getset; }    
  41.         public int IndRegID { getset; }    
  42.         public string DateTimeRecord { getset; }    
  43.     
  44.         public DateTime DateOnlyRecord    
  45.         {    
  46.             get { return DateTime.Parse(DateTime.Parse(DateTimeRecord).ToString("yyyy-MM-dd")); }    
  47.         }    
  48.         public DateTime TimeOnlyRecord    
  49.         {    
  50.             get { return DateTime.Parse(DateTime.Parse(DateTimeRecord).ToString("hh:mm:ss tt")); }    
  51.         }    
  52.     
  53.     }    
 
 How to get lastrow from icollection lstMachineInfo