Пример #1
0
        private void SelectBookButton_Click(object sender, RoutedEventArgs e)
        {
            var selectBookWindow = new SelectBook(_library.Books);

            selectBookWindow.Owner = this;

            if (selectBookWindow.ShowDialog() == true)
            {
                selectBookWindow.Show();
            }
        }
Пример #2
0
        private void SelectBookButton_Click(object sender, RoutedEventArgs e)
        {
            Reader reader = _library.Readers.GetAllItems().FirstOrDefault(x => x.ToString().Equals(ChooseReaderTextBox.Text));

            if (reader == null)
            {
                (Owner as MainWindow).CallExceptionWindow($"Читатель не выбран");
                return;
            }

            var selectBookWindow = new SelectBook(_library.Books, reader.ID);

            selectBookWindow.Owner = this;

            if (selectBookWindow.ShowDialog() == true)
            {
                selectBookWindow.Show();
            }
        }