コード例 #1
0
ファイル: ProductManager.cs プロジェクト: cloudfy/economicsdk
        /// <summary></summary>
        /// <param name="options"></param>
        /// <returns>EcnomicApi.Economic.Objects.CollectionOfProduct</returns>
        public CollectionOfProduct List(ViewOptions options = null)
        {
            string url = this.Client.GetUrl("/products/");

            if (options != null)
            {
                options.AppendTo(ref url);
            }

            try
            {
                var response = JsonClient.Get <CollectionOfProduct>(url, Client.GetHeaders());
                return(response);
            }
            catch
            {
                throw;
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        public CollectionOfInvoice ListBooked(ViewOptions options = null)
        {
            string url = _client.GetUrl("/invoices/booked?sort=-bookedInvoiceNumber");

            if (options != null)
            {
                options.AppendTo(ref url);
            }

            try
            {
                var response = JsonClient.Get <CollectionOfInvoice>(url, _client.GetHeaders());
                return(response);
            }
            catch (JsonClientException e)
            {
                var errorMessage = JsonConvert.DeserializeObject <ErrorMessage>(e.Message);
                throw new EconomicException(errorMessage, e);
            }
            catch (Exception e)
            {
                throw e;
            }
        }