コード例 #1
0
ファイル: Procedures.cs プロジェクト: viktorchernev/ATLists
 public static int Insert(SqlEntryStorage o)
 {
     LAST_EXCEPTION = null;
     try
     {
         using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DATABASE_PATH))
         {
             conn.Insert(o);
         }
         EntryStorages.Add(o.Id, o);
         return(o.Id);
     }
     catch (Exception ex)
     {
         LAST_EXCEPTION = ex.Message;
         return(-1);
     }
 }
コード例 #2
0
ファイル: Procedures.cs プロジェクト: viktorchernev/ATLists
 public static bool Update(SqlEntryStorage 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);
     }
 }