Ejemplo n.º 1
0
 public static int Insert(SqlColorable o)
 {
     LAST_EXCEPTION = null;
     try
     {
         using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DATABASE_PATH))
         {
             conn.Insert(o);
         }
         Colorables.Add(o.Id, o);
         return(o.Id);
     }
     catch (Exception ex)
     {
         LAST_EXCEPTION = ex.Message;
         return(-1);
     }
 }
Ejemplo n.º 2
0
 public static bool Update(SqlColorable o)
 {
     LAST_EXCEPTION = null;
     try
     {
         using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DATABASE_PATH))
         {
             conn.RunInTransaction(() =>
             {
                 conn.Update(o);
             });
         }
         return(true);
     }
     catch (Exception ex)
     {
         LAST_EXCEPTION = ex.Message;
         return(false);
     }
 }