예제 #1
0
 public static bool UpdateWhiteListValue(Extension e)
 {
     try
     {
         var SqlConnection = new SQLiteConnection("Data Source=" + DBLocation + "; Version=3");
         SqlConnection.Open();
         var sql = "UPDATE WhiteList SET Active = " + Convert.ToInt32(e.IsChecked) + " WHERE ID = " + e.ID;
         SQLiteCommand cmd = new SQLiteCommand(sql, SqlConnection);
         cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         return false;
     }
     return true;
 }
예제 #2
0
 public static bool TrimFilesTable(Extension toDelete)
 {
     var SqlConnection = new SQLiteConnection("Data Source=" + DBLocation + "; Version=3");
     SqlConnection.Open();
     var sql = "Delete FROM FilesFound WHERE ExtensionID LIKE '%" + toDelete.ID + "'";
     var cmd = new SQLiteCommand(sql, SqlConnection);
     cmd.ExecuteNonQuery();
     SqlConnection.Close();
     return true;
 }