/// <summary>
        ///     Gets the specified purchaseorder_id.
        /// </summary>
        /// <param name="purchaseorder_id">The purchaseorder_id.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>Purchaseorder.</returns>
        public Purchaseorder Get(string purchaseorder_id, Dictionary <object, object> parameters)
        {
            var url      = baseAddress + "/" + purchaseorder_id;
            var response = ZohoHttpClient.get(url, getQueryParameters(parameters));

            return(PurchaseorderParser.getPurchaseorder(response));
        }
Beispiel #2
0
        /// <summary>
        /// Updates the specified purchseorder_id.
        /// </summary>
        /// <param name="purchseorder_id">The purchseorder_id.</param>
        /// <param name="update_info">The update_info.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>Purchaseorder.</returns>
        public Purchaseorder Update(string purchseorder_id, Purchaseorder update_info, Dictionary <object, object> parameters, string attachment_path)
        {
            var url  = baseAddress + "/" + purchseorder_id;
            var json = JsonConvert.SerializeObject(update_info);

            if (parameters == null)
            {
                parameters = new Dictionary <object, object>();
            }
            parameters.Add("JSONString", json);
            var file     = new KeyValuePair <string, string>("attachment", attachment_path);
            var response = ZohoHttpClient.put(url, getQueryParameters(), parameters, file);

            return(PurchaseorderParser.getPurchaseorder(response));
        }
Beispiel #3
0
        /// <summary>
        /// Creates the specified new_purchaseorder_info.
        /// </summary>
        /// <param name="new_purchaseorder_info">The new_purchaseorder_info.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>Purchaseorder.</returns>
        public Purchaseorder Create(Purchaseorder new_purchaseorder_info, Dictionary <object, object> parameters, string attachment_Path)
        {
            var url  = baseAddress;
            var json = JsonConvert.SerializeObject(new_purchaseorder_info);

            if (parameters == null)
            {
                parameters = new Dictionary <object, object>();
            }
            parameters.Add("JSONString", json);
            var attachment = new string[] { attachment_Path };
            var file       = new KeyValuePair <string, string[]>("attachment", attachment);
            var response   = ZohoHttpClient.post(url, getQueryParameters(), parameters, file);

            return(PurchaseorderParser.getPurchaseorder(response));
        }