IWsEndUserGetScheduleOccurrences Method |
Namespace: Aruba.Cloud.WsEndUser
[OperationContractAttribute] WsResult<List<ScheduledOperationOccurrence>> GetScheduleOccurrences( GetScheduleOccurrencesRequest operationRequest )
public static string GetScheduleOccurrences(WsEndUserClient client, DateTime dateStart, DateTime dateEnd) { //specify the account login details client.ClientCredentials.UserName.UserName = "ARU-0000"; client.ClientCredentials.UserName.Password = "0123456789"; StringBuilder stringBuilder = new StringBuilder(); try { // create the object GetScheduleOccurrencesRequest for the request // with data to process GetScheduleOccurrencesRequest request = new GetScheduleOccurrencesRequest(); request.ScheduleStartDate = dateStart; request.ScheduleEndDate = dateEnd; // call method GetScheduleOccurrences, // obtaining a WsResultOfArrayOfScheduledOperationOccurrence item WsResultOfArrayOfScheduledOperationOccurrence result = client.GetScheduleOccurrences(request); //if the call is Success print history values if (result.Success) { // get Value returned from server ScheduledOperationOccurrence[] scheduledOperations = result.Value; foreach (ScheduledOperationOccurrence operation in scheduledOperations) { stringBuilder.Append(" ---- Scheduled Operation ---- "); stringBuilder.Append(" Type: "); stringBuilder.Append(operation.OperationType); stringBuilder.Append(" ID: "); stringBuilder.Append(operation.ScheduleOperationID); stringBuilder.Append(" Server Date Time: "); stringBuilder.Append(operation.ScheduleDateTime); } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { // re-run the error throw new ApplicationException(ex.Message); } return stringBuilder.ToString(); }