Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            FilmDAO fDAO = new FilmDAO();

            if (TextBox1.Text == String.Empty || TextBox2.Text == String.Empty)
                return;

            Film f = new Film(TextBox1.Text, Convert.ToInt32(TextBox2.Text));

            fDAO.update(f);

            this.DataContext = fDAO.getAll();
            ComboBox1.ItemsSource = fDAO.getAll();
            ComboBox2.ItemsSource = fDAO.getAll();

            TextBox1.Clear();
            TextBox2.Clear();
        }
Ejemplo n.º 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            FilmDAO fDAO = new FilmDAO();

            if (Naziv.Text == String.Empty || Sifra.Text == String.Empty)
                return;

            Film f = new Film(Naziv.Text, Convert.ToInt32(Sifra.Text));

            fDAO.create(f);

            this.DataContext = fDAO.getAll();

            ComboBox1.ItemsSource = fDAO.getAll();
            ComboBox2.ItemsSource = fDAO.getAll();

            Naziv.Clear();
            Sifra.Clear();
        }
Ejemplo n.º 4
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            if (ComboBox2.SelectedIndex != -1)
            {
                FilmDAO fDAO = new FilmDAO();

                Film f = ComboBox2.SelectedItem as Film;

                fDAO.delete(f);

                this.DataContext = fDAO.getAll();
                ComboBox1.ItemsSource = fDAO.getAll();
                ComboBox2.ItemsSource = fDAO.getAll();

            }
        }