/// <summary>
        ///     Deletes an attachment.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <returns>System.String.</returns>
        public string DeleteAnAttachment(string purchaseorder_id)
        {
            var url      = baseAddress + "/" + purchaseorder_id + "/attachment";
            var response = ZohoHttpClient.delete(url, getQueryParameters());

            return(PurchaseorderParser.getMessage(response));
        }
        /// <summary>
        ///     Updates the attachment preference.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>System.String.</returns>
        public string UpdateAttachmentPreference(string purchaseorder_id, Dictionary <object, object> parameters)
        {
            var url      = baseAddress + "/" + purchaseorder_id + "/attachment";
            var response = ZohoHttpClient.put(url, getQueryParameters(parameters));

            return(PurchaseorderParser.getMessage(response));
        }
        /// <summary>
        ///     Updates the template.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="template_id">The template_id.</param>
        /// <returns>System.String.</returns>
        public string UpdateTemplate(string purchaseorder_id, string template_id)
        {
            var url      = baseAddress + "/" + purchaseorder_id + "/templates/" + template_id;
            var response = ZohoHttpClient.put(url, getQueryParameters());

            return(PurchaseorderParser.getMessage(response));
        }
        /// <summary>
        ///     Cancels the purchaseorder.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <returns>System.String.</returns>
        public string CancelPurchaseorder(string purchaseorder_id)
        {
            var url      = baseAddress + "/" + purchaseorder_id + "/status/cancelled";
            var response = ZohoHttpClient.post(url, getQueryParameters());

            return(PurchaseorderParser.getMessage(response));
        }
        /// <summary>
        ///     Deletes the comment.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="comment_id">The comment_id.</param>
        /// <returns>System.String.</returns>
        public string DeleteComment(string purchaseorder_id, string comment_id)
        {
            var url      = baseAddress + "/" + purchaseorder_id + "/comments/" + comment_id;
            var response = ZohoHttpClient.delete(url, getQueryParameters());

            Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            return(PurchaseorderParser.getMessage(response));
        }
        /// <summary>
        ///     Adds the attachment.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="attachment_Path">The attachment_ path.</param>
        /// <returns>System.String.</returns>
        public string AddAttachment(string purchaseorder_id, string attachment_Path)
        {
            var url        = baseAddress + "/" + purchaseorder_id + "/attachment";
            var attachment = new[] { attachment_Path };
            var file       = new KeyValuePair <string, string[]>("attachment", attachment);
            var responce   = ZohoHttpClient.post(url, getQueryParameters(), null, file);

            return(PurchaseorderParser.getMessage(responce));
        }
예제 #7
0
        /// <summary>
        /// Sends the email.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="email_details">The email_details.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>System.String.</returns>
        public string SendEmail(string purchaseorder_id, EmailNotification email_details, Dictionary <object, object> parameters)
        {
            var url  = baseAddress + "/" + purchaseorder_id + "/email";
            var json = JsonConvert.SerializeObject(email_details);

            if (parameters == null)
            {
                parameters = new Dictionary <object, object>();
            }
            parameters.Add("JSONString", json);
            var response = ZohoHttpClient.post(url, getQueryParameters(parameters));

            return(PurchaseorderParser.getMessage(response));
        }