예제 #1
0
 public static void Update(string id, string columnId, string newValue, SQLiteDatabase db)
 {
     try
     {
         Dictionary<string, string> data = new Dictionary<string, string>();
         data.Add(columnId, newValue);
         bool succ = db.Update("Books", data, String.Format("id={0}", id));
         if (!succ)
         {
             throw new Exception();
         }
     }
     catch
     {
         throw new FSSQLiteException("An unexpected error occured when trying to update a book.");
     }
 }
예제 #2
0
 public static void Update(string id, Book newData, SQLiteDatabase db)
 {
     try
     {
         Dictionary<string, string> data = BookToFieldsDictionary(newData);
         bool succ = db.Update("Books", data, String.Format("id={0}", id));
         if (!succ)
         {
             throw new Exception();
         }
     }
     catch
     {
         throw new FSSQLiteException("An unexpected error occured when trying to update a book.");
     }
 }