/// <summary> /// Gets the specified bill details. /// </summary> /// <param name="bill_id">The bill_id is the identifier of the bill for which the details has to be get.</param> /// <returns>Bill object.</returns> public Bill Get(string bill_id) { var url = baseAddress + "/" + bill_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(BillParser.getBill(responce)); }
/// <summary> /// Updates the specified bill information. /// </summary> /// <param name="bill_id">The bill_id is the identifier of the bill on which the changes are going to be applied.</param> /// <param name="update_info">The update_info is the bill object which contains the vendor_id,account_id and bill_number as mandatory parameters..</param> /// <param name="attachment_path">The attachment_path is the reciept path for the bill.</param> /// <returns>Bill object.</returns> public Bill Update(string bill_id, Bill update_info, string attachment_path) { string url = baseAddress + "/" + bill_id; var json = JsonConvert.SerializeObject(update_info); var jsonstring = new Dictionary <object, object>(); jsonstring.Add("JSONString", json); var file = new KeyValuePair <string, string>("attachment", attachment_path); var responce = ZohoHttpClient.put(url, getQueryParameters(), jsonstring, file); return(BillParser.getBill(responce)); }
/// <summary> /// Creates the bill for the vendor specified information. /// </summary> /// <param name="new_bill_info">The new_bill_info is the bill object which contains the vendor_id,account_id and bill_number as mandatory parameters.</param> /// <param name="attachment_path">The attachment_path is the receipt file to the bill.</param> /// <returns>Bill object.</returns> public Bill Create(Bill new_bill_info, string attachment_path) { string url = baseAddress; var json = JsonConvert.SerializeObject(new_bill_info); var jsonstring = new Dictionary <object, object>(); jsonstring.Add("JSONString", json); var attachments = new string[] { attachment_path }; var file = new KeyValuePair <string, string[]>("attachment", attachments); var responce = ZohoHttpClient.post(url, getQueryParameters(), jsonstring, file); return(BillParser.getBill(responce)); }