private void buttonSaveAndCloseSPD_Click(object sender, EventArgs e) { if (this.listBoxDatabases.SelectedItems.Count < 1) { MessageBox.Show("Please select one Database"); } DatabaseSettings databaseSettings = new DatabaseSettings(); databaseSettings.AccessFile = this.textBoxAccessFile.Text; databaseSettings.Access2007File = this.textBoxAccess2007File.Text; databaseSettings.MySQLDatabase = this.textBoxMySQLDatabase.Text; databaseSettings.MySQLServer = this.textBoxMySQLHostIP.Text; databaseSettings.MySQLPassword = this.textBoxMySQLPassword.Text; databaseSettings.MySQLPort = this.textBoxMySQLPort.Text; databaseSettings.MySQLUser = this.textBoxMySQLUser.Text; databaseSettings.PostgreSQLDatabase = this.textBoxPostgreSQLDatabase.Text; databaseSettings.PostgreSQLServer = this.textBoxPostgreSQLHostIP.Text; databaseSettings.PostgreSQLPassword = this.textBoxPostgreSQLPassword.Text; databaseSettings.PostgreSQLPort = this.textBoxPostgreSQLPort.Text; databaseSettings.PostgreSQLUser = this.textBoxPostgreSQLUser.Text; databaseSettings.Database = (Databases)Enum.Parse(new Databases().GetType(), this.listBoxDatabases.SelectedItem.ToString()); this.patComp.SetDatabaseSettings(databaseSettings); Application.Exit(); }
/// <summary> /// Sets the DB Settings /// </summary> /// <param name="databaseSettings"></param> public bool SetDatabaseSettings(DatabaseSettings databaseSettings) { using (ChannelFactory<ISPDBL> cf = new ChannelFactory<ISPDBL>(binding, endpointAddress)) { ISPDBL spdBL = cf.CreateChannel(); return spdBL.SetDatabaseSettings(databaseSettings); } }
/// <summary> /// Sets the DB Settings /// </summary> /// <param name="databaseSettings"></param> public override bool SetDatabaseSettings(DatabaseSettings databaseSettings) { return DBTools.SetDatabaseSettings(databaseSettings); }
/// <summary> /// Sets the DB Settings /// </summary> /// <param name="databaseSettings"></param> public abstract bool SetDatabaseSettings(DatabaseSettings databaseSettings);
/// <summary> /// Sets the DB Settings from the Settings /// </summary> /// <param name="databaseSettings"></param> /// <returns></returns> public static bool SetDatabaseSettings(DatabaseSettings databaseSettings) { if (databaseSettings == null) { return false; } SPD.DAL.Properties.Settings.Default.Access2007File = databaseSettings.Access2007File; SPD.DAL.Properties.Settings.Default.AccessFile = databaseSettings.AccessFile; SPD.DAL.Properties.Settings.Default.Database = databaseSettings.Database; SPD.DAL.Properties.Settings.Default.MySQLDatabase = databaseSettings.MySQLDatabase; SPD.DAL.Properties.Settings.Default.MySQLPassword = databaseSettings.MySQLPassword; SPD.DAL.Properties.Settings.Default.MySQLPort = databaseSettings.MySQLPort; SPD.DAL.Properties.Settings.Default.MySQLServer = databaseSettings.MySQLServer; SPD.DAL.Properties.Settings.Default.MySQLUser = databaseSettings.MySQLUser; SPD.DAL.Properties.Settings.Default.PostgreSQLDatabase = databaseSettings.PostgreSQLDatabase; SPD.DAL.Properties.Settings.Default.PostgreSQLPassword = databaseSettings.PostgreSQLPassword; SPD.DAL.Properties.Settings.Default.PostgreSQLPort = databaseSettings.PostgreSQLPort; SPD.DAL.Properties.Settings.Default.PostgreSQLServer = databaseSettings.PostgreSQLServer; SPD.DAL.Properties.Settings.Default.PostgreSQLUser = databaseSettings.PostgreSQLUser; SPD.DAL.Properties.Settings.Default.Save(); return true; }
/// <summary> /// Gets the DB Settings from the Settings /// </summary> /// <returns></returns> public static DatabaseSettings GetDatabaseSettings() { DatabaseSettings databaseSettings = new DatabaseSettings(); databaseSettings.Access2007File = SPD.DAL.Properties.Settings.Default.Access2007File; databaseSettings.AccessFile = SPD.DAL.Properties.Settings.Default.AccessFile; databaseSettings.Database = SPD.DAL.Properties.Settings.Default.Database; databaseSettings.MySQLDatabase = SPD.DAL.Properties.Settings.Default.MySQLDatabase; databaseSettings.MySQLPassword = SPD.DAL.Properties.Settings.Default.MySQLPassword; databaseSettings.MySQLPort = SPD.DAL.Properties.Settings.Default.MySQLPort; databaseSettings.MySQLServer = SPD.DAL.Properties.Settings.Default.MySQLServer; databaseSettings.MySQLUser = SPD.DAL.Properties.Settings.Default.MySQLUser; databaseSettings.PostgreSQLDatabase = SPD.DAL.Properties.Settings.Default.PostgreSQLDatabase; databaseSettings.PostgreSQLPassword = SPD.DAL.Properties.Settings.Default.PostgreSQLPassword; databaseSettings.PostgreSQLPort = SPD.DAL.Properties.Settings.Default.PostgreSQLPort; databaseSettings.PostgreSQLServer = SPD.DAL.Properties.Settings.Default.PostgreSQLServer; databaseSettings.PostgreSQLUser = SPD.DAL.Properties.Settings.Default.PostgreSQLUser; return databaseSettings; }
/// <summary> /// Not supported /// </summary> /// <param name="databaseSettings"></param> public override bool SetDatabaseSettings(DatabaseSettings databaseSettings) { throw new NotSupportedException(); }