registerEmployeeGPSPresenceByFilekey() 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

  • Registers an employee’s location using GPS coordinates

Syntax

  • AeXMLBridge.registerEmployeeGPSPresenceByFilekey(Filekey, TimeStamp, TGPSCoordsEnum, Latitude, Longitude, Accuracy, Altitude);

Parameters

  • Integer - employee filekey
  • String - timestamp (yyyy-MM-dd HH:mm:ss format)
  • 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
int filekey = 1234;                                               
// using employee with filekey 1234

string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// getting timestamp

TGPSCoordsEnum coords = TGPSCoordsEnum.gpsOk;

double latitude = 150.5;
double longitude = 15.4;
double accuracy = 0;
double altitude = 0;

try
{
ws.registerEmployeeGPSPresenceByFilekey(filekey, coords, latitude, longitude, accuracy, altitude);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

Sample Code

VB.Net

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Dim filekey As Integer = 1234
' using employee with filekey 1234

Dim ts As String = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
' getting timestamp

Dim coords As TGPSCoordsEnum = TGPSCoordsEnum.gpsOk

Dim latitude As Double = 150.5
Dim longitude As Double = 15.4
Dim accuracy As Double = 0
Dim altitude As Double = 0

Try
ws.registerEmployeeGPSPresenceByFilekey(filekey, coords, latitude, longitude, accuracy, altitude)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • If unknown, can set latitude, longitude, accuracy and altitude to zero

Possible Errors

  • Unable to locate employee with filekey
  • Invalid date/time format

Preferred Method

registerEmployeeGPSPresenceByIDNum

appendEmployeeGeoPunchByIDNum
appendEmployeePunchByIDNum
appendEmployeeTransferByIDNum
extractEmployeeGPSRegistrationsByIDNum
extractTimeClockStations
getStationsSimple
punchEmployeeGeoNowByIDNum
punchEmployeeNowByIDNum
transferEmployeeNowByIDNum

Back to Top