Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="journalNumber"></param>
        /// <param name="voucherNumber"></param>
        public void DeleteVouchers(int journalNumber, int voucherNumber)
        {
            string url = _client.GetUrl("/journals-experimental/{0}/entries/{1}", journalNumber, voucherNumber);

            try
            {
                var response = JsonClient.Delete(url, _client.GetHeaders());
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Delete a draft invoice based in draft invoice number.
        /// </summary>
        /// <param name="invoiceNumber">Draft invoice number.</param>
        /// <returns>True when deleted successfully.</returns>
        public bool DeleteDraft(int invoiceNumber)
        {
            string url = _client.GetUrl("/invoices/drafts/" + invoiceNumber);

            try
            {
                var response = JsonClient.Delete(url, _client.GetHeaders());
                return(response);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="customer"></param>
        /// <returns></returns>
        public bool Delete(Customer customer)
        {
            string url = _client.GetUrl("/customers/" + customer.customerNumber);

            try
            {
                var response = JsonClient.Delete(url, _client.GetHeaders());
                return(response);
            }
            catch (JsonClientException e)
            {
                if (e.StatusCode == System.Net.HttpStatusCode.NotFound)
                {
                    return(false);
                }

                throw _client.CreateException(e);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public virtual bool Delete(T obj, int id)
        {
            string url = _client.GetUrl(this.BaseUrl + "/" + id);

            try
            {
                var response = JsonClient.Delete(url, _client.GetHeaders());
                return(response);
            }
            catch (JsonClientException e)
            {
                if (e.StatusCode == System.Net.HttpStatusCode.NotFound)
                {
                    throw e;
                }

                throw e;
            }
            catch (Exception e)
            {
                throw e;
            }
        }