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))");
         });
 }
        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))");
            });
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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 });
                });
        }
Ejemplo n.º 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 });
            });
        }