Beispiel #1
0
        public void logTime()
        {
            // run only if write to local file succeeds
            if (LocalLogger.writeToLogFile())
            {
                if (m_foundGoogleSheetAndTab == false)
                {
                    return;
                }

                PrefsData.PrefLogIndex index = m_userPrefs.getActiveSheet();

                if (TCOSheetsInterface.getIsServiceActive() == false)
                {
                    Console.WriteLine("Google Sheets service inactive.");
                }

                if (!TCOSheetsInterface.WriteTimeNowToCell(
                        m_userPrefs.getLogGoogleId(index),
                        m_userPrefs.getProjectName(index),
                        m_timeStr, m_userPrefs.getProjectDescription(index)))
                {
                    Console.WriteLine("Attempt to log to google sheets failed.");
                    return;
                }

                m_timeConfirmed     += m_timePending;
                m_timePending        = 0;
                m_logTimeAccumulator = 0;
                Console.WriteLine("Total time logged is " + m_timeStr);
            }
            else
            {
                Console.WriteLine("Log failed");
            }
        }