private async void btn_Add_Book_Click(object sender, RoutedEventArgs e)
        {
            string Author_Name       = txt_Author_Name.Text.Trim();
            string Author_Surname    = txt_Author_Surname.Text.Trim();
            string Author_Patronymic = txt_Author_Patronymic.Text.Trim();
            string Book_Name         = txt_Book_Name.Text.Trim();

            Authors author = new Authors();

            author.Author_Name       = Author_Name;
            author.Author_Surname    = Author_Surname;
            author.Author_Patronymic = Author_Patronymic;

            Books book = new Books();

            book.Book_Name = Book_Name;


            _libdb.Authors.Add(author);
            await _libdb.SaveChangesAsync();
        }
        private void AuthorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Authors authorForm = new Authors();

            authorForm.ShowDialog();
        }
Exemple #3
0
        public Author FindAuthorById(int idAuthor)
        {
            var author = Authors.Find(x => x.Id == idAuthor);

            return(author);
        }
        private void BtnShowAutorsForm_Click(object sender, EventArgs e)
        {
            Authors AuthorsForm = new Authors();

            AuthorsForm.ShowDialog();
        }