Kamran Akhter
Kamran Akhter

Reputation: 513

How to download attendance record with specified time via zkemkeeper

I m using zkemkeeper.dll to download attendance record from biometric device.

if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
{   
   while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out idwEnrollNumber, out idwVerifyMode
        , out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkCode))//get records from the memory
   {
    //code here   
   }
}

My question is how can I download attendance record with specified time (date range) via zkemkeeper.
The function ReadGeneralLogData loads all the record from the device which is taking too much time which nearly hangs the device as device contains more than 15 thousand records.
Also don't know how to use GetDataFile function, i mean where it saves the file.
Please help

Upvotes: 1

Views: 18526

Answers (6)

Alejandro del Río
Alejandro del Río

Reputation: 4046

I had a similar problem and I had to solve it this way. In case your application is using a database or file based data store, you can clear the log of the device after you save all your data.

if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
{   
   while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out idwEnrollNumber, out idwVerifyMode
        , out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkCode))//get records from the memory
   {
    //save your data here   
   }

//after that you clear the machine log
    if (axCZKEM1.ClearGLog(iMachineNumber))
    {
        axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be refreshed
        message = "All att Logs have been cleared from teiminal!, Success";
    }
    else
    {
        axCZKEM1.GetLastError(ref idwErrorCode);
        message = "Operation failed, ErrorCode = " + idwErrorCode.ToString();
    }


}

This way your next download will be much faster and the clear operation as well. You are going to be able to download all log data from the device every time you need and of course you can filter your data once is stored in your database.

The users don't know if the log data is in the device or in the database beleave me. Which is important is the data is stored somewhere and the users can see it.

Upvotes: 4

Shah Nawaz Joyo
Shah Nawaz Joyo

Reputation: 1

try this..

lstMachineInfo = manipulator.GetLogData(objZkeeper,int.Parse(tbxMachineNumber.Text.Trim()));
String dtFrom = dateFrom.Value.ToShortDateString();
String dtTo = dateTo.Value.ToShortDateString();

List<MachineInfo> newList = list.Where(x => x.DateOnlyRecord >= dateFrom.Value.AddDays(-1) && x.DateOnlyRecord <= dateTo.Value).ToList();
ShowStatusBar(newList.Count() + " records found !!", true); 
dataGridView.DataSource = newList;

Upvotes: 0

save it to your database after fetch then Select * FROM Where Like

Upvotes: -1

GAYATHRI
GAYATHRI

Reputation: 11

first of all you have to get read all the records of the memory.. then i created one form using one date time picker and one button. now you have to equal the machine date and selected date. finally you write the save function coding

Upvotes: -1

GAYATHRI
GAYATHRI

Reputation: 11

I got a solution download attendance record with specified time (date range) via zkemkeeper.

If idwYear.ToString() = Date1.Value.Year.ToString() And idwMonth.ToString() = Date1.Value.Month.ToString() And idwDay.ToString() = Date1.Value.Day.ToString() Then
             //type coding
End If

Upvotes: 1

Ganapathi D
Ganapathi D

Reputation: 79

By default zkemkeeper.dll won't support "download attendance records between specified date range". For this you have to use customized SDK from ZK

Upvotes: 2

Related Questions