private async void btnGetOrderByGuid_Click(object sender, EventArgs e)
        {
            var orderGuid = txtOrderGuid.Text;
            var orderResource = new OrderResource(_apiContext);
            var order = await orderResource.GetOrderAsync(orderGuid);

            if (order != null && order.Items.Count > 0)
                dataGridViewOrders.DataSource = order.Items;
        }
示例#2
0
        private void btnGetOrders_Click(object sender, EventArgs e)
        {
            btnGetOrders.Text = "Getting Orders...";
            var orderResource = new OrderResource(_apiContext);
            OrderCollection orders = orderResource.GetOrders();

            if (orders != null && orders.Items.Count > 0)
                dataGridViewOrders.DataSource = orders.Items;
            btnGetOrders.Text = "Refresh Orders";
        }
        protected override async Task<bool> GetDataAsync()
        {
            var resource = new OrderResource(Context);
            _results = await resource.GetOrdersAsync(startIndex: StartIndex, pageSize:PageSize, sortBy:SortBy, filter:Filter, q:Q, qLimit:QLimit, responseFields:ResponseFields);

            TotalCount = _results.TotalCount;
            PageCount = _results.PageCount;
            PageSize = _results.PageSize;
            return _results.Items != null && _results.Items.Count > 0;
        }
 private Order GetOrderById(MozuContext mozuContext, string id)
 {
     if (!_orders.ContainsKey(id))
     {
         OrderResource resource = new OrderResource(mozuContext.GetApiContext());
         Order o = resource.GetOrder(id);
         _orders[id] = o;
     }
     return _orders[id];
 }