public void AddActivity(Activity activity)
        {
            DateTime timestamp = activity.Timestamp.ToUniversalTime();

            lock (this.writeLock)
            {
                SQLiteConnection conn = CreateConnection(this.mFilepath, false);

                try
                {
                    conn.Open();

                    SQLiteCommand cmd = new SQLiteCommand(cInsertActivityQry, conn);

                    cmd.Parameters.Add(new SQLiteParameter("@timestamp", timestamp.Ticks));
                    cmd.Parameters.Add(new SQLiteParameter("@description", activity.Description));

                    cmd.ExecuteNonQuery();
                }
                finally
                {
                    conn.Close();
                }
            }
        }
        public ActivityCollection GetActivities(int year, int month, int day)
        {
            // cSelectDayActivity
            ActivityCollection result = new ActivityCollection();

            // We get input in local time, but we need to query in UTC time ...
            DateTime universalBeginDate = new DateTime(year, month, day).ToUniversalTime();
            DateTime universalEndDate = new DateTime(year, month, day, 23, 59, 59).ToUniversalTime();

            // Do we want a read/write locking mechanism? Now we just lock ...
            lock (this.writeLock)
            {
                SQLiteConnection conn = CreateConnection(this.mFilepath, true);

                try
                {
                    conn.Open();

                    SQLiteCommand cmd = new SQLiteCommand(cSelectDayActivity, conn);

                    cmd.Parameters.Add(new SQLiteParameter("@beginTime", universalBeginDate.Ticks));
                    cmd.Parameters.Add(new SQLiteParameter("@endTime", universalEndDate.Ticks));

                    using (SQLiteDataReader dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            long ticks = long.Parse(dr["timestamp"].ToString());
                            DateTime timestamp = new DateTime(ticks);
                            Activity act = new Activity(dr["description"].ToString(), timestamp.ToLocalTime());
                            result.Add(act);
                        }
                    }
                }
                finally
                {
                    conn.Close();
                }
            }

            return result;
        }