Example #1
0
        private void insert_books_Click(object sender, RoutedEventArgs e)
        {
            count++;
            Book_Window book_form = new Book_Window("Add", count);

            book_form.Owner = this;
            book_form.Title = "Insert Book";
            book_form.ShowDialog();
        }
Example #2
0
 private void edit_books_Click(object sender, RoutedEventArgs e)
 {
     if (listBox1.Items.Count != 0)
     {
         if (listBox1.SelectedItem != null)
         {
             Book        select_book = listBox1.SelectedItem as Book;
             Book_Window edit_form   = new Book_Window("Update", select_book);
             edit_form.Title = "Edit Book";
             edit_form.Owner = this;
             edit_form.ShowDialog();
         }
         else
         {
             MessageBox.Show("Елемент(Книга) не выбрана со списка! Попробуйте сначала выбрать", "Ничего не выбрано",
                             MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
     else
     {
         MessageBox.Show("Список пуст! Попробуйте сначала наполнить его.", "Пусто..",
                         MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }