public IAsyncResult BeginGetSales(GetSalesRequest GetSalesRequest, AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetSales", new object[1]
       {
     (object) GetSalesRequest
       }, callback, asyncState);
 }
Example #2
0
 public IList<saleItem> GetSales(sessionType session, DateTime date, dateTypeEnum dateType, int? adSpaceId, int? programId, reviewStateEnum? reviewState, int items, int page, out int total)
 {
     GetSalesRequest GetSalesRequest = new GetSalesRequest();
       DateTime utcNow = DateTime.UtcNow;
       GetSalesRequest.nonce = Signature.GetNonce();
       GetSalesRequest.connectId = session.connectId;
       GetSalesRequest.signature = Signature.SoapSignature(utcNow, session.secretKey, "publisherservice", "getsales", GetSalesRequest.nonce);
       GetSalesRequest.timestamp = Signature.GetZDateTime(utcNow);
       if (adSpaceId.HasValue)
       {
     GetSalesRequest.adspaceId = adSpaceId.Value;
     GetSalesRequest.adspaceIdSpecified = true;
       }
       if (programId.HasValue)
       {
     GetSalesRequest.programId = programId.Value;
     GetSalesRequest.programIdSpecified = true;
       }
       if (reviewState.HasValue)
       {
     GetSalesRequest.reviewState = reviewState.Value;
     GetSalesRequest.reviewStateSpecified = true;
       }
       GetSalesRequest.date = date;
       GetSalesRequest.dateType = dateType;
       GetSalesRequest.items = items;
       GetSalesRequest.itemsSpecified = true;
       GetSalesRequest.page = page;
       GetSalesRequest.pageSpecified = true;
       GetSalesResponse sales = this.publisherService.GetSales(GetSalesRequest);
       if (sales == null)
       {
     total = 0;
     return (IList<saleItem>) null;
       }
       else if (sales.saleItems == null)
       {
     total = 0;
     return (IList<saleItem>) null;
       }
       else
       {
     total = (int) sales.total;
     return (IList<saleItem>) Enumerable.ToList<saleItem>((IEnumerable<saleItem>) sales.saleItems);
       }
 }