Ejemplo n.º 1
0
        private void AddBtn_Click(object sender, RoutedEventArgs e)
        {
            _book         = gridBook.DataContext as Book;
            _book.Genre   = (Genre)cbGenre.SelectedItem;
            _book.Edition = (Edition)cbEdition.SelectedItem;

            _book.AddedBy   = MainWindow.user.Id;
            _book.AddedTime = DateTime.Now;

            if (dbContext.AddBook(_book))
            {
                MessageBox.Show("Книга добавлена успешно!");
                MainWindow._MainFrame.Navigate(new PageBooks());
            }
            else
            {
                MessageBox.Show("Возникли ошибки при добавлении книги!");
            }
        }