private void Edit() { AccountProfileInfo profile = this.GetSelectRecord(); if (profile != null) { frmAccountInfo frmAccountInfo = new frmAccountInfo(ManagerUtil.GetDatabaseType(this.cboDbType.Text), true) { AccountProfileInfo = profile }; if (frmAccountInfo.ShowDialog() == DialogResult.OK) { this.LoadAccounts(); } } }
private void btnAdd_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(); } } }