// TO DO load catalogues for connection public void LoadCataloguesForUser(int connectionId) { TDSettings.ConnectionRow connection = _appSettings.GetConnectionById(connectionId); if (String.IsNullOrEmpty(connection.Charset)) { IUtilities utilities = (IUtilities)BLControllerFactory.GetRegisteredConcreteFactory(connectionId); connection.Charset = utilities.GetBugzillaCharset(connection.URL); _appSettings.EditConnection(connection); } SavingData data = new SavingData(OperationType.EditConnection, connection); this.LoadCataloguesForUser(data); }
private void btnSave_Click(object sender, EventArgs e) { try { ep.Clear(); // save connections bool isValid = CheckConditionsForSave(); if (isValid == true) { if (this._addConnection == true) { // get connection information int connectionID = _connSettings.AddConnection(txtConnectionName.Text.Trim(), this.FullConnectionURL(txtUrl.Text), cmbType.Text, txtUserName.Text.Trim(), txtPassword.Text.Trim(), true, chkActiveUser.Checked); // get version of the connection (async thread) this.GetVersionForConnection(connectionID, txtUrl.Text.Trim()); lstConnections.Enabled = true; LoadDefinedConnections(lstConnections.SelectedIndex); this._addConnection = false; btnAddConn.Enabled = true; } else { ConnectionItem ci = lstConnections.SelectedItem as ConnectionItem; if (ci != null) { string oldURL = _connSettings.GetConnectionById(ci.ConnectionID).URL; _connSettings.EditConnection(ci.ConnectionID , txtConnectionName.Text.Trim() , this.FullConnectionURL(txtUrl.Text) , cmbType.Text , txtUserName.Text.Trim() , txtPassword.Text.Trim() , true , chkActiveUser.Checked ); if (oldURL != txtUrl.Text.Trim()) { // get version of the connection (async thread) this.GetVersionForConnection(ci.ConnectionID, txtUrl.Text.Trim()); } } } MessageBox.Show(this, Messages.SaveGlSettingsOK, Messages.Info, MessageBoxButtons.OK, MessageBoxIcon.Information); LoadDefinedConnections(lstConnections.SelectedIndex); }// is valid = true } catch (Exception ex) { MyLogger.Write(ex, "btnSave_Click", LoggingCategory.Exception); MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } }