Esempio n. 1
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. 2
0
        private void dbl_click_film(object sender, MouseEventArgs e)
        {
            panel_film pf = sender as panel_film;

            active = pf.grid;
            string name = pf.name.Text;
            int    id   = get_film_by_name(name).get_id();
            views  v    = new views(id);

            v.Owner = this;
            v.ShowDialog();
        }
Esempio n. 3
0
        public void update_views(int id)
        {
            film film = get_film_by_id(id);

            film.update_views();
            panel_film pf = (active.Parent as Border).Parent as panel_film;

            pf.Views = film.get_views();
            if (film.get_sr_ozenka() != pf.Ozenka)
            {
                pf.Ozenka = film.get_sr_ozenka();
            }
        }
Esempio n. 4
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;
            }
        }