Ejemplo n.º 1
0
        /// <summary>
        /// Gets the details of specified journal.
        /// </summary>
        /// <param name="journal_id">The journal_id is the identifier of the journal.</param>
        /// <returns>Journal object.</returns>
        public Journal Get(string journal_id)
        {
            string url      = baseAddress + "/" + journal_id;
            var    responce = ZohoHttpClient.get(url, getQueryParameters());

            return(JournalParser.getJournal(responce));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the journal with given information.
        /// </summary>
        /// <param name="journal_id">The journal_id is the identifier of the journal.</param>
        /// <param name="update_info">The update_info is the Journal object which contains the updation information of specifed journal.</param>
        /// <returns>Journal object.</returns>
        public Journal Update(string journal_id, Journal update_info)
        {
            string url        = baseAddress + "/" + journal_id;
            var    json       = JsonConvert.SerializeObject(update_info);
            var    jsonstring = new Dictionary <object, object>();

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

            return(JournalParser.getJournal(responce));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Creates a journal.
        /// </summary>
        /// <param name="new_journal_info">
        ///     The new_journal_info is the Journal object with journal_date,amount,debit_or_credit as
        ///     mandatory attributes.
        /// </param>
        /// <returns>Journal object.</returns>
        public Journal Create(Journal new_journal_info)
        {
            var url        = baseAddress;
            var json       = JsonConvert.SerializeObject(new_journal_info);
            var jsonstring = new Dictionary <object, object>();

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

            return(JournalParser.getJournal(responce));
        }