Example #1
0
        public void RemoveTable(string tableName, a7DbComparedDataBases fromDbSource)
        {
            var fromDb = GetDb(fromDbSource);
            var toDb   = GetOtherDb(fromDbSource);

            var table = fromDb.Tables[tableName];

            throw new NotImplementedException();
        }
Example #2
0
        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);
        }
Example #3
0
 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;
             });
         });
     }
                                                 );
 }
Example #4
0
 public string GetDbName(a7DbComparedDataBases db)
 {
     if (db == a7DbComparedDataBases.A)
     {
         return(DbAName);
     }
     else
     {
         return(DbBName);
     }
 }
Example #5
0
 public Database GetOtherDb(a7DbComparedDataBases db)
 {
     if (db == a7DbComparedDataBases.B)
     {
         return(DbA);
     }
     else
     {
         return(DbB);
     }
 }
Example #6
0
        public Table GetTable(string tableName, a7DbComparedDataBases db)
        {
            Database database;

            if (db == a7DbComparedDataBases.A)
            {
                database = DbA;
            }
            else
            {
                database = DbB;
            }
            return(database.Tables[tableName]);
        }