Ejemplo n.º 1
0
        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");
            }
        }
Ejemplo n.º 2
0
        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");
                }
            }
        }