示例#1
0
        public async Task <OrderList> GetCustomerOrders(int id, Dictionary <string, string> parms = null)
        {
            string json = await API.GetRestful("customers/" + id.ToString() + "/orders", parms).ConfigureAwait(false);

            json = json.Substring(json.IndexOf(':') + 1, json.Length - json.IndexOf(':') - 2);
            return(API.DeserializeJSon <OrderList>(json));
        }
示例#2
0
        public async Task <int> GetProductCount()
        {
            int     _count   = 0;
            RestAPI _RestAPI = _Woo.GetRootRestAPI;

            try
            {
                string Result = await _RestAPI.GetRestful("products/count");

                if (Result.Contains("count"))
                {
                    int _from = Result.IndexOf(":");
                    int _to   = Result.IndexOf("}");
                    _count = Convert.ToInt32(Result.Substring(_from + 1, _to - _from - 1));
                }
            }
            catch (Exception ex)
            {
                if (_Woo.Logger != null)
                {
                    _Woo.Logger.LogError("Error calling WOO REST ROOT API: " + ex.Message);
                }
            }
            return(_count);
        }
示例#3
0
        public async Task <List <T3> > GetCustomerOrders(int id, Dictionary <string, string> parms = null)
        {
            string json = await API.GetRestful("customers/" + id.ToString() + "/orders", parms);

            return(API.DeserializeJSon <List <T3> >(json));
        }
示例#4
0
        public async Task <Store> GetStoreInfo()
        {
            string json = await API.GetRestful(string.Empty).ConfigureAwait(false);

            return((await Task.Factory.StartNew(() => JsonConvert.DeserializeObject <StoreData>(json))).store);
        }
示例#5
0
        public async Task <Store> GetStoreInfo()
        {
            string json = await API.GetRestful(string.Empty).ConfigureAwait(false);

            json = json.Substring(json.IndexOf(':') + 1, json.Length - json.IndexOf(':') - 2);
            return(await Task.Factory.StartNew(() => JsonConvert.DeserializeObject <Store>(json)));
        }