예제 #1
0
        // Insert the new keycode in the Keycodes table.
        public static void InsertKeycode(DBKeyCode keycode)
        {
            CheckDatabase();

            using (SQLiteConnection conn = new SQLiteConnection(new SQLitePlatformGeneric(), DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                    conn.Insert(keycode);
                });
            }
        }
예제 #2
0
        //Update existing keycode
        public static void UpdateDetails(DBKeyCode keycode)
        {
            CheckDatabase();

            using (SQLiteConnection conn = new SQLiteConnection(new SQLitePlatformGeneric(), DB_PATH))
            {
                var existingKeycode = conn.Query <DBKeyCode>("select * from DBKeycode where kc_ID =" + keycode.kc_ID).FirstOrDefault();
                if (existingKeycode != null)
                {
                    conn.RunInTransaction(() =>
                    {
                        conn.Update(keycode);
                    });
                }
            }
        }