private void btnAccountInfo_Click(object sender, EventArgs e) { frmAccountInfo objAccountInfo = new frmAccountInfo(user); this.Hide(); objAccountInfo.Show(); }
private void btnAddAccount_Click(object sender, EventArgs e) { string databaseType = this.cboDbType.Text; if (string.IsNullOrEmpty(databaseType)) { MessageBox.Show("Please select a database type first."); } else { DatabaseType dbType = ManagerUtil.GetDatabaseType(databaseType); frmAccountInfo frmAccountInfo = new frmAccountInfo(dbType); DialogResult result = frmAccountInfo.ShowDialog(); if (result == DialogResult.OK) { this.LoadAccounts(frmAccountInfo.AccountProfileId); if (this.cboAccount.SelectedItem != null) { (this.cboAccount.SelectedItem as AccountProfileInfo).Password = frmAccountInfo.AccountProfileInfo.Password; } } } }
private bool SetConnectionInfo(AccountProfileInfo accountProfileInfo) { DatabaseType dbType = ManagerUtil.GetDatabaseType(this.cboDbType.Text); frmAccountInfo frmAccountInfo = new frmAccountInfo(dbType, true) { AccountProfileInfo = accountProfileInfo }; DialogResult dialogResult = frmAccountInfo.ShowDialog(); if (dialogResult == DialogResult.OK) { AccountProfileInfo profileInfo = frmAccountInfo.AccountProfileInfo; ObjectHelper.CopyProperties(profileInfo, (this.cboAccount.SelectedItem as AccountProfileInfo)); this.cboAccount.Text = profileInfo.Description; return(true); } else { this.btnConnect.Enabled = true; } return(false); }