private void DBConnectionsComboBox_SelectedIndexChanged(object sender, EventArgs e) { try { for (int i = 0; i < _tmp_settings.DBConnections.Count; i++) { if (_tmp_settings.DBConnections[i].DBConnectionName == DBConnectionsComboBox.SelectedItem.ToString()) { this.DBConnectionsComboBox.SelectedIndex = i; this.DBConnectionNameTextBox.Text = _tmp_settings.DBConnections[i].DBConnectionName; this.DbTypeComboBox.SelectedIndex = DbTypeComboBox.FindStringExact(_tmp_settings.DBConnections[i].DBType.ToString()); this.DBUserNameTextBox.Text = _tmp_settings.DBConnections[i].UserName; this.DBPasswordTextBox.Text = _tmp_settings.DBConnections[i].Pwd; this.OracleTNSTextBox.Text = _tmp_settings.DBConnections[i].TSNName; RemoveDBConnButton.Enabled = true; _newDbConnection = false; } } } catch (Exception ex) { CommonItem.ErrManger.ErrorManagement(ex, false, this); } }
private void frmSettings_Load(object sender, EventArgs e) { try { _tmp_settings = new MainApplicationSettings(); _tmp_settings.WebServices = new List <MainApplicationSettings.WebServiceInfo>(); if (_tmp_settings.LoadSettings(false)[0] == ApplicationSettings.classes.common.CommonConst.Loading_Status.NOT_FOUND) { return; } if (_tmp_settings.WebServices.Count > 0) { foreach (MainApplicationSettings.WebServiceInfo wsInfo in _tmp_settings.WebServices) { WebServiceNameComboBox.Items.Add(wsInfo); } WebServiceNameComboBox.SelectedIndex = 0; MainApplicationSettings.WebServiceInfo tmpWs = (MainApplicationSettings.WebServiceInfo)WebServiceNameComboBox.SelectedItem; this.WebServiceDescriptionLabel.Text = tmpWs.WebService_Description; this.WebServiceURLLabel.Text = tmpWs.WebService_public_URL; this.WebServiceUserNameLabel.Text = tmpWs.WebService_UserName; this.WebServicePasswordLabel.Text = tmpWs.WebService_Password; this.WebServiceReturnDetailImplementationLabel.Text = tmpWs.WebService_ReturnDetail.ToString(); } SaveDBConnButton.Enabled = false; RemoveDBConnButton.Enabled = false; _newDbConnection = false; if (_tmp_settings.DBConnections != null) { if (_tmp_settings.DBConnections.Count > 0) { this.DBConnectionsComboBox.Items.Clear(); foreach (MainApplicationSettings.DBInfo dbInfo in _tmp_settings.DBConnections) { this.DBConnectionsComboBox.Items.Add(dbInfo.DBConnectionName); } this.DBConnectionsComboBox.SelectedIndex = 0; this.DBConnectionNameTextBox.Text = _tmp_settings.DBConnections[0].DBConnectionName; this.DbTypeComboBox.SelectedIndex = DbTypeComboBox.FindStringExact(_tmp_settings.DBConnections[0].DBType.ToString()); this.DBUserNameTextBox.Text = _tmp_settings.DBConnections[0].UserName; this.DBPasswordTextBox.Text = _tmp_settings.DBConnections[0].Pwd; this.OracleTNSTextBox.Text = _tmp_settings.DBConnections[0].TSNName; RemoveDBConnButton.Enabled = true; } } if (_tmp_settings.InteractionWebService != null) { this.IntWSlabelName.Text = _tmp_settings.InteractionWebService.WebService_Name; this.IntWSlabelDescr.Text = _tmp_settings.InteractionWebService.WebService_Description; this.IntWSlabelUrl.Text = _tmp_settings.InteractionWebService.WebService_public_URL; this.IntWSlabelUser.Text = _tmp_settings.InteractionWebService.WebService_UserName; this.IntWSlabelPwd.Text = _tmp_settings.InteractionWebService.WebService_Password; } if (_tmp_settings.ValidationWebService != null) { this.ValWSlabelName.Text = _tmp_settings.ValidationWebService.WebService_Name; this.ValWSlabelDescription.Text = _tmp_settings.ValidationWebService.WebService_Description; this.ValWSlabelWSUrl.Text = _tmp_settings.ValidationWebService.WebService_public_URL; this.ValWSlabelUser.Text = _tmp_settings.ValidationWebService.WebService_UserName; this.ValWSlabelPwd.Text = _tmp_settings.ValidationWebService.WebService_Password; } this.TIME_PERIODTextBox.Text = _tmp_settings.TIME_PERIOD_default_valueDomainID; this.OBS_VALUEtextBox.Text = _tmp_settings.OBS_default_valueDomainID; //Initialize provider //InitializeProviders(); } catch (Exception ex) { CommonItem.ErrManger.ErrorManagement(ex, false, this); } }