public ActionResult Index(BrowseViewModel model)
        {
            model.CurrentPage = 1;
            model.MovieTypes  = TypeBL.GetAllDO().OrderBy(q => q.Name).ToList();

            var movieList = MovieBL.GetAllAsDO();

            //save filter to session
            Session["BrowseFilters"] = model.Filters;

            //do the filtering
            movieList = model.Filters.DoFilter(movieList, UserID);

            model.MovieList = movieList.OrderBy(q => q.OriginalName).ToList();
            return(View(model));
        }
        public ActionResult Index(int page = 1)
        {
            BrowseViewModel model = new BrowseViewModel();

            model.MovieTypes  = TypeBL.GetAllDO().OrderBy(q => q.Name).ToList();
            model.MovieList   = MovieBL.GetAllAsDO().OrderBy(q => q.OriginalName).ToList();
            model.CurrentPage = page;

            if (Session["BrowseFilters"] != null)
            {
                model.Filters   = (FiltersForPage)Session["BrowseFilters"];
                model.MovieList = model.Filters.DoFilter(model.MovieList, UserID).OrderBy(q => q.OriginalName).ToList();
            }
            else
            {
                model.Filters = new Filtering.FiltersForPage();
            }

            return(View(model));
        }
Exemple #3
0
        private void InitializeDictionaries( )
        {
            allActors = new Dictionary <string, int>( );
            foreach (var item in ActorBL.GetAllDO( ))
            {
                allActors.Add(item.Name, item.ID);
                setProgressBarValue(parseStatus, parseStatus.Value + 1);
            }

            allDirectors = new Dictionary <string, int>( );
            foreach (var item in DirectorBL.GetAllDO( ))
            {
                allDirectors.Add(item.Name, item.ID);
                setProgressBarValue(parseStatus, parseStatus.Value + 1);
            }

            allLanguages = new Dictionary <string, int>( );
            foreach (var item in LanguageBL.GetAllDO( ))
            {
                allLanguages.Add(item.Name, item.ID);
                setProgressBarValue(parseStatus, parseStatus.Value + 1);
            }

            allTypes = new Dictionary <string, int>( );
            foreach (var item in TypeBL.GetAllDO( ))
            {
                allTypes.Add(item.Name, item.ID);
                setProgressBarValue(parseStatus, parseStatus.Value + 1);
            }

            allWriters = new Dictionary <string, int>( );
            foreach (var item in WriterBL.GetAllDO( ))
            {
                allWriters.Add(item.Name, item.ID);
                setProgressBarValue(parseStatus, parseStatus.Value + 1);
            }
        }