Ejemplo n.º 1
0
        public static void ShowTab_AllMovie()
        {
            if (FRM.Main == null)
            {
                return;
            }

            ucMovieList movieList = new ucMovieList();

            movieList.Dock     = DockStyle.Fill;
            movieList.Location = new Point(0, 0);
            movieList.OnDoubleClickMovieList += new WhenDoubleClickMovieList(movieList_OnDoubleClickMovieList);
            movieList.OnKeyUpMovieList       += new WhenKeyUpMovieList(movieList_OnKeyUpMovieList);

            TabPage newTabPage = new TabPage();

            newTabPage.Tag = new string[] {
                "all_movies",
                "All Movies @ " + ptkGeneral.GetTodayDateTimeSqlFormat()
            };
            newTabPage.Controls.Add(movieList);

            FRM.Main.tabMain.TabPages.Add(newTabPage);
            FRM.Main.tabMain.SelectedTab = newTabPage;
            FRM.Main.generateTabFunctionKey();

            movieList.RefreshMovieList(MovieDB.GetMovieList(), "All Movie");
        }
Ejemplo n.º 2
0
        private void __RefreshSearchResult(List <MovieProfile> listResult, string descMovie)
        {
            // Build new moview result tab is Difference Topic
            if (movieList != null)
            {
                if (!movieList.Visible)
                {
                    movieList = null;
                }
                else
                {
                    if (movieList.Tag != null)
                    {
                        if (!movieList.Tag.ToString().Equals(CurrentTopic))
                        {
                            movieList = null;
                        }
                    }
                    else
                    {
                        movieList.Tag = CurrentTopic;
                    }
                }
            }

            // Build Result in form Main & New TAB
            if (movieList == null)
            {
                movieList          = new ucMovieList();
                movieList.Dock     = DockStyle.Fill;
                movieList.Location = new Point(0, 0);
                movieList.OnDoubleClickMovieList += new WhenDoubleClickMovieList(that.movieList_OnDoubleClickMovieList);
                movieList.OnKeyUpMovieList       += new WhenKeyUpMovieList(that.movieList_OnKeyUpMovieList);

                movieList.Tag = CurrentTopic;

                tabSearchResult     = new TabPage();
                tabSearchResult.Tag = new string[] { "search_result", "Search Result" };
                tabSearchResult.Controls.Add(movieList);

                FRM.Main.tabMain.TabPages.Add(tabSearchResult);
                FRM.Main.tabMain.SelectedTab = tabSearchResult;
                FRM.Main.generateTabFunctionKey();
            }

            // Action !!!
            movieList.RefreshMovieList(listResult, descMovie);
        }
Ejemplo n.º 3
0
        public static void ShowTab_FilterMovie(string filterKey)
        {
            if (FRM.Main == null)
            {
                return;
            }
            if (!that.Filter.Contains(filterKey))
            {
                return;
            }
            MovieFilter filter = null;

            try
            {
                filter = JsonConvert.DeserializeObject <MovieFilter>(that.Filter[filterKey]);
                that.DebugAndLog("ShowFilterMovie()->Decode filter name [" + filterKey + "] Success");
            }
            catch (Exception ex) {
                that.DebugAndLog("ShowFilterMovie()->Decode filter name [" + filterKey + "] Fail");
                that.DebugAndLog("Exception: " + ex.Message);
                return;
            }
            if (filter == null)
            {
                return;                     // Second Trap for SAFE :P
            }
            ucMovieList movieList = new ucMovieList();

            movieList.Dock     = DockStyle.Fill;
            movieList.Location = new Point(0, 0);
            movieList.OnDoubleClickMovieList += new WhenDoubleClickMovieList(movieList_OnDoubleClickMovieList);
            movieList.OnKeyUpMovieList       += new WhenKeyUpMovieList(movieList_OnKeyUpMovieList);


            TabPage newTabPage = new TabPage();

            newTabPage.Tag = new string[] {
                "filter_movie",
                "Filter Movie"
            };
            newTabPage.Controls.Add(movieList);

            FRM.Main.tabMain.TabPages.Add(newTabPage);
            FRM.Main.tabMain.SelectedTab = newTabPage;
            FRM.Main.generateTabFunctionKey();

            movieList.RefreshMovieList(MovieDB.GetMovieList(filter), "Filter Movie by [" + filterKey + "]");
        }
Ejemplo n.º 4
0
        private void _RefreshSearchResult(List <MovieProfile> listResult, string descMovie)
        {
            if (movieList == null)
            {
                movieList          = new ucMovieList();
                movieList.Dock     = DockStyle.Fill;
                movieList.Location = new Point(0, 0);
                movieList.OnDoubleClickMovieList += new WhenDoubleClickMovieList(that.movieList_OnDoubleClickMovieList);
                movieList.OnKeyUpMovieList       += new WhenKeyUpMovieList(that.movieList_OnKeyUpMovieList);

                tabSearchResult     = new TabPage();
                tabSearchResult.Tag = new string[] { "search_result", "Search Result" };
                tabSearchResult.Controls.Add(movieList);

                FRM.Main.tabMain.TabPages.Add(tabSearchResult);
                FRM.Main.tabMain.SelectedTab = tabSearchResult;
                FRM.Main.generateTabFunctionKey();
            }
            movieList.RefreshMovieList(listResult, descMovie);
        }