Ejemplo n.º 1
0
 public static void Insert(Object _Obj)
 {
     using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         conn.RunInTransaction(() =>
         {
             conn.Insert(_Obj);
         });
     }
 }
Ejemplo n.º 2
0
        public static void UpdateObject(Object _obj)
        {
            SQLiteConnection db;

            using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                });
            }
        }
Ejemplo n.º 3
0
 public static async Task InsertAsync(Object _Obj)
 {
     await Task.Run(() =>
     {
         using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
         {
             conn.RunInTransaction(() =>
             {
                 conn.Insert(_Obj);
             });
         }
     });
 }
Ejemplo n.º 4
0
 public void AddMobile(string macAddress, string name, DateTime lastConnectionDate, string lastState)
 {
     Debug.WriteLine("Add Mobile to DB : " + macAddress + " " + name + " " + lastConnectionDate.ToString() + " " + lastState);
     try
     {
         var s = new Mobile {
             MACAddress = macAddress, Name = name, LastConnectionDate = lastConnectionDate, LastState = lastState
         };
         using (SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), this.DB_PATH))
         {
             conn.RunInTransaction(() =>
             {
                 conn.Insert(s);
             });
         }
         //conn.DeleteAll<Message> ();
     }
     catch
     {
         Debug.WriteLine("ERROR : Unable to add Message");
     }
 }