private void tsbNew_Click(object sender, EventArgs e) { using (var accountForm = new frmAccount { Account = new Account() }) { var result = accountForm.ShowDialog(this); if (result == DialogResult.OK) { LoadList(); } } }
private void tsbEdit_Click(object sender, EventArgs e) { var account = SelectedAccount(); if (account == null) { return; } using (var accountForm = new frmAccount { Account = account }) { var result = accountForm.ShowDialog(this); if (result == DialogResult.OK) { LoadList(); } } }