private void discount4(object sender, RoutedEventArgs e) { discount = new Discount(new RemoveDiscount()); discount.ExecuteDiscount("", "", 0); data2.ItemsSource = null; bob = new BaseOfBooks(); data2.ItemsSource = bob.getList(); }
private void discount1(object sender, RoutedEventArgs e) { discount = new Discount(new DiscountByAuthor()); discount.ExecuteDiscount("", DisNameA1.Text, (100 - Convert.ToDouble(DisDis1.Text)) / 100); MessageBox.Show("Знижку " + DisDis1.Text + "% на всі книги " + DisNameA1.Text + " надано!"); bob.DiscountUpdate(DisNameA1.Text, ((100 - Convert.ToDouble(DisDis1.Text)) / 100)); data2.ItemsSource = null; bob = new BaseOfBooks(); data2.ItemsSource = bob.getList(); DisNameA1.Text = ""; DisDis1.Text = ""; }
private void Button_Click_7(object sender, RoutedEventArgs e) { Book aa = bob.GetBookByID(indexbook); MessageBoxResult messageBoxResult2 = MessageBox.Show("Ви дійсно хочете видалити книгу '" + aa.Name.Trim() + "' - " + aa.Author.Trim(), "Видалити книгу", MessageBoxButton.YesNo); if (messageBoxResult2 == MessageBoxResult.Yes) { bob.DelBook(aa); MessageBox.Show("Книгу видалено успішно"); CountGenres(); bob = new BaseOfBooks(); data2.ItemsSource = null; data2.ItemsSource = bob.getList(); Reload(); } }