Example #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);
        }
Example #2
0
        public void insert_film_and_add(int id)
        {
            select_filter("select Год from Фильмы group by Год", ref years_filter);
            select_filter("select Жанр from Жанры", ref genres_filter);
            film f = new film(id);

            films.Add(f);
            checked_sort(null, null);
        }
Example #3
0
        private void stat_film(object sender, RoutedEventArgs e)
        {
            Grid grid = (sender as Button).Parent as Grid;

            active = grid;
            string name = ((grid.Parent as Border).Parent as panel_film).name.Text;
            film   film = get_film_by_name(name);
            stat   stat = new stat(film, films);

            stat.Owner = this;
            stat.ShowDialog();
        }
Example #4
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();
            }
        }
Example #5
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;
            }
        }
Example #6
0
 public edit(film f)
 {
     InitializeComponent();
     film = f;
 }
 public stat(film f, List <film> list)
 {
     InitializeComponent();
     film      = f;
     this.list = list;
 }