deleteTimeCardEdit Method

Table of Contents

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

Function

  • Removes an adjustment previously made to an employee’s time card

Syntax

  • AeXMLBridge.deleteTimeCardEdit(AeEdit);

Parameters

Return Value

  • None

Sample Code

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
32
string empID = "1234";                                                            
// using employee 1234

TDateRangeEnum dateRange = TDateRangeEnum.drCurrPeriod;
// using the current period

string minDate = string.Empty;
string maxDate = string.Empty;
// set to empty since TDateRangeEnum value is not drCustom

TAeEdit[] edits = ws.extractEmployeeEditsByIDNum(empID, dateRange, minDate, maxDate);
// extract existing edits within date range

if (edits.Length > 0)
// make sure we have an edit to delete
{
foreach (TAeEdit edit in edits)
{
if (edit.SiteID != -1)
// SiteID field cannot be -1
{
try
{
ws.deleteTimeCardEdit(edit);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
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
Dim filekey As Integer = 1234
' using employee with filekey 1234

Dim dateRange As TDateRangeEnum = TDateRangeEnum.drCurrPeriod
' using the current period

Dim minDate As String = String.Empty
' set to empty since TDateRangeEnum value is not drCustom
Dim maxDate As String = String.Empty

Dim edits As TAeEdit() = ws.extractEmployeeEditsByFilekey(filekey, dateRange, minDate, maxDate)
' extract existing edits within date range

If edits.Length > 0 Then
' make sure we have an edit to delete
For Each edit As TAeEdit In edits
If edit.SiteID <> -1 Then
' SiteID field cannot be -1

Try
ws.deleteTimeCardEdit(edits(0))
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
Next
End If

Remarks

  • The SiteID field within the TAeEdit structure is the only field acted upon. This field contains a unique identifier the system uses to reference the adjustment.
  • When extracting the edits, you must set the TDateRangeEnum parameter to either drCurrPeriod or drPrevPeriod
  • If SiteID value = -1, the adjustment cannot be deleted

Possible Errors

  • SiteID cannto be -1

authPeriodTimeCardByIDNum
cancelTimeCardEdit
performTimeCardEdit
unAuthPeriodTimeCardByIDNum

Back to Top