Click or drag to resize

GetUserTimeOffBalanceInDataAction Property

A simple query abstraction layer used to provide a mechanism by which methods can make simple query calls to various models.
* Required Property

Namespace: AppOne.Services.V2.Contracts
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public DataAction DataAction { get; set; }

Property Value

DataAction
Remarks
The DataAction property is required to get results from GetUserTimeOffBalance(GetUserTimeOffBalanceIn) method. Below is a list of the available DataAction name values that can used to return a dynamic results set

DataAction Names

NameDescriptionValues Example
SELECT-EMPIDReturns only the users with the specified employee ID passed in the values property."abc-123","123","efg"...
Example
JSON Request
{
    "AuthToken":"...",
    "ProjectedBalanceDate":"\/Date(1513407600000)\/",
    "DataAction":{
        "Name":"SELECT-EMPID",
        "Values":["1234"]
    }
}
JSON Response
{
   "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
      }
   ]
}
SOAP: C# WCF Sample
public void V2_GetUserTimeOffBalance_SOAP_Test()
{
    try
    {
        var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
        {
            // ==================================
            //TEST 1: SELECT-ALL
            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)
            {
                // ==================================
                //TEST 2: SELECT-ID
                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>{response1.GetUserTimeOffBalanceResult.Results[0].EmpIdentifier.ToString()} 
                        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