ServiceRouterGetUserTimeOffBalance Method | |
Namespace: AppOne.Services.V2Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax Exceptions Exception | Condition |
---|
ServiceException |
- A maximum of 50 EmpIdentifiers can be sent per request. Please batch your requests to 50 or less for action SELECT-EMPID.
|
Remarks
Use this method to get a results list of
GetUserTimeOffBalanceModel Note |
---|
For a higher level overview of the business rules for labor-levels see the class WSUserTimeOffBalance of this web method.
For discretionary time off type the available balance seconds will be 2147483647 and the AccuredSeconds and GrandtedSeconds will be 0.
|
DataAction Names
Name | Description | Values Example |
---|
SELECT-EMPID | Returns only the users with the specified employee ID passed in the values property. | "abc-123","123","efg"... |
Caution |
---|
A maximum of 50 EmpIdentifiers can be sent per request. Please batch your requests to 50 or less for action SELECT-EMPID.
|
Example {
"AuthToken":"...",
"ProjectedBalanceDate":"\/Date(1513407600000)\/",
"DataAction":{
"Name":"SELECT-EMPID",
"Values":["1234"]
}
}
{
"Report": {
"APIVersion": "2.0",
"ProcessTime": "2.1635148",
"RequestTime": "/Date(1492460904312-0700)/",
"ResponseTime": "/Date(1492460906475-0700)/",
"Results": 2
},
"Results": [
{
"AccruedSeconds": 0,
"AdjustmentSeconds": 0,
"AvailableBalanceSeconds": 0,
"EmpIdentifier": "1234",
"GrantedSeconds": 0,
"IsRollover": false,
"PayType": "Vacation",
"PayTypeCode": "V",
"PayTypeEndDate": "/Date(4102556399000-0700)/",
"PayTypeID": 18,
"PayTypeIsDeleted": false,
"PayTypeStartDate": "/Date(1328079600000-0700)/",
"ProjectedBalanceSeconds": 0,
"RolloverSecs": 0,
"TimeOffPolicyDetailEndDate": "/Date(4102556399000-0700)/",
"TimeOffPolicyDetailID": 5,
"TimeOffPolicyDetailIsDeleted": true,
"TimeOffPolicyDetailStartDate": "/Date(1505804400000-0700)/",
"UsedSeconds": 0
},
{
"AccruedSeconds": 0,
"AdjustmentSeconds": 0,
"AvailableBalanceSeconds": 0,
"EmpIdentifier": "1234",
"GrantedSeconds": 0,
"IsRollover": false,
"PayType": "Sick",
"PayTypeCode": "Sick",
"PayTypeEndDate": "/Date(4102470000000-0700)/",
"PayTypeID": 3,
"PayTypeIsDeleted": false,
"PayTypeStartDate": "/Date(1309503600000-0700)/",
"ProjectedBalanceSeconds": 0,
"RolloverSecs": 0,
"TimeOffPolicyDetailEndDate": "/Date(4102556399000-0700)/",
"TimeOffPolicyDetailID": 8,
"TimeOffPolicyDetailIsDeleted": false,
"TimeOffPolicyDetailStartDate": "/Date(1505977200000-0700)/",
"UsedSeconds": 0
}
]
}
public void V2_GetUserTimeOffBalance_SOAP_Test()
{
try
{
var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
{
int countTest_1 = 0;
SoapServiceV2.GetUserTimeOffBalanceRequest request1 = new SoapServiceV2.GetUserTimeOffBalanceRequest();
request1.input = new SoapServiceV2.GetUserTimeOffBalanceIn
{
AuthToken = AuthToken,
StartDate = new DateTime(2016, 05, 19),
EndDate = new DateTime(2016, 05, 31),
DateTimeSchema = SoapServiceV2.DateTimeSchema.ISO8601Sort,
DataAction = new DataAction
{
Name = "SELECT-ALL"
}
};
SoapServiceV2.GetUserTimeOffBalanceResponse response1 = client.GetUserTimeOffBalance(request1);
countTest_1 = (response1.GetUserTimeOffBalanceResult.Results != null) ? response1.GetUserTimeOffBalanceResult.Results.Count : 0;
if (countTest_1 > 0)
{
int countTest_2 = 0;
SoapServiceV2.GetUserTimeOffBalanceRequest request2 = new SoapServiceV2.GetUserTimeOffBalanceRequest();
request2.input = new SoapServiceV2.GetUserTimeOffBalanceIn
{
AuthToken = AuthToken,
StartDate = new DateTime(2016, 05, 19),
EndDate = new DateTime(2016, 05, 31),
DateTimeSchema = SoapServiceV2.DateTimeSchema.ISO8601Sort,
DataAction = new DataAction
{
Name = "SELECT-EMPID",
Values = new List<string> { "84" }
}
};
SoapServiceV2.GetUserTimeOffBalanceResponse response2 = client.GetUserTimeOffBalance(request2);
countTest_2 = (response2.GetUserTimeOffBalanceResult.Results != null) ? response2.GetUserTimeOffBalanceResult.Results.Count : 0;
Assert.IsTrue(countTest_1 > 0);
}
else
{
Assert.IsTrue(countTest_1 > 0);
}
});
RunServiceClient(actionTestLogic);
}
catch (FaultException<SoapServiceV2.ServiceException> fe)
{
Assert.Fail(fe.Detail.Message);
}
}
See Also