Exemplo n.º 1
0
        //Connects tp the given server to get the database names.
        private async void btn_export_connect_Click(object sender, EventArgs e)
        {
            FormControls.EnableLoadingIcon();
            FormControls.ToggleAllElements(false);

            string exportConnectionString = _dbExporter.GetExportConnectionString();

            if (await Utilities.TestConnection(exportConnectionString, true))
            {
                databaseNamesFull = await _dbExporter.GetDatabaseNames(exportConnectionString);
            }

            userDatabaseNames = databaseNamesFull.Where(x => !_systemDatabaseNames.Contains(x.ToLower())).ToList();

            if (userDatabaseNames.Count == 0)
            {
                return;
            }

            Config.AddUpdateSetting("Export_ServerName", txtbx_export_server_name.Text);
            Config.AddUpdateSetting("Export_Username", txtbx_export_username.Text);
            Config.AddUpdateSetting("Export_Password", txtbx_export_password.Text);

            //Clear the database items that are currently showing.
            FormControls.UpdateDatabasesCheckedList(userDatabaseNames);
            FormControls.EnableLoadingIcon(false);
        }
Exemplo n.º 2
0
        //Used to test the connection to the import server.
        private async void btn_import_connect_Click(object sender, EventArgs e)
        {
            FormControls.EnableLoadingIcon();

            if (!await Utilities.TestConnection(_dbImporter.GetImportConnectionString(), false, true))
            {
                return;
            }

            Config.AddUpdateSetting("Import_ServerType", cmbbx_import_server_type.SelectedItem.ToString());
            Config.AddUpdateSetting("Import_ServerName", txtbx_import_server_name.Text);
            Config.AddUpdateSetting("Import_Username", txtbx_import_username.Text);
            Config.AddUpdateSetting("Import_Password", txtbx_import_password.Text);
        }