Click or drag to resize

ServiceRouterUpdateUserPayAdjust Method

Updates a UpdateUserPayAdjustIn payload with a model List<UpdateUserPayAdjustModel>

Namespace: AppOne.Services.V2
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public UpdateUserPayAdjustOut UpdateUserPayAdjust(
	UpdateUserPayAdjustIn input
)

Parameters

input  UpdateUserPayAdjustIn
A new UpdateUserPayAdjustIn object

Return Value

UpdateUserPayAdjustOut
A UpdateUserPayAdjustOut object
Remarks
Updates a UpdateUserPayAdjustIn payload with a model List<UpdateUserPayAdjustModel>. The UpdateUserPayAdjustModel contains the meta data necessary to report on a users schedule.

Example
JSON Request
{
    "AuthToken":"...",
    "AutoAdd":true,
    "Payload":[{
        "ID":96,
        "Amount":77.77,
        "EmpIdentifier":"1234",
        "EnableHomeLaborLevelAssignment":true,
        "Notes":"String_Content",
        "PayAdjustmentDate":"\/Date(1470034800000)\/",
        "PayAdjustmentID":1,
        "Unit":12.3,
        "LL01ID":6
    },
     {
        "ID":96,
        "Amount":77.77,
        "EmpIdentifier":"1234",
        "EnableHomeLaborLevelAssignment":true,
        "Notes":"String_Content",
        "PayAdjustmentDate":"\/Date(1470034800000)\/",
        "PayAdjustmentID":1,
        "Unit":12.3,
        "LL01ID":5
    }]
}
JSON Response
{
   "Report":    {
      "APIVersion": "2.0",
      "ProcessTime": "0.066303",
      "RequestTime": "/Date(1480635249783-0700)/",
      "ResponseTime": "/Date(1480635249849-0700)/",
      "Results": 2
   },
   "Results":    [
            {
         "ID": 106,
         "Messages": ["Pay adjustment successfully updated"],
         "Status": 1
      },
            {
         "ID": 0,
         "Messages": ["Invalid ordinal position for labor-level-detail value [5] received."],
         "Status": 0
      }
   ]
}
SOAP: C# WCF Sample
public void V2_UpdateUserPayAdjust_SOAP_Test()
{
    try
    {
        var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
        {
            List<int> payAdjustmentIds = new List<int>();
            // ==================================
            //ADD PayAdjustment
            SoapServiceV2.AddUserPayAdjustRequest request1 = new SoapServiceV2.AddUserPayAdjustRequest();
            List<SoapServiceV2.AddUserPayAdjustModel> payLoad = new List<AddUserPayAdjustModel>();
            SoapServiceV2.AddUserPayAdjustModel payLoadItem = new AddUserPayAdjustModel
            {
                EmpIdentifier = "123",
                EnableHomeLaborLevelAssignment = true,
                PayAdjustmentID = 1,
                PayAdjustmentDate = ChangeTime(DateTime.Now, 8, 0, 0, 0),
                Unit = 1,
                Amount = 1
            };
            payLoad.Add(payLoadItem);
            request1.input = new SoapServiceV2.AddUserPayAdjustIn
            {
                AuthToken = AuthToken,
                Payload = payLoad
            };
            SoapServiceV2.AddUserPayAdjustResponse response1 = client.AddUserPayAdjust(request1);
            int payAdjustmentId = response1.AddUserPayAdjustResult.Results.Where(s => s.ID != 0).Select(s => s.ID).SingleOrDefault();
            //Update PayAdjustment
            bool pass = true;
            SoapServiceV2.UpdateUserPayAdjustRequest request2 = new SoapServiceV2.UpdateUserPayAdjustRequest();
            List<SoapServiceV2.UpdateUserPayAdjustModel> payLoadUpdate = new List<UpdateUserPayAdjustModel>();

            SoapServiceV2.UpdateUserPayAdjustModel payLoadItemUpdate = new UpdateUserPayAdjustModel
            {
                ID = payAdjustmentId,
                EmpIdentifier = "123",
                EnableHomeLaborLevelAssignment = true,
                PayAdjustmentID = 1,
                PayAdjustmentDate = ChangeTime(DateTime.Now, 8, 0, 0, 0),
                Unit = 1,
                Amount = 1
            };
            payLoadUpdate.Add(payLoadItemUpdate);
            request2.input = new SoapServiceV2.UpdateUserPayAdjustIn
            {
                AuthToken = AuthToken,
                Payload = payLoadUpdate
            };
            SoapServiceV2.UpdateUserPayAdjustResponse response2 = client.UpdateUserPayAdjust(request2);
            pass = (response2.UpdateUserPayAdjustResult.Results != null && response2.UpdateUserPayAdjustResult.Results.Count > 0) ? true : false;
            Assert.IsTrue(pass);
            //Get PayAdjustment ID and remove
            payAdjustmentIds.Add(payAdjustmentId);
            DeletePayAdjustments(payAdjustmentIds);

        });

        RunServiceClient(actionTestLogic);
    }
    catch (FaultException<SoapServiceV2.ServiceException> fe)
    {
        Assert.Fail(fe.Detail.Message);
    }
}
See Also