public void GetSellingManagerSoldListings() { GetSellingManagerSoldListingsCall api = new GetSellingManagerSoldListingsCall(apiContext); PaginationType pagination = new PaginationType(); pagination.EntriesPerPage = 5; pagination.PageNumber = 0; api.Pagination = pagination; api.Execute(); //check whether the call is success. Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!"); Assert.IsNotNull(api.SaleRecordList); Assert.IsTrue(api.SaleRecordList[0].SellingManagerSoldTransaction.Count > 0); TestData.SoldItemId = api.SaleRecordList[0].SellingManagerSoldTransaction[0].ItemID; }
public static void GetSellingManagerSaleRecord(ApiContext apiContext, string p) { Stopwatch s = Stopwatch.StartNew(); GetSellingManagerSoldListingsCall apiCall = new GetSellingManagerSoldListingsCall(apiContext); Blink(); apiCall.DetailLevelList = new DetailLevelCodeTypeCollection(new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll }); apiCall.Pagination = new PaginationType() { EntriesPerPage = 100, PageNumber = 1 }; apiContext.ApiLogManager.RecordMessage(String.Format("Getting Selling Manager Sale Record - START, page {0}", 1)); apiCall.ApiRequest.OutputSelector = new StringCollection(new string[] { "PaginationResult", "OrderID", "OrderLineItemID", "SellingManagerSalesRecordNumber", "Item.ItemID", "TransactionID", "TransactionArray.Transaction.QuantityPurchased" }); int Page = 1; do { SellingManagerSoldOrderTypeCollection items = apiCall.GetSellingManagerSoldListings( new SellingManagerSearchType() { SearchType = SellingManagerSearchTypeCodeType.SaleRecordID, SearchValue = p }, 0, null, false, SellingManagerSoldListingsSortTypeCodeType.SalesRecordID, SortOrderCodeType.Ascending, new PaginationType() { EntriesPerPage = 100, PageNumber = 1 }, null); apiContext.ApiLogManager.RecordMessage(String.Format("Getting item list - SUCCESS, page {0}", Page)); Blink(); foreach (SellingManagerSoldOrderType i in items) { apiContext.ApiLogManager.RecordMessage(String.Format("TransactionID {0}", i.SaleRecordID)); } Blink(); Page++; }while (Page <= apiCall.PaginationResult.TotalNumberOfPages); apiContext.ApiLogManager.RecordMessage("Getting Transactions - SUCCESS"); eBayClass.Metrics.GenerateReport(eBayClass.LogManager.ApiLoggerList[0]); eBayClass.LogManager.RecordMessage("Done; ms: " + s.ElapsedMilliseconds.ToString()); Blink(); }