public Filmovi() { InitializeComponent(); FilmDAO fDAO = new FilmDAO(); this.DataContext = fDAO.getAll(); ComboBox1.ItemsSource = fDAO.getAll(); ComboBox2.ItemsSource = fDAO.getAll(); PrehrambeniProduktDao pDAO = new PrehrambeniProduktDao(); ListBox1.ItemsSource = pDAO.getAll(); ComboBox3.ItemsSource = pDAO.getAll(); }
public ProdajaHrane(int idp) { InitializeComponent(); pdao = new PrehrambeniProduktDao(); produkti = new List<PrehrambeniProdukt>(); kprodukti = new List<PrehrambeniProdukt>(); produkti = pdao.getAll(); comboprodukti.Items.Clear(); comboprodukti.ItemsSource = produkti; sifra = 0; id = idp; }
private void Button_Click_4(object sender, RoutedEventArgs e) { if (ComboBox3.SelectedIndex != -1) { PrehrambeniProduktDao pDAO = new PrehrambeniProduktDao(); PrehrambeniProdukt p = ComboBox3.SelectedItem as PrehrambeniProdukt; pDAO.delete(p); ListBox1.ItemsSource = pDAO.getAll(); ComboBox3.ItemsSource = pDAO.getAll(); } }
private void Button_Click_3(object sender, RoutedEventArgs e) { PrehrambeniProduktDao pDAO = new PrehrambeniProduktDao(); if (Naziv1.Text == String.Empty) return; PrehrambeniProdukt p = new PrehrambeniProdukt(Naziv1.Text, Convert.ToDouble(Cijena.Text)); pDAO.create(p); ListBox1.ItemsSource = pDAO.getAll(); ComboBox3.ItemsSource = pDAO.getAll(); Naziv1.Clear(); Cijena.Clear(); }