private void BtnCreateAuthor_Click(object sender, EventArgs e) { if (ValidateAuthorNameToInsertion()) { _authorService = new AuthorService(); _authorService.SaveAuthor(new Author { Name = TxtAuthorName.Text }); MessageBox.Show("Author created sucessfully", "", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtAuthorName.Text = string.Empty; Mediator.NotifyUpdateAuthorsList("AuthorCreation"); } }
private void BtnEditAuthor_Click(object sender, EventArgs e) { var selectedAuthor = (Author)CbAuthorsList.SelectedItem; using (FrmEditAuthor frmEditAuthor = new FrmEditAuthor(selectedAuthor)) { frmEditAuthor.ShowDialog(); if (frmEditAuthor.DialogResult == DialogResult.OK) { GetAuthorsList(); Mediator.NotifyUpdateAuthorsList("AuthorUpdate"); } } }