maintainEmployeeDetail() 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. Alternate Method
  10. Related Methods

Function

  • Add a new employee or update an existing one with detail level information

Syntax

  • MaintainEmployeeResult = AeXMLBridge.maintainEmployeeDetail(AeEmployeeDetail, AddEmpMode, BadgeManagement);

Parameters

Return Value

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
32
33
34
35
string empID = “1234”;                                                     
// we are using employee with ID “1234” and are going to update

TAeEmployeeDetail empDetail = ws.getEmployeeDetailByIDNum(empID);

empDetail.Address1 = “1234 South Elm”;
empDetail.Address2 = string.Empty;
empDetail.Address3 = string.Empty;
empDetail.AddressCity = “Chicago”;
empDetail.AddressStateProv = “IL”;
empDetail.AddressZIPPC = “60606”;
empDetail.AvgWeeklyHrs = 40;
empDetail.BirthDate = “1990-01-14”;
empDetail.CurrentRate = 15.00d;
empDetail.CurrentRateEffDate = DateTime.Now.AddDays(-7).ToString;
empDetail.EmpID = empID;
empDetail.Address2 = string.Empty;
// note these are not all of the fields in the structure. you can
// update any or all fields, as well as those included in the base strcuture

TAddEmpMode addEmpMode = TAddEmpMode.aemAuto;
// setting this to auto will force the method to see if an employee
// with the EmpID already exists

TBadgeManagement badgeManagement = TBadgeManagement.bmAuto;
// setting to bmAuto will generate a new badge number if one doesn't exist

try
{
TMaintainEmployeeResult res = ws.maintainEmployeeDetail(empDetail, addEmpMode, badgeManagement);
}
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
29
30
Dim empID As String = “1234
‘ we are using employee with ID “1234and are going to update

Dim empDetail As TAeEmployeeDetail = ws.getEmployeeDetailByIDNum(empID)

empDetail.Address1 = “1234 South Elm”
‘ these are not all of the fields in the structure. you can update any or all fields, as well as those included in the
‘ base structure (TAeEmployeeBasic)

empDetail.Address2 = String.Empty
empDetail.Address3 = String.Empty
empDetail.AddressCity = “Chicago”
empDetail.AddressStateProv = “IL”
empDetail.AddressZIPPC = “60606
empDetail.AvgWeeklyHrs = 40
empDetail.BirthDate = “1990-01-14
empDetail.CurrentRate = 15.0
empDetail.CurrentRateEffDate = DateTime.Now.AddDays(-7).ToString
empDetail.EmpID = empID

Dim addEmpMode As TAddEmpMode = TAddEmpMode.aemAuto
‘ setting this to auto will force the method to see if an employee
with the EmpID already exists
Dim badgeManagement As TBadgeManagement = TBadgeManagement.bmAuto

Try
Dim res As TMaintainEmployeeResult = ws.maintainEmployeeDetail(empDetail, addEmpMode, badgeManagement)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • When doing an Add, and you know the name of the employee, you must enter both the FirstName and LastName fields. The EmpName field will be generated by concatenating the FirstName and LastName fields.

  • This method operations identically to the maintainEmployeeBasic method but simply contains more fields that can be maintained on behalf of employees

  • The TAeEmployeeDetail structure descends from the TAeEmployeeBasic structure and contains all the fields present in that structure

  • For those fields associated with an effective date, the effective date will be automatically applied if not specified

  • Example: The CurrentRate field contains the employee’s current rate of pay. If this field is changed, indicating that the employee’s rate has changed, the system will also look at the value of the CurrentRateEffDate field. This field contains the date the new rate of pay will take effect. If this field is zero (unassigned) the system will automatically populate this date with the current date and make the new rate effective on the date the rate was changed. If the current value of CurrentRate is sent along with a new CurrentRateEffDate, the effective date is changed for the existing rate. The rate does not change and is not logged as a changed rate.

  • When the employee’s Pay Type is changed, a new current rate is exepcted. While -1 is a “no change” value for CurrentRate, any integer will be accepted in this case

Possible Errors

  • Invald date formats

Preferred Method

maintainEmployeeDetail2

Alternate Method

maintainEmployeeBasic

getEmployeeBasicByIDNum
getEmployeeDetailByIDNum
setEmployeeBasic
setEmployeeDetail2
setEmployeeESSEmailByIDNum
setEmployeeESSPINByIDNum
setEmployeeTZByIDNum
setManuallySelectedEmployeeData

Back to Top