public string DeleteSyncMap(SyncMap sm) { string outputMsg = "implementation in progress"; string time = ""; try { //we need to make sure our id dictionaries are refreshed RefreshIds(); using (var conn = new SQLiteConnection(@"Data Source=" + Configuration.GetSqliteDbPath(GetDbName()))) { conn.Open(); using (var cmd = new SQLiteCommand(conn)) { using (var transaction = conn.BeginTransaction()) { Stopwatch sw = Stopwatch.StartNew(); DeleteSyncMap(sm, cmd); transaction.Commit(); sw.Stop(); time = sw.Elapsed.ToString("mm\\:ss\\.ff"); } } conn.Close(); } outputMsg = "Delete Sync Map Finished: " + time; } catch (Exception ex) { outputMsg = "error: " + ex.Message; } return outputMsg; }
public override void DeleteSyncMap(SyncMap sm, SQLiteCommand cmd) { Dictionary<string, int> pathIds = new Dictionary<string, int>(); pathIds.Add(sm.Source, -1); pathIds.Add(sm.Destination, -1); RefreshPathIds(pathIds, cmd); cmd.Parameters.Clear(); cmd.CommandText = "DELETE FROM " + NwdContract.TABLE_SYNC_MAP + " " + "WHERE " + NwdContract.COLUMN_SYNC_PROFILE_ID + " = @profileId " + "AND " + NwdContract.COLUMN_PATH_ID_SOURCE + " = @srcId " + "AND " + NwdContract.COLUMN_PATH_ID_DESTINATION + " = @destId " + "AND " + NwdContract.COLUMN_SYNC_DIRECTION_ID + " = @directionId"; cmd.Parameters.AddWithValue("@profileId", GetNameId(sm.Profile.Name)); cmd.Parameters.AddWithValue("@srcId", pathIds[sm.Source]); cmd.Parameters.AddWithValue("@destId", pathIds[sm.Destination]); cmd.Parameters.AddWithValue("@directionId", GetDirectionId(sm.SyncDirection)); cmd.ExecuteNonQuery(); }
public abstract void DeleteSyncMap(SyncMap sm, SQLiteCommand cmd);
public void DeleteSyncMap(SyncMap sm, SQLiteCommand cmd) { db.DeleteSyncMap(sm, cmd); }
internal string DeleteSyncMap(SyncMap sm) { return db.DeleteSyncMap(sm); }
string IDbAdapter.DeleteSyncMap(SyncMap sm) { return db.DeleteSyncMap(sm); }