private void selectCustomerButton_Click(object sender, System.EventArgs e) { using (CustomerSelector selector = new CustomerSelector()) { var dialogResult = selector.ShowDialog(this); if (dialogResult == DialogResult.Cancel) { return; } SetCustomerAsCurrent(selector.SelectedCustomer); } }
private void selectCustomerButton_Click(object sender, System.EventArgs e) { CustomerSelector selector = new CustomerSelector(); selector.ShowDialog(this); if (selector.CancelClicked) { return; } SetCustomerAsCurrent(selector.SelectedCustomer.CustomerId); }