private bool DeleteBook(string catalogueNumber) { try { BookOperations.DeleteBook(catalogueNumber); return(true); } catch (Exception) { return(false); } }
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); } }