0

我正在使用 ebay .Net SDK。除以下要求外,一切正常:

  1. 使用OutputSelector来提高性能
  2. 在显示记录时无法使用SortingOrder
  3. 指定时间范围内的总收入/销售金额,即所有分页调用的总金额,无需遍历页面并手动聚合。

这是我正在使用的代码:

var apicall = new GetOrdersCall(context);
//apicall.ApiRequest.OutputSelector = new StringCollection(new String[] { "Order.OrderID", "Order.Total" });
apicall.ApiRequest.Pagination = new PaginationType
{
    EntriesPerPage = Util.RecordsPerPage(),
    PageNumber = int.Parse(Request.Form["pageNumber"])
};
var fltr = new TimeFilter(Convert.ToDateTime(Request.Form["dateFrom"] + "T00:00:00.000Z"), Convert.ToDateTime(Request.Form["dateTo"] + "T23:59:59.999Z"));
var statusCodeType = (OrderStatusCodeType)Enum.Parse(typeof(OrderStatusCodeType), Request.Form["statusCode"]);
var orders = apicall.GetOrders(fltr, TradingRoleCodeType.Seller, statusCodeType);

请帮助我如何使用这三个功能。

4

1 回答 1

0

经过很多努力,我得到了它的方式:

var request = new GetOrdersRequestType
{
    //OutputSelector = new StringCollection {"OrderID","Total"},
    CreateTimeFrom = Convert.ToDateTime(Request.Form["dateFrom"] + "T00:00:00.000Z"),
    CreateTimeTo = Convert.ToDateTime(Request.Form["dateTo"] + "T23:59:59.999Z"),
    OrderStatus = (OrderStatusCodeType)Enum.Parse(typeof(OrderStatusCodeType), Request.Form["statusCode"]),
    OrderRole = TradingRoleCodeType.Seller,
    Pagination = new PaginationType
        {
            EntriesPerPage = Util.RecordsPerPage(),
            PageNumber = int.Parse(Request.Form["pageNumber"])
        }
};

var apicall = new GetOrdersCall(context)
    {
        ApiRequest = request,
        OutputSelector =
            new string[]
                {
                    "OrderID", "Total", "PaidTime", "eBayPaymentStatus",
                    "PaymentMethod", "Title", "PageNumber", "PaginationResult.TotalNumberOfPages"
                }
    };

apicall.Execute();
var orders = apicall.ApiResponse.OrderArray;
于 2013-09-04T10:51:40.410 回答