Esempio n. 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            name.Text  = film.get_name();
            year.Text  = film.get_year().ToString();
            pic.Source = film.get_poster();
            DataTable t_janres = DataBase.exec_zapros("select Жанр from Жанры");

            for (int i = 0; i < t_janres.Rows.Count; i++)
            {
                genres_in_db.Add(t_janres.Rows[i][0].ToString());
                if (film.get_genres().Contains(t_janres.Rows[i][0].ToString()))
                {
                    Items.Add(new item {
                        Name = t_janres.Rows[i][0].ToString(), Isselected = true
                    });
                }
                else
                {
                    Items.Add(new item {
                        Name = t_janres.Rows[i][0].ToString(), Isselected = false
                    });
                }
            }
            janres.ItemsSource = Items;
        }
Esempio n. 2
0
        private void add_film(film f)
        {
            panel_film film = new panel_film();

            film.Poster   = f.get_poster();
            film.NameFilm = f.get_name();
            film.Year     = f.get_year();
            film.Ozenka   = f.get_sr_ozenka();
            List <string> m_genres = f.get_genres();
            string        genres   = "";

            for (int g = 0; g < m_genres.Count; g++)
            {
                genres += m_genres[g];
                if (g != m_genres.Count - 1)
                {
                    genres += ", ";
                }
            }
            film.Genres       = genres;
            film.Views        = f.get_views();
            film.edit.Click  += open_edit_film;
            film.stat.Click  += stat_film;
            film.close.Click += delete_film;
            film.MouseDown   += dbl_click_film;
            wrp.Children.Add(film);
        }
Esempio n. 3
0
        public void update_film_info(film f, BitmapImage poster)
        {
            panel_film pf = (active.Parent as Border).Parent as panel_film;

            pf.NameFilm = f.get_name();
            pf.Year     = f.get_year();
            List <string> genres = f.get_genres();
            string        gnr    = "";

            for (int i = 0; i < genres.Count; i++)
            {
                gnr += genres[i];
                if (i != genres.Count - 1)
                {
                    gnr += ", ";
                }
            }
            pf.Genres = gnr;
            if (poster != null)
            {
                pf.Poster = poster;
            }
        }