예제 #1
0
        /// <summary>
        ///     Stop tracking time, say taking a break or leaving.
        /// </summary>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry StopTimer()
        {
            var url      = baseAddress + "/timeentries/timer/stop";
            var responce = ZohoHttpClient.post(url, getQueryParameters());

            return(ProjectParser.getTimeEntry(responce));
        }
예제 #2
0
        /// <summary>
        ///     Start tracking time spent.
        /// </summary>
        /// <param name="time_entry_id">The time_entry_id is the identifier of the time entry.</param>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry StartTimer(string time_entry_id)
        {
            var url      = baseAddress + "/timeentries/" + time_entry_id + "/timer/start";
            var responce = ZohoHttpClient.post(url, getQueryParameters());

            return(ProjectParser.getTimeEntry(responce));
        }
예제 #3
0
        /// <summary>
        ///     Get current running timer.
        /// </summary>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry GetTimer()
        {
            var url      = baseAddress + "/timeentries/runningtimer/me";
            var responce = ZohoHttpClient.get(url, getQueryParameters());

            return(ProjectParser.getTimeEntry(responce));
        }
예제 #4
0
        /// <summary>
        /// Get details of a time entry.
        /// </summary>
        /// <param name="time_entry_id">The time_entry_id is the identifier of the time entry.</param>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry GetATimeEntry(string time_entry_id)
        {
            string url      = baseAddress + "/timeentries/" + time_entry_id;
            var    responce = ZohoHttpClient.get(url, getQueryParameters());

            return(ProjectParser.getTimeEntry(responce));
        }
예제 #5
0
        /// <summary>
        ///     Updates the logged time entry.
        /// </summary>
        /// <param name="time_entry_id">The time_entry_id is the identifier of the time entry.</param>
        /// <param name="update_info">The update_info is the TimeEntry object which is having the upadation information.</param>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry UpdateTimeEntry(string time_entry_id, TimeEntry update_info)
        {
            var url        = baseAddress + "/timeentries/" + time_entry_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(ProjectParser.getTimeEntry(responce));
        }
예제 #6
0
        /// <summary>
        /// Logs the time entries.
        /// </summary>
        /// <param name="time_entry_info">The time_entry_info is the TimeEntry object with project_id,task_id,user_id and log_date as mandatory attributes.</param>
        /// <returns>TimeEntry object.</returns>
        public TimeEntry LogTimeEntry(TimeEntry time_entry_info)
        {
            string url        = baseAddress + "/timeentries";
            var    json       = JsonConvert.SerializeObject(time_entry_info);
            var    jsonstring = new Dictionary <object, object>();

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

            return(ProjectParser.getTimeEntry(responce));
        }