Exemplo n.º 1
0
        // Insert the new macro in the Macros table.
        public static void InsertMacro(DBMacro macro)
        {
            CheckDatabase();

            using (SQLiteConnection conn = new SQLiteConnection(new SQLitePlatformGeneric(), DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                    conn.Insert(macro);
                });
            }
        }
Exemplo n.º 2
0
        //Update existing macro
        public static void UpdateDetails(DBMacro macro)
        {
            CheckDatabase();

            using (SQLiteConnection conn = new SQLiteConnection(new SQLitePlatformGeneric(), DB_PATH))
            {
                var existingconact = conn.Query <DBMacro>("select * from DBMacro where mc_ID =" + macro.mc_ID).FirstOrDefault();
                if (existingconact != null)
                {
                    conn.RunInTransaction(() =>
                    {
                        conn.Update(macro);
                    });
                }
            }
        }