public void RemoveTable(string tableName, a7DbComparedDataBases fromDbSource) { var fromDb = GetDb(fromDbSource); var toDb = GetOtherDb(fromDbSource); var table = fromDb.Tables[tableName]; throw new NotImplementedException(); }
public void CopyTable(string tableName, a7DbComparedDataBases fromDbSource) { var fromDb = GetDb(fromDbSource); var toDb = GetOtherDb(fromDbSource); var table = fromDb.Tables[tableName]; a7DbTableUtils.CopyTable(table, tableName, toDb); }
public a7DbTableOnlyIn(string tableName, a7DbComparedDataBases onlyIn, a7DbStructureComparer comparer) { TableName = tableName; AddToOtherDbName = comparer.GetOtherDb(onlyIn).Name; AddToOtherCommand = new a7LambdaCommand((o) => { comparer.IsBusy = true; Task.Factory.StartNew(() => { comparer.CopyTable(TableName, onlyIn); Application.Current.Dispatcher.Invoke(() => { if (onlyIn == a7DbComparedDataBases.A) { comparer.TablesOnlyInA.Remove(this); } else { comparer.TablesOnlyInB.Remove(this); } comparer.IsBusy = false; }); }).ContinueWith((t) => { if (t.Exception != null) { throw t.Exception; } }); } ); RemoveFromThisDbName = comparer.GetDb(onlyIn).Name; RemoveFromThisCommand = new a7LambdaCommand((o) => { comparer.IsBusy = true; Task.Factory.StartNew(() => { var tbl = comparer.GetTable(TableName, onlyIn); tbl.Drop(); Application.Current.Dispatcher.Invoke(() => { if (onlyIn == a7DbComparedDataBases.A) { comparer.TablesOnlyInA.Remove(this); } else { comparer.TablesOnlyInB.Remove(this); } comparer.IsBusy = false; }); }); } ); }
public string GetDbName(a7DbComparedDataBases db) { if (db == a7DbComparedDataBases.A) { return(DbAName); } else { return(DbBName); } }
public Database GetOtherDb(a7DbComparedDataBases db) { if (db == a7DbComparedDataBases.B) { return(DbA); } else { return(DbB); } }
public Table GetTable(string tableName, a7DbComparedDataBases db) { Database database; if (db == a7DbComparedDataBases.A) { database = DbA; } else { database = DbB; } return(database.Tables[tableName]); }