Click or drag to resize

ServiceRouterGetPayrollPayType Method

Returns a GetPayrollPayTypeOut response with a result model List<GetPayrollPayTypeModel>

Namespace: AppOne.Services.V2
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public GetPayrollPayTypeOut GetPayrollPayType(
	GetPayrollPayTypeIn input
)

Parameters

input  GetPayrollPayTypeIn
A new GetPayrollPayTypeIn object

Return Value

GetPayrollPayTypeOut
A GetPayrollPayTypeOut object
Remarks
Use this method to get a results list of GetPayrollPayTypeModel. The GetPayrollPayTypeModel contains the meta data necessary to report on payroll pay types.

DataAction Names

NameDescriptionValues Example
SELECT-ALLReturns all pay types in system regardless of any state.[ignored]
SELECT-ACTIVEReturns only the payroll pay types that are active.[ignored]
SELECT-PAYIDReturns only the payroll pay types by the PayTypeID input values.["-1", "-4", "1", "8"]
Note  Note
Pay types contain both an internal ID labeled 'ID' and a pay type ID labeled PayTypeID
Example
JSON Request
{
    "AuthToken":"..==",
        "DataAction":{
        "Name":"SELECT-PAYID",
        "Values":["-7","-8"]
    }
}
JSON Response
{
   "Report":    {
      "APIVersion": "2.0",
      "ProcessTime": "0.132753",
      "RequestTime": "/Date(1466109592885-0700)/",
      "ResponseTime": "/Date(1466109593017-0700)/",
      "Results": 2
   },
   "Results":    [
       {
         "Code": "OT2",
         "EndDateTime": "/Date(4102470000000-0700)/",
         "ID": 175,
         "IsDeleted": false,
         "IsWorkType": true,
         "Name": "OT2",
         "PayTypeID": -7,
         "StartDateTime": "/Date(1293865200000-0700)/"
      },
      {
         "Code": "OT3",
         "EndDateTime": "/Date(4102470000000-0700)/",
         "ID": 176,
         "IsDeleted": false,
         "IsWorkType": true,
         "Name": "OT3",
         "PayTypeID": -8,
         "StartDateTime": "/Date(1293865200000-0700)/"
      }
   ]
}
SOAP: C# WCF Sample
public void V2_GetPayrollPayType_SOAP_Test()
{
    try
    {
        var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
        {
            // ==================================
            //TEST 1: SELECT-ALL
            int countTest_1 = 0;
            SoapServiceV2.GetPayrollPayTypeRequest request1 = new SoapServiceV2.GetPayrollPayTypeRequest();
            request1.input = new SoapServiceV2.GetPayrollPayTypeIn
            {
                AuthToken = AuthToken,
                DataAction = new DataAction
                {
                    Name = "SELECT-ALL"
                }
            };
            SoapServiceV2.GetPayrollPayTypeResponse response1 = client.GetPayrollPayType(request1);
            countTest_1 = (response1.GetPayrollPayTypeResult.Results != null) ? response1.GetPayrollPayTypeResult.Results.Count : 0;

            var first_id = response1.GetPayrollPayTypeResult.Results.FirstOrDefault().ID;
            if (countTest_1 > 0)
            {
                // ==================================
                //TEST 2: SELECT-PAYID
                int countTest_2 = 0;
                SoapServiceV2.GetPayrollPayTypeRequest request2 = new SoapServiceV2.GetPayrollPayTypeRequest();
                request2.input = new SoapServiceV2.GetPayrollPayTypeIn
                {
                    AuthToken = AuthToken,
                    DataAction = new DataAction
                    {
                        Name = "SELECT-PAYID",
                        // Values =new List<string>{response1.GetPayrollResult.Results[0].EmpIdentifier.ToString()} 
                        Values = new List<string> { first_id.ToString() }
                    }
                };
                SoapServiceV2.GetPayrollPayTypeResponse response2 = client.GetPayrollPayType(request2);
                countTest_2 = (response2.GetPayrollPayTypeResult.Results != null) ? response2.GetPayrollPayTypeResult.Results.Count : 0;
                //Assert.IsTrue(countTest_2 > 0 && countTest_1 > 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