private void Button_Click_10(object sender, RoutedEventArgs e) { Discount_System.Visibility = Visibility.Visible; Promocodedb db = new Promocodedb(); promocodes.ItemsSource = db.list; }
private void discount3(object sender, RoutedEventArgs e) { if (Promocode.Text != "") { discount = new Discount(new DiscountPromocode()); discount.ExecuteDiscount(Promocode.Text, "", 0); MessageBox.Show("Промокод " + Promocode.Text + " додано до бази даних!"); Promocode.Text = ""; Promocodedb db = new Promocodedb(); promocodes.ItemsSource = db.list; } }
private void Button_Click_21(object sender, RoutedEventArgs e) { Promocodedb promocodedb = new Promocodedb(); if (promocodedb.isChecked(CheckPromocode.Text)) { MessageBox.Show("Промокод підтверджений!"); PR.Background = (Brush)bc2.ConvertFrom("#FF77C161"); PR.BorderBrush = (Brush)bc2.ConvertFrom("#FF77C161"); indicator.Kind = MaterialDesignThemes.Wpf.PackIconKind.Done; basketBook.setPromocode(); AllPrice.Text = basketBook.getSumm() + "₴"; } else { MessageBox.Show("Промокод не підтвердений!"); PR.Background = (Brush)bc2.ConvertFrom("#FFBC34E4"); PR.BorderBrush = (Brush)bc2.ConvertFrom("#FFBC34E4"); indicator.Kind = MaterialDesignThemes.Wpf.PackIconKind.Clear; } }