示例#1
0
        //Starts the process of exporting and importing.
        private async void btn_start_Click(object sender, EventArgs e)
        {
            FormControls.ToggleStartButton(false);
            List <string> databaseNames = new List <string>();

            FormControls.ClearOutputToApp();

            for (int i = 0; i < checkedListBox_databases.CheckedItems.Count; i++)
            {
                databaseNames.Add(checkedListBox_databases.CheckedItems[i].ToString());
            }

            string exportConnection = _dbExporter.GetExportConnectionString();
            string importConnection = _dbImporter.GetImportConnectionString();

            if (!await Utilities.TestConnection(exportConnection) || !await Utilities.TestConnection(importConnection))
            {
                return;
            }

            if (await _dbExporter.ExportDatabases(databaseNames, exportConnection))
            {
                await _dbImporter.ImportDatabases(databaseNames, importConnection);
            }

            FormControls.ToggleAllElements(true);
            FormControls.ToggleStartButton(true);
        }