private void listPromo_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { ListBox listbox = sender as ListBox; Promo promo = listbox.SelectedItem as Promo; this.listener.OnPromoSelected(promo); }
public void removePromo(Promo promo) { this.itemPromo.Remove(promo); this.callback.removePromoSucceed(); capacity = 1; calculateSubTotal(); }
private void listBoxPakaiPromo_ItemClicked(object sender, MouseButtonEventArgs e) { if (MessageBox.Show("Kamu ingin membatalkan promo ini?", "Konfirmasi", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { ListBox listBox = sender as ListBox; Promo promo = listBox.SelectedItem as Promo; controller.deleteSelectedPromo(promo); } }
private void generateContentPromo() { Promo promo1 = new Promo("Promo Awal tahun Diskon 25 % ", diskonInPercent: 25); Promo promo2 = new Promo("Promo Tebus Murah Diskon 30 % ", diskonInPercent: 30); Promo promo3 = new Promo("Promo Natal", diskonInPercent: 10); controller.addPromo(promo1); controller.addPromo(promo2); controller.addPromo(promo3); listPromo.Items.Refresh(); }
public void addPromo(Promo promo) { if (capacity == 1) { this.itemPromo.Add(promo); this.callback.addPromoSucceed(); calculateSubTotal(); } else { MessageBox.Show("Kamu hanya dapat menggunakan salah satu voucher saja", "Oke", MessageBoxButton.OK); } }
public void addPromo(Promo item) { this.promos.Add(item); }
public void OnPromoSelected(Promo promo) { controller.addPromo(promo); }
public void OnPakaiPromoChangedListener(Promo promo) { controller.addPromo(promo); }
public void deleteSelectedPromo(Promo item) { this.keranjang.removePromo(item); }
public void addPromo(Promo item) { this.keranjang.addPromo(item); }