コード例 #1
0
 private static void EnsureDbReady()
 {
     SQLiteActionProvider sqlite = new SQLiteActionProvider();
     sqlite.DoDb(conn =>
         {
             conn.Execute(@"CREATE TABLE IF NOT EXISTS AppSetting (Id INTEGER, JiraLogin TEXT, JiraPassword TEXT, JiraUrl TEXT, TogglApiKey TEXT, PRIMARY KEY (Id))");
         });
 }
コード例 #2
0
        private static void EnsureDbReady()
        {
            SQLiteActionProvider sqlite = new SQLiteActionProvider();

            sqlite.DoDb(conn =>
            {
                conn.Execute(@"CREATE TABLE IF NOT EXISTS AppSetting (Id INTEGER, JiraLogin TEXT, JiraPassword TEXT, JiraUrl TEXT, TogglApiKey TEXT, PRIMARY KEY (Id))");
            });
        }
コード例 #3
0
        public AppSetting ReadSettings()
        {
            var sqlite = new SQLiteActionProvider();
            AppSetting result = null;

            sqlite.DoDb(conn =>
            {
                result = conn.Query<AppSetting>("select * from AppSetting").FirstOrDefault();
            });
            return result ?? new AppSetting();
        }
コード例 #4
0
        public AppSetting ReadSettings()
        {
            var        sqlite = new SQLiteActionProvider();
            AppSetting result = null;

            sqlite.DoDb(conn =>
            {
                result = conn.Query <AppSetting>("select * from AppSetting").FirstOrDefault();
            });
            return(result ?? new AppSetting());
        }
コード例 #5
0
        public void SaveSettings(AppSetting settings)
        {
            if (settings == null)
                return;

            var sqlite = new SQLiteActionProvider();
            sqlite.DoDb(conn =>
                {
                    conn.Execute("insert or replace into AppSetting (Id, JiraLogin, JiraPassword, JiraUrl, TogglApiKey) values(@Id, @jlogin, @jpwd, @jurl, @toggl)",
                        new { Id = 1, jlogin = settings.JiraLogin, jpwd = settings.JiraPassword, jurl = settings.JiraUrl, toggl = settings.TogglApiKey });
                });
        }
コード例 #6
0
        public void SaveSettings(AppSetting settings)
        {
            if (settings == null)
            {
                return;
            }

            var sqlite = new SQLiteActionProvider();

            sqlite.DoDb(conn =>
            {
                conn.Execute("insert or replace into AppSetting (Id, JiraLogin, JiraPassword, JiraUrl, TogglApiKey) values(@Id, @jlogin, @jpwd, @jurl, @toggl)",
                             new { Id = 1, jlogin = settings.JiraLogin, jpwd = settings.JiraPassword, jurl = settings.JiraUrl, toggl = settings.TogglApiKey });
            });
        }