private void Edit(object sender, EventArgs e) { var editAuthor = new EditAuthorForm(_author, _context); editAuthor.ShowDialog(); UpdateForm(); }
private void Edit(object sender, EventArgs e) { if (AuthorsListBox.SelectedItem == null) { MessageBox.Show(@"You must select the author you want to edit", @"No author selected", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var editAuthor = new EditAuthorForm((Author)AuthorsListBox.SelectedItem, _context); editAuthor.ShowDialog(); UpdateList(); }