Beispiel #1
0
 private bool DeleteBook(string catalogueNumber)
 {
     try {
         BookOperations.DeleteBook(catalogueNumber);
         return(true);
     }
     catch (Exception) {
         return(false);
     }
 }
Beispiel #2
0
        private void BTNDeleteBook_Click(object sender, RoutedEventArgs e)
        {
            if (TXTBookCatalogueNumber.Text == string.Empty)
            {
                MessageBox.Show("Podaj numer katalogowy ksiazki ktora chcesz usunac!", "Libary System",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return;
            }

            try {
                BookOperations.DeleteBook(TXTBookCatalogueNumber.Text);
                MessageBox.Show("Ksiazka zostala usunieta pomyslnie!", "Libary System", MessageBoxButton.OK,
                                MessageBoxImage.Information);
                TXTBookCatalogueNumber.Text = string.Empty;
            }
            catch (Exception exception) {
                MessageBox.Show(exception.Message, "Libary System", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }