Exemplo n.º 1
0
        /// <summary>
        /// Gets the deatails of thr specified estimate.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="parameters">The parameters is the dictionary object which contains the parameters in the key,value pairs.<br></br>The possible parameters are listed below<br></br>
        /// <table>
        /// <tr><td>print</td><td>Print the exported pdf.</td></tr>
        /// <tr><td>accept</td><td>Get the details of a particular estimate in formats such as json/ pdf/ html. Default format is json.<br></br>Allowed Values: <i>json, pdf</i> and <i>html</i></td></tr>
        /// </table>
        /// </param>
        /// <returns>Estimate object.</returns>
        public Estimate Get(string estimate_id, Dictionary <object, object> parameters)
        {
            string url      = baseAddress + "/" + estimate_id;
            var    responce = ZohoHttpClient.get(url, getQueryParameters(parameters));

            return(EstimateParser.getEstimate(responce));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create an estimate for your customer.
        /// </summary>
        /// <param name="new_estimate_info">The new_estimate_info is the Estimate object with contact_id and item_name are mandatory attributes.</param>
        /// <param name="parameters">The parameters is the dictionary object which contains the parameters in the key,value pairs.<br></br>The parameters are listed below<br></br>
        /// <table>
        /// <tr><td>send</td><td>Send the estimate to the contact person(s) associated with the estimate.<br></br>Allowed Values: <i>true</i> and <i>false</i></td></tr>
        /// <tr><td>ignore_auto_number_generation</td><td>Ignore auto estimate number generation for this estimate. This mandates the estimate number.<br></br>Allowed Values: <i>true</i> and <i>false</i></td></tr>
        /// </table>
        /// </param>
        /// <returns>Estimate object.</returns>
        public Estimate Create(Estimate new_estimate_info, Dictionary <object, object> parameters)
        {
            string url  = baseAddress;
            var    json = JsonConvert.SerializeObject(new_estimate_info);

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

            return(EstimateParser.getEstimate(responce));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update an existing estimate. To delete a line item just remove it from the line_items list.
        /// </summary>
        /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param>
        /// <param name="update_info">The update_info is the Estimate object which contains the update details.</param>
        /// <param name="parameters">The parameters is the Dictionary object.<br></br>The possible parameters are <br></br>
        /// <table><tr><td>ignore_auto_number_generation</td><td>Ignore auto estimate number generation for this estimate. This mandates the estimate number.<br></br>Allowed Values: <i>true</i> and <i>false</i></td></tr></table>
        /// </param>
        /// <returns>Estimate object.</returns>
        public Estimate Update(string estimate_id, Estimate update_info, Dictionary <object, object> parameters)
        {
            string url  = baseAddress + "/" + estimate_id;
            var    json = JsonConvert.SerializeObject(update_info);

            parameters.Add("JSONString", json);
            var    responce        = ZohoHttpClient.put(url, getQueryParameters(parameters));
            string responceContent = responce.Content.ReadAsStringAsync().Result;

            return(EstimateParser.getEstimate(responce));
        }