Example #1
0
 public IList<incentiveItem> GetExclusiveIncentives(sessionType session, string region, incentiveTypeEnum? incentiveType, int? programId, int? adspaceId, int page, int items, out int total)
 {
     SearchExclusiveIncentivesRequest SearchExclusiveIncentivesRequest = new SearchExclusiveIncentivesRequest();
       DateTime utcNow = DateTime.UtcNow;
       SearchExclusiveIncentivesRequest.nonce = Signature.GetNonce();
       SearchExclusiveIncentivesRequest.connectId = session.connectId;
       SearchExclusiveIncentivesRequest.signature = Signature.SoapSignature(utcNow, session.secretKey, "publisherservice", "searchexclusiveincentives", SearchExclusiveIncentivesRequest.nonce);
       SearchExclusiveIncentivesRequest.timestamp = Signature.GetZDateTime(utcNow);
       if (adspaceId.HasValue)
       {
     SearchExclusiveIncentivesRequest.adspaceId = adspaceId.Value;
     SearchExclusiveIncentivesRequest.adspaceIdSpecified = true;
       }
       if (programId.HasValue)
       {
     SearchExclusiveIncentivesRequest.programId = programId.Value;
     SearchExclusiveIncentivesRequest.programIdSpecified = true;
       }
       if (incentiveType.HasValue)
       {
     SearchExclusiveIncentivesRequest.incentiveType = incentiveType.Value;
     SearchExclusiveIncentivesRequest.incentiveTypeSpecified = true;
       }
       if (!string.IsNullOrEmpty(region))
     SearchExclusiveIncentivesRequest.region = region;
       SearchExclusiveIncentivesRequest.page = page;
       SearchExclusiveIncentivesRequest.pageSpecified = true;
       SearchExclusiveIncentivesRequest.items = items;
       SearchExclusiveIncentivesRequest.itemsSpecified = true;
       SearchExclusiveIncentivesResponse incentivesResponse = this.publisherService.SearchExclusiveIncentives(SearchExclusiveIncentivesRequest);
       if (incentivesResponse == null)
       {
     total = 0;
     return (IList<incentiveItem>) null;
       }
       else if (incentivesResponse.incentiveItems == null)
       {
     total = 0;
     return (IList<incentiveItem>) null;
       }
       else
       {
     total = (int) incentivesResponse.total;
     return (IList<incentiveItem>) Enumerable.ToList<incentiveItem>((IEnumerable<incentiveItem>) incentivesResponse.incentiveItems);
       }
 }
Example #2
0
 public IList<incentiveItem> SearchIncentives(sessionType session, string region, incentiveTypeEnum? incentiveType, int? programId, int? adspaceId, int page, int items, out int total)
 {
     SearchIncentivesRequest SearchIncentivesRequest = new SearchIncentivesRequest();
       SearchIncentivesRequest.connectId = session.connectId;
       if (adspaceId.HasValue)
       {
     SearchIncentivesRequest.adspaceId = adspaceId.Value;
     SearchIncentivesRequest.adspaceIdSpecified = true;
       }
       if (programId.HasValue)
       {
     SearchIncentivesRequest.programId = programId.Value;
     SearchIncentivesRequest.programIdSpecified = true;
       }
       if (incentiveType.HasValue)
       {
     SearchIncentivesRequest.incentiveType = incentiveType.Value;
     SearchIncentivesRequest.incentiveTypeSpecified = true;
       }
       if (!string.IsNullOrEmpty(region))
     SearchIncentivesRequest.region = region;
       SearchIncentivesRequest.page = page;
       SearchIncentivesRequest.pageSpecified = true;
       SearchIncentivesRequest.items = items;
       SearchIncentivesRequest.itemsSpecified = true;
       SearchIncentivesResponse incentivesResponse = this.publisherService.SearchIncentives(SearchIncentivesRequest);
       if (incentivesResponse == null)
       {
     total = 0;
     return (IList<incentiveItem>) null;
       }
       else if (incentivesResponse.incentiveItems == null)
       {
     total = 0;
     return (IList<incentiveItem>) null;
       }
       else
       {
     total = (int) incentivesResponse.total;
     return (IList<incentiveItem>) Enumerable.ToList<incentiveItem>((IEnumerable<incentiveItem>) incentivesResponse.incentiveItems);
       }
 }