Esempio n. 1
0
 public static Invoice RetrieveInvoice(int invoice)
 {
     Invoice invoice2 = new Invoice();
     invoice2.InvoiceFreshBooksId = invoice;
     return invoice2;
 }
Esempio n. 2
0
 public void UpdateInvoice(Invoice currentInvoice)
 {
     byte[] bytes = Encoding.UTF8.GetBytes(currentInvoice.GetInvoiceUpdateXml());
     WebRequest request = WebRequest.Create(this.accessUrl);
     request.Credentials = new NetworkCredential(this.authenticationToken, "X");
     request.Method = "POST";
     Stream requestStream = request.GetRequestStream();
     requestStream.Write(bytes, 0, bytes.Length);
     requestStream.Close();
     try
     {
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();
         this.actualResponse = this.ProcessResponse(response);
     }
     catch (Exception exception)
     {
         throw new ApplicationException(exception.Message);
     }
 }