appendEmployeeGeoPunchByFilekey() Method

Table of Contents

  1. Function
  2. Syntax
  3. Parameters
  4. Return Value
  5. Sample Code
  6. Remarks
  7. Possible Errors
  8. Preferred Method
  9. Related Methods

Function

  • Appends an employee punch with geographical information

Syntax

  • AeXMLBridge.appendEmployeeGeoPunchByFilekey(Filekey, TimeStamp, Station, TransType, GPSCoordsEnum, Latitude, Longitude, Accuracy, Altitude);

Parameters

  • Integer - employee filekey
  • String - timestamp (yyyy-MM-dd HH:mm:ss.fff format)
  • Integer - clock station
  • Integer - transaction type
  • Enumeration - TGPSCoordsEnum
  • Double - latitude coordinate
  • Double - longitude coordinate
  • Double - accuracy
  • Double - altitude

Return Value

  • None

Sample Code

C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
// get timestamp and format it

int filekey = 1234;
// employee fileky

TAeBasicDataItem[] stations = ws.getStationsSimple();
// get the clock station id

int transType = 0;
// 0 = punch

TGPSCoordsEnum coords = TGPSCoordsEnum.gpsOk;

double latitude = 42.3457d;
// actual latitude coordinate
double longitude = -142.3245d;
// actual longitude coordinate

double accuracy = 0;
double altitude = 0;

try
{
ws.appendEmployeeGeoPunchByFilekey(filekey, ts, stations[0].Num, transType, cords, latitude, longitude, accuracy, altitude);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

VB.Net

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Dim ts As String = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
' get timestamp and format it

Dim filekey As Integer = 1234
' employee fileky

Dim stations As TAeBasicDataItem() = ws.getStationsSimple()
' get the clock station id

Dim transType As Integer = 0
' 0 = punch

Dim coords As TGPSCoordsEnum = TGPSCoordsEnum.gpsOk
Dim latitude As Double = 42.3457
' actual latitude coordinate

Dim longitude As Double = -142.3245
' actual longitude coordinate

Dim accuracy As Double = 0
Dim altitude As Double = 0

Try
ws.appendEmployeeGeoPunchByFilekey(filekey, ts, stations(0).Num, transType, cords, latitude, longitude, accuracy, altitude)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • Use getStationsSimple to retrieve a list of clock group stations if needed
  • If station parameter is unknown or not available, enter 0
  • Parameters latitude, longitude, accuracy and altitude can be set to zero if unknown

Possible Errors

  • Unable to locate employee with Filekey
  • yyyy-mm-dd required [Date supplied in invalid format]

Preferred Method

appendEmployeeGeoPunchByIDNum

appendEmployeePunchByIDNum
appendEmployeePunchByFilekey
extractEmployeeTransactionsByIDNum
extractEmployeeTransactionsByFilekey
extractRangedTransactionsUsingHyperQuery
punchEmployeeGeoNowByIDNum
punchEmployeeGeoNowByFilekey
punchEmployeeNowByIDNum
punchEmployeeNowByFilekey