Click or drag to resize

WSUserScheduleUpdateUserSchedule Method

Updates a UpdateUserScheduleIn payload with a model List<UpdateUserScheduleModel>

Namespace: AppOne.Services.V2.Methods
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public UpdateUserScheduleOut UpdateUserSchedule(
	UpdateUserScheduleIn input
)

Parameters

input  UpdateUserScheduleIn
A new UpdateUserScheduleIn object

Return Value

UpdateUserScheduleOut
A UpdateUserScheduleOut object
Remarks
Updates a UpdateUserScheduleIn payload with a model List<UpdateUserScheduleModel>. The UpdateUserScheduleModel contains the meta data necessary to report on a a users schedule.

Note  Note
See the parent object AddUserScheduleModel for a full list of all properties that belong to UpdateUserScheduleModel.

Note  Note
To update the schedule details see the UpdateUserScheduleDetail(UpdateUserScheduleDetailIn) method
Example
JSON Request
{
    "AuthToken":"String_Content",
    "Payload":[{
        "EmpIdentifier":"String_Content",
        "ID":655,
        "EndDateTime":"\/Date(928174800000-0700)\/",
        "PayTypeID":-1,
        "StartDateTime":"\/Date(928174800000-0700)\/",
            "LLID01": 3,
            "LLID02": 1,
            "LLID03": 5,
            "LLID04": 16,
            "LLID05": 0,
            "LLID06": 0,
            "LLID07": 0,
            "LLID08": 0,
            "LLID09": 0,
            "LLID10": 0,
            "LLID11": 0,
            "LLID12": 0,
            "LLID13": 0,
            "LLID14": 0,
            "LLID15": 0
    }]
}
JSON Response
{
    "Report": {
        "ProcessTime": "0.0405271",
        "RequestTime": "/Date(1446148549877-0700)/",
        "ResponseTime": "/Date(1446148549918-0700)/",
        "Results": 1
    },
    "Results": [
        {
            "ID": 655,
            "Messages": [
                "Schedule was updated successfully"
            ],
            "Status": 0
        }
    ]
}
SOAP: C# WCF Sample
public void V2_UpdateUserSchedule_SOAP_Test()
{
    try
    {
        var actionTestLogic = new Action<SoapServiceV2.ServiceRouterClient>((client) =>
        {
            List<int> scheduleIds = new List<int>();
            // ==================================
            //ADD Schedule
            SoapServiceV2.AddUserScheduleRequest request1 = new SoapServiceV2.AddUserScheduleRequest();
            List<SoapServiceV2.AddUserScheduleModel> payLoad = new List<AddUserScheduleModel>();
            SoapServiceV2.AddUserScheduleModel payLoadItem = new AddUserScheduleModel
            {
                EmpIdentifier = "123",
                StartDateTime = ChangeTime(DateTime.Now, 8, 0, 0, 0),
                EndDateTime = ChangeTime(DateTime.Now, 16, 0, 0, 0),
                PayTypeID = PayType.PayTypes.Work.GetHashCode(),
                EnableHomeLaborLevelAssignment = true
            };
            payLoad.Add(payLoadItem);
            request1.input = new SoapServiceV2.AddUserScheduleIn
            {
                AuthToken = AuthToken,
                Payload = payLoad
            };
            SoapServiceV2.AddUserScheduleResponse response1 = client.AddUserSchedule(request1);
            int scheduleId = response1.AddUserScheduleResult.Results.Where(s => s.ID != 0).Select(s => s.ID).SingleOrDefault();
            //Update Schedule
            bool pass = true;
            SoapServiceV2.UpdateUserScheduleRequest request2 = new SoapServiceV2.UpdateUserScheduleRequest();
            List<SoapServiceV2.UpdateUserScheduleModel> payLoadUpdate = new List<UpdateUserScheduleModel>();

            SoapServiceV2.UpdateUserScheduleModel payLoadItemUpdate = new UpdateUserScheduleModel
            {
                ID = scheduleId,
                EmpIdentifier = "123",
                StartDateTime = ChangeTime(DateTime.Now, 8, 0, 0, 0),
                EndDateTime = ChangeTime(DateTime.Now, 16, 0, 0, 0),
                PayTypeID = PayType.PayTypes.Work.GetHashCode(),
                EnableHomeLaborLevelAssignment = true
            };
            payLoadUpdate.Add(payLoadItemUpdate);
            request2.input = new SoapServiceV2.UpdateUserScheduleIn
            {
                AuthToken = AuthToken,
                Payload = payLoadUpdate
            };
            SoapServiceV2.UpdateUserScheduleResponse response2 = client.UpdateUserSchedule(request2);
            pass = (response2.UpdateUserScheduleResult.Results != null && response2.UpdateUserScheduleResult.Results.Count > 0) ? true : false;
            Assert.IsTrue(pass);
            //Get Schedule ID and remove
            scheduleIds.Add(scheduleId);
            DeleteSchedules(scheduleIds);

        });

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