private void txt_server_config_TextChanged(object sender, EventArgs e) { try { OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin; OpenERPConnect openerp_connect = openerp_outlook.Connection; openerp_connect.URL = txt_server_config.Text; this.combo_config_database.Text = ""; this.txt_dbname.Text = ""; try { openerp_connect.DBList(); this.load_dbname_list(); if (txt_dbname.Visible) { txt_dbname.Visible = false; } combo_config_database.Visible = true; } catch { if (combo_config_database.Visible) { combo_config_database.Visible = false; } this.txt_dbname.Visible = true; } this.txt_username.Text = ""; this.txt_password.Text = ""; } catch (Exception ex) { Connect.handleException(ex); } }
private void frm_openerp_configuration_Load(object sender, EventArgs e) { try { this.config_manager = new ConfigManager(); this.config_manager.LoadConfigurationSetting(); OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin; OpenERPConnect openerp_connect = openerp_outlook.Connection; if (this.txt_server_config.Text != "") { openerp_connect.URL = this.txt_server_config.Text; } if (openerp_connect.rempwd == true) { this.txt_password.Text = Tools.DecryptB64Pwd(openerp_connect.pswrd); this.chkpwd.Checked = true; } if (openerp_connect.URL != null) { this.txt_server_config.Text = openerp_connect.URL; this.txt_username.Text = openerp_connect.UserId; try { object[] res_dblist = openerp_connect.DBList(); foreach (string selection in res_dblist) { if (openerp_connect.DBName != "" && selection == openerp_connect.DBName) { this.combo_config_database.SelectedText = openerp_connect.DBName; } } this.load_dbname_list(); } catch { this.setdblist(openerp_connect.DBName); } } } catch (Exception ex) { Connect.handleException(ex); } }
void load_dbname_list() { combo_config_database.Items.Clear(); OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin; OpenERPConnect openerp_connect = openerp_outlook.Connection; try { if (openerp_connect.URL != null && openerp_connect.URL != "") { object[] res_dblist = openerp_connect.DBList(); foreach (var selection in res_dblist) { combo_config_database.Items.Add(selection); } } } catch { this.setdblist(openerp_connect.DBName); } }