private void chooseReaderButton_Click(object sender, EventArgs e) { var findReaderForm = new FindReaderForm(); DialogResult dialogResult = findReaderForm.ShowDialog(this); try { SelectedReader = findReaderForm.SelectedReader; chooseReaderButton.Text = $"{SelectedReader.Surname} {SelectedReader.Name};"; chooseReaderButton.BackColor = Color.White; OKButton.Enabled = true; } catch (Exception) { } }
private void chooseReaderButton_Click(object sender, EventArgs e) { var findReaderForm = new FindReaderForm(); DialogResult dialogResult = findReaderForm.ShowDialog(this); findReaderForm.Location = this.Location; if (dialogResult.Equals(DialogResult.Cancel)) { return; } SelectedReader = findReaderForm.SelectedReader; chooseReaderButton.Text = $"{SelectedReader.Surname} {SelectedReader.Name};"; chooseReaderButton.BackColor = Color.White; SetDataGridView(SelectedReader.Id); OKButton.Enabled = true; }