Exemple #1
0
        public IEnumerable <SalesArticle> Search(string searchTerm)
        {
            var uri      = new Uri($"{this.rootUri}/linnapps-api/sales-articles/search?searchTerm={searchTerm}", UriKind.RelativeOrAbsolute);
            var response = this.restClient.Get(
                CancellationToken.None,
                uri,
                new Dictionary <string, string>(),
                DefaultHeaders.JsonGetHeaders()).Result;

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new ProxyException($"Error trying to execute search");
            }

            var json = new JsonSerializer();

            return(json.Deserialize <IEnumerable <SalesArticle> >(response.Value));
        }
Exemple #2
0
        public IEnumerable <StockPool> GetStockPools()
        {
            var uri      = new Uri($"{this.rootUri}/linnapps-api/stock-pools", UriKind.RelativeOrAbsolute);
            var response = this.restClient.Get(
                CancellationToken.None,
                uri,
                new Dictionary <string, string>(),
                DefaultHeaders.JsonGetHeaders()).Result;

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new ProxyException($"Error trying to get stock pools");
            }

            var json = new JsonSerializer();

            return(json.Deserialize <IEnumerable <StockPool> >(response.Value));
        }