Example #1
0
        private static void StartTimer(Project project, string description = "")
        {
            var ct = tb.GetRunningTimer();

            if (ct != null && ct.pid == project.pid && ct.description == description)
            {
                clt($"A timer is already running for {project.name}.");
            }
            else
            {
                TimeEntryWrapper wrapper = new TimeEntryWrapper();
                wrapper.time_entry = new TimeEntry()
                {
                    description    = description
                    , wid          = int.Parse(ConfigurationManager.AppSettings["WorkspaceID"])
                    , pid          = project.pid
                    , created_with = ".net"
                };
                tb.StartTimer(wrapper);
                logTimerStart(project.name);
                clt($"Tracking started for {project.name}.");
            }
            aTimerIsRunning = true;
        }
Example #2
0
 public void StartTimer(TimeEntryWrapper wrapper)
 {
     var url = $"{baseUrl}/time_entries/start";
     var x   = WebCall.PostRequestWithErrorHandling(url, wrapper, this.apiKey);
 }