ServiceRouterGetUserTimeOffRequest Method | |
Namespace: AppOne.Services.V2Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax Exceptions Exception | Condition |
---|
ServiceException |
- Start Date and End Date range should be with in 60 days
- End Date range should be after Start Date Range
|
Remarks
Use this method to get a results list of
GetUserTimeOffRequestModel. The
GetUserTimeOffRequestModel contains the meta data necessary to report on a
a users time-off request.
DataAction Names
Name | Description | Values Example |
---|
SELECT-ALL | Returns all users in system regardless of any state. | [ignored] |
SELECT-EMPID | Returns only the users with the specified employee ID passed in the values property. | "abc-123","123","efg"... |
SELECT-EMPID-SINGLE | Returns only one user with the specified employee ID passed in the values property. The option allows for unlimited date ranges | "abc-123","123","efg"... |
Note |
---|
The StartDate and EndDate both should be with in 60 days of each other or an exception will be returned.
To increase the responsiveness of this service call use a short time span between the StartDate and EndDate
or disable the IgnoreDeletedRequests property.
Layout Overview:
Within the time off rules there is the concept of request data and detail data. Below are the differences between each:
Property | Description |
---|
Request: |
This data is higher level data such as the complete start and end times for a given duration and the total time taken for a request. A request can consist of several detail items.
For example a request from 07/01/2000 to 07/03/2000 would have three separate detail items with one detail item to represent a single day.
| Detail: | This data is lower level data of which belong to a specific request where each detail will have one parent. |
The IgnoreDetails flag will return the details for every single day that was requested. Please only use this flag if the data is needed.
|
Example {
"AuthToken": "...",
"StartDate":"\/Date(1462086000000+0000)\/",
"EndDate":"\/Date(1464678000000+0000)\/",
"DateTimeSchema":0,
"IgnoreDeletedRequests":false,
"DataAction":{
"Name":"SELECT-ALL",
"Values":[""]
}
}
{
"Report": {
"APIVersion": "2.0",
"ProcessTime": "0.0182467",
"RequestTime": "/Date(1463093096606+0000)/",
"ResponseTime": "/Date(1463093096624+0000)/",
"Results": 1
},
"Results": [{
"ID": 980,
"DateTimeSubmitted": "/Date(1463106734903+0000)/",
"DurationPerDaySecs": 28800,
"EmpIdentifier": "5555",
"EmpNotes": "e note",
"EndDateTime": "/Date(1463522400000+0000)/",
"EndDateTimeSchema": "2016-05-17T15:00:00",
"IncludeWeekends": true,
"PayTypeID": 9,
"StartDateTime": "/Date(1463407200000+0000)/",
"StartDateTimeSchema": "2016-05-16T07:00:00",
"StatusType": 0,
"Detail":[
{
"ID": 191600,
"EndDateTime": "/Date(1463436000000+0000)/",
"EndDateTimeSchema": "2016-05-17T15:00:00",
"IsDeleted": false,
"MgrNotes": "",
"StartDateTime": "/Date(1463407200000+0000)/",
"StartDateTimeSchema": "2016-05-16T07:00:00",
"StatusChangedBy": 0,
"StatusChangedOn": "/Date(-2208963600000+0000)/",
"StatusType": 0
},
{
"ID": 191601,
"EndDateTime": "/Date(1463522400000+0000)/",
"EndDateTimeSchema": "2016-05-17T15:00:00",
"IsDeleted": false,
"MgrNotes": "",
"StartDateTime": "/Date(1463493600000+0000)/",
"StartDateTimeSchema": "2016-05-16T07:00:00",
"StatusChangedBy": 0,
"StatusChangedOn": "/Date(-2208963600000+0000)/",
"StatusType": 0
}
]
}]
}
public void V2_GetUserTimeOffRequest_SOAP_Test()
{
try
{
var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
{
int countTest_1 = 0;
SoapServiceV2.GetUserTimeOffRequestRequest request1 = new SoapServiceV2.GetUserTimeOffRequestRequest();
request1.input = new SoapServiceV2.GetUserTimeOffRequestIn
{
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.GetUserTimeOffRequestResponse response1 = client.GetUserTimeOffRequest(request1);
countTest_1 = (response1.GetUserTimeOffRequestResult.Results != null) ? response1.GetUserTimeOffRequestResult.Results.Count : 0;
if (countTest_1 > 0)
{
int countTest_2 = 0;
SoapServiceV2.GetUserTimeOffRequestRequest request2 = new SoapServiceV2.GetUserTimeOffRequestRequest();
request2.input = new SoapServiceV2.GetUserTimeOffRequestIn
{
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.GetUserTimeOffRequestResponse response2 = client.GetUserTimeOffRequest(request2);
countTest_2 = (response2.GetUserTimeOffRequestResult.Results != null) ? response2.GetUserTimeOffRequestResult.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