Exemplo n.º 1
0
        /// <summary>
        /// Deletes the bill comment.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill.</param>
        /// <param name="comment_id">The comment_id is the identifier of the comment of the specified bill.</param>
        /// <returns>System.String.<br></br>The success message is "The comment has been deleted."</returns>
        public string DeleteComment(string bill_id, string comment_id)
        {
            string url      = baseAddress + "/" + bill_id + "/comments/" + comment_id;
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deletes the file attached to a bill.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill.</param>
        /// <returns>System.String.<br></br>The success message is "The attachment has been deleted."</returns>
        public string DeleteAttachment(string bill_id)
        {
            string url      = baseAddress + "/" + bill_id + "/attachment";
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Mark a void bill as open.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the void bill.</param>
        /// <returns>System.String.<br></br>The success message is "The status of the bill has been changed from void to open."</returns>
        public string MarkBillAsOpen(string bill_id)
        {
            string url      = baseAddress + "/" + bill_id + "/status/open";
            var    responce = ZohoHttpClient.post(url, getQueryParameters());

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Marks the bill status as void.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill for which the status has to be changed.</param>
        /// <returns>System.String.<br></br>The success message is "The bill has been marked as void."</returns>
        public string VoidABill(string bill_id)
        {
            var url      = baseAddress + "/" + bill_id + "/status/void";
            var responce = ZohoHttpClient.post(url, getQueryParameters());

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Attach a file to a bill.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill for which the file is going to be attached.</param>
        /// <param name="attachment_path">The attachment_path is the file information.</param>
        /// <returns>System.String.<br></br>The success message is "The document has been attached."</returns>
        public string AddAttachment(string bill_id, string attachment_path)
        {
            string url        = baseAddress + "/" + bill_id + "/attachment";
            var    attachment = new string[] { attachment_path };
            var    file       = new KeyValuePair <string, string[]>("attachment", attachment);
            var    responce   = ZohoHttpClient.post(url, getQueryParameters(), null, file);

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Adds the comment to a bill.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill.</param>
        /// <param name="new_comment_info">The new_comment_info is the Comment object which is having the comment information.</param>
        /// <returns>System.String.<br></br>The success message is "Comments added." </returns>
        public string AddComment(string bill_id, Comment new_comment_info)
        {
            string url        = baseAddress + "/" + bill_id + "/comments";
            var    json       = JsonConvert.SerializeObject(new_comment_info);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Updates the billing address for this bill.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill .</param>
        /// <param name="update_info">The update_info is the Address object which contains the information to be update.</param>
        /// <returns>System.String.<br></br>The success message is "Billing address updated."</returns>
        public string UpdateBillingAddress(string bill_id, Address update_info)
        {
            string url        = baseAddress + "/" + bill_id + "/address/billing";
            var    json       = JsonConvert.SerializeObject(update_info);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.put(url, getQueryParameters(jsonstring));

            return(BillParser.getMessage(responce));
        }
Exemplo n.º 8
0
        /// <summary>
        ///     Apply the vendor credits from excess vendor payments to a bill. Multiple credits can be applied at once.
        /// </summary>
        /// <param name="bill_id">The bill_id is the identifier of the bill for which the credits are going to be applied.</param>
        /// <param name="credits_info">
        ///     The credits_info is the UseCredits object which is having the credits info with
        ///     amount_applied as mandatory parameter.
        /// </param>
        /// <returns>System.String.<br></br>The success message is "Credits have been applied to the bill(s)."</returns>
        public string ApplyCredits(string bill_id, UseCredits credits_info)
        {
            var url        = baseAddress + "/" + bill_id + "/credits";
            var json       = JsonConvert.SerializeObject(credits_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            return(BillParser.getMessage(responce));
        }