Exemple #1
0
        private void sync_Click(object sender, EventArgs e)
        {
            // batch update queries: Seb + Gianni
            string fetchCustomersDB = "INSERT INTO SecondaryDB.mdb.Customers SELECT * FROM Customers",
                   fetchFlightsDB   = "INSERT INTO SecondaryDB.mdb.Flights SELECT * FROM Flights",
                   fetchHotelDB     = "INSERT INTO SecondaryDB.mdb.Hotel SELECT * FROM Hotel",
                   fetchCarsDB      = "INSERT INTO SecondaryDB.mdb.Cars SELECT * FROM Cars";

            string[] dbList = { fetchCustomersDB, fetchFlightsDB, fetchHotelDB, fetchCarsDB };
            // Avar: batch update notification
            var  primaryDatabase = new PrimaryDatabase();
            bool query           = primaryDatabase.batchUpdate(dbList, false);

            if (query == true)
            {
                MessageBox.Show("Sync completed successfully.");
            }
            else
            {
                MessageBox.Show("Sync unsuccessful. Please contact your system administrator.");
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            // batch update queries
            string fetchCustomersDB = "INSERT INTO SecondaryDB.mdb.Customers SELECT * FROM Customers",
                   fetchFlightsDB   = "INSERT INTO SecondaryDB.mdb.Flights SELECT * FROM Flights",
                   fetchHotelDB     = "INSERT INTO SecondaryDB.mdb.Hotel SELECT * FROM Hotel",
                   fetchCarsDB      = "INSERT INTO SecondaryDB.mdb.Cars SELECT * FROM Cars";

            string[] dbList = { fetchCustomersDB, fetchFlightsDB, fetchHotelDB, fetchCarsDB };

            var  primaryDatabase = new PrimaryDatabase();
            bool query           = primaryDatabase.batchUpdate(dbList, false);

            if (query == true)
            {
                MessageBox.Show("Syncronization successfull"); // success
            }
            else
            {
                // fail
            }
        }