Example #1
0
        /// <summary>
        /// Обработва добавянето на филми или сериали в любими
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addToFav_Click(object sender, EventArgs e)
        {
            if (films.Checked)
            {
                string[] array = row.Split(',');

                int          filmID = ViewControl.Instance.getID(array[2], "Films");
                FilmsLibrary film   = new FilmsLibrary();
                film.setFilmID(filmID);
                film.setUserID(ViewControl.Instance.getLoggedUserID());
                ViewControl.Instance.setData(film, "FilmsLibrary");
            }

            if (series.Checked)
            {
                string[] array = row.Split(',');

                int           seriesID = ViewControl.Instance.getID(array[2], "Series");
                SeriesLibrary series   = new SeriesLibrary();
                series.setSeries(seriesID);
                series.setUser(ViewControl.Instance.getLoggedUserID());
                ViewControl.Instance.setData(series, "SeriesLibrary");
            }
            row = "";
        }
Example #2
0
        /// <summary>
        /// Създава контекстното меню за премахване на сериали от любими
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void delLibraryBut_Click(object sender, EventArgs e)
        {
            string[] array = row.Split(',');
            if (userTabView.SelectedTab.Name == "libraryView")
            {
                int          filmID = ViewControl.Instance.getID(array[2], "Films");
                FilmsLibrary film   = new FilmsLibrary();
                film.setFilmID(filmID);
                film.setUserID(ViewControl.Instance.getLoggedUserID());
                ViewControl.Instance.deleteData(film, "FilmsLibrary");
            }
            if (userTabView.SelectedTab.Name == "userSeriesView")
            {
                int           seriesID = ViewControl.Instance.getID(array[2], "Series");
                SeriesLibrary series   = new SeriesLibrary();
                series.setSeries(seriesID);
                series.setUser(ViewControl.Instance.getLoggedUserID());
                ViewControl.Instance.deleteData(series, "SeriesLibrary");
            }
            this.reloadFilmsSeries_Click(sender, e);

            row = "";
        }