Esempio n. 1
0
        public void changetoRateMovieList()
        {
            if (ratingsDone > 0 || ratingsDone == -1)
            {
                removeBreadcrumbs(null, "");
                lblLocation.Text = "Rating Movies";
                pnlContent.Controls.Clear();


                DBConnect helper   = new DBConnect();
                Movie     theMovie = helper.selectRandomMovies(1)[0];
                currMovie = theMovie;

                //Panel pnlRate = new Panel();
                //pnlRate.Controls.Add(theMovie.buildThumbnailPanel());
                // pnlRate.Dock = DockStyle.Fill;

                //Add left column contents
                FlowLayoutPanel leftCol = new FlowLayoutPanel();
                leftCol.Padding       = new Padding(0);
                leftCol.Dock          = DockStyle.Fill;
                leftCol.FlowDirection = FlowDirection.TopDown;


                //Create area for ratings
                FlowLayoutPanel ratings = new FlowLayoutPanel();
                ratings.Margin = new Padding(22, 0, 0, 0);
                //ratings.Height = 550;
                //ratings.Width = 550;
                ratings.FlowDirection = FlowDirection.LeftToRight;
                ratings.Padding       = new Padding(0);
                ratings.BackColor     = Color.SteelBlue;
                PictureBox starOne   = new PictureBox();
                PictureBox starTwo   = new PictureBox();
                PictureBox starThree = new PictureBox();
                PictureBox starFour  = new PictureBox();
                PictureBox starFive  = new PictureBox();
                starOne.Size   = new Size(25, 26);
                starTwo.Size   = new Size(25, 26);
                starThree.Size = new Size(25, 26);
                starFour.Size  = new Size(25, 26);
                starFive.Size  = new Size(25, 26);

                starOne.Margin   = new Padding(3);
                starTwo.Margin   = new Padding(3);
                starThree.Margin = new Padding(3);
                starFour.Margin  = new Padding(3);
                starFive.Margin  = new Padding(3);

                starOne.Padding   = new Padding(0);
                starTwo.Padding   = new Padding(0);
                starThree.Padding = new Padding(0);
                starFour.Padding  = new Padding(0);
                starFive.Padding  = new Padding(0);

                starOne.ImageLocation   = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starTwo.ImageLocation   = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starThree.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starFour.ImageLocation  = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starFive.ImageLocation  = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");

                stars = new List <PictureBox>();
                stars.Add(starOne);
                stars.Add(starTwo);
                stars.Add(starThree);
                stars.Add(starFour);
                stars.Add(starFive);


                //Event listeners
                ratings.MouseLeave += new EventHandler(ratings_MouseLeave);

                starOne.MouseEnter   += new EventHandler(oneStar_MouseEnter);
                starTwo.MouseEnter   += new EventHandler(twoStar_MouseEnter);
                starThree.MouseEnter += new EventHandler(threeStar_MouseEnter);
                starFour.MouseEnter  += new EventHandler(fourStar_MouseEnter);
                starFive.MouseEnter  += new EventHandler(fiveStar_MouseEnter);

                starOne.MouseClick   += new MouseEventHandler(starOne_MouseClick);
                starTwo.MouseClick   += new MouseEventHandler(starTwo_MouseClick);
                starThree.MouseClick += new MouseEventHandler(starThree_MouseClick);
                starFour.MouseClick  += new MouseEventHandler(starFour_MouseClick);
                starFive.MouseClick  += new MouseEventHandler(starFive_MouseClick);

                Button btnSkip = new Button();
                btnSkip.MouseClick += new MouseEventHandler(btnSkip_MouseClick);
                btnSkip.Text        = "Skip";
                btnSkip.BackColor   = Color.LightSkyBlue;
                btnSkip.ForeColor   = Color.White;
                btnSkip.Width       = 150;
                btnSkip.FlatStyle   = FlatStyle.Flat;

                Label lblRatingsLeft = new Label();
                lblRatingsLeft.ForeColor = Color.White;
                lblRatingsLeft.Text      = (ratingsDone).ToString() + " ratings to go.";


                //Add to panels
                ratings.Controls.Add(starOne);
                ratings.Controls.Add(starTwo);
                ratings.Controls.Add(starThree);
                ratings.Controls.Add(starFour);
                ratings.Controls.Add(starFive);
                ratings.Controls.Add(btnSkip);



                leftCol.Controls.Add(theMovie.buildThumbnailPanel()); //add thumbnails

                leftCol.Controls.Add(ratings);

                if (ratingsDone != -1)
                {
                    leftCol.Controls.Add(lblRatingsLeft);
                }

                pnlContent.Controls.Add(leftCol);
                //pnlRate.Controls.Add(leftCol);
            }
            else
            {
                pnlContent.Controls.Clear();
                FlowLayoutPanel temp = new FlowLayoutPanel();
                temp.FlowDirection = FlowDirection.TopDown;
                temp.Height        = 400;
                temp.Width         = 800;
                Label error = new Label();
                error.Height     = 150;
                error.Width      = 800;
                error.TextAlign  = ContentAlignment.BottomCenter;
                error.ForeColor  = Color.White;
                error.Text       = "Ratings Complete! We can now give you recommendations, if you would like to continue rating movies, click the button below:";
                lblLocation.Text = "Ratings Complete";

                Button moreRatings = new Button();
                moreRatings.Margin    = new Padding(350, 20, 0, 0);
                moreRatings.Text      = "Continue Rating!";
                moreRatings.AutoSize  = true;
                moreRatings.FlatStyle = FlatStyle.Flat;
                moreRatings.ForeColor = Color.White;
                moreRatings.BackColor = Color.LightSkyBlue;

                moreRatings.MouseClick += new MouseEventHandler(moreRatings_MouseClick);



                temp.Controls.Add(error);
                temp.Controls.Add(moreRatings);
                pnlContent.Controls.Add(temp);
            }
        }
Esempio n. 2
0
        public void changetoRateMovieList()
        {
            if (ratingsDone > 0 || ratingsDone == -1)
            {
                removeBreadcrumbs(null, "");
                lblLocation.Text = "Rating Movies";
                pnlContent.Controls.Clear();

                DBConnect helper = new DBConnect();
                Movie theMovie = helper.selectRandomMovies(1)[0];
                currMovie = theMovie;

                //Panel pnlRate = new Panel();
                //pnlRate.Controls.Add(theMovie.buildThumbnailPanel());
                // pnlRate.Dock = DockStyle.Fill;

                //Add left column contents
                FlowLayoutPanel leftCol = new FlowLayoutPanel();
                leftCol.Padding = new Padding(0);
                leftCol.Dock = DockStyle.Fill;
                leftCol.FlowDirection = FlowDirection.TopDown;

                //Create area for ratings
                FlowLayoutPanel ratings = new FlowLayoutPanel();
                ratings.Margin = new Padding(22, 0, 0, 0);
                //ratings.Height = 550;
                //ratings.Width = 550;
                ratings.FlowDirection = FlowDirection.LeftToRight;
                ratings.Padding = new Padding(0);
                ratings.BackColor = Color.SteelBlue;
                PictureBox starOne = new PictureBox();
                PictureBox starTwo = new PictureBox();
                PictureBox starThree = new PictureBox();
                PictureBox starFour = new PictureBox();
                PictureBox starFive = new PictureBox();
                starOne.Size = new Size(25, 26);
                starTwo.Size = new Size(25, 26);
                starThree.Size = new Size(25, 26);
                starFour.Size = new Size(25, 26);
                starFive.Size = new Size(25, 26);

                starOne.Margin = new Padding(3);
                starTwo.Margin = new Padding(3);
                starThree.Margin = new Padding(3);
                starFour.Margin = new Padding(3);
                starFive.Margin = new Padding(3);

                starOne.Padding = new Padding(0);
                starTwo.Padding = new Padding(0);
                starThree.Padding = new Padding(0);
                starFour.Padding = new Padding(0);
                starFive.Padding = new Padding(0);

                starOne.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starTwo.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starThree.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starFour.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");
                starFive.ImageLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Graphics/blankstar.png");

                stars = new List<PictureBox>();
                stars.Add(starOne);
                stars.Add(starTwo);
                stars.Add(starThree);
                stars.Add(starFour);
                stars.Add(starFive);

                //Event listeners
                ratings.MouseLeave += new EventHandler(ratings_MouseLeave);

                starOne.MouseEnter += new EventHandler(oneStar_MouseEnter);
                starTwo.MouseEnter += new EventHandler(twoStar_MouseEnter);
                starThree.MouseEnter += new EventHandler(threeStar_MouseEnter);
                starFour.MouseEnter += new EventHandler(fourStar_MouseEnter);
                starFive.MouseEnter += new EventHandler(fiveStar_MouseEnter);

                starOne.MouseClick += new MouseEventHandler(starOne_MouseClick);
                starTwo.MouseClick += new MouseEventHandler(starTwo_MouseClick);
                starThree.MouseClick += new MouseEventHandler(starThree_MouseClick);
                starFour.MouseClick += new MouseEventHandler(starFour_MouseClick);
                starFive.MouseClick += new MouseEventHandler(starFive_MouseClick);

                Button btnSkip = new Button();
                btnSkip.MouseClick += new MouseEventHandler(btnSkip_MouseClick);
                btnSkip.Text = "Skip";
                btnSkip.BackColor = Color.LightSkyBlue;
                btnSkip.ForeColor = Color.White;
                btnSkip.Width = 150;
                btnSkip.FlatStyle = FlatStyle.Flat;

                Label lblRatingsLeft = new Label();
                lblRatingsLeft.ForeColor = Color.White;
                lblRatingsLeft.Text = (ratingsDone).ToString() + " ratings to go.";

                //Add to panels
                ratings.Controls.Add(starOne);
                ratings.Controls.Add(starTwo);
                ratings.Controls.Add(starThree);
                ratings.Controls.Add(starFour);
                ratings.Controls.Add(starFive);
                ratings.Controls.Add(btnSkip);

                leftCol.Controls.Add(theMovie.buildThumbnailPanel()); //add thumbnails

                leftCol.Controls.Add(ratings);

                if(ratingsDone != -1)
                    leftCol.Controls.Add(lblRatingsLeft);

                pnlContent.Controls.Add(leftCol);
                //pnlRate.Controls.Add(leftCol);
            }
            else
            {
                pnlContent.Controls.Clear();
                FlowLayoutPanel temp = new FlowLayoutPanel();
                temp.FlowDirection = FlowDirection.TopDown;
                temp.Height = 400;
                temp.Width = 800;
                Label error = new Label();
                error.Height = 150;
                error.Width = 800;
                error.TextAlign = ContentAlignment.BottomCenter;
                error.ForeColor = Color.White;
                error.Text = "Ratings Complete! We can now give you recommendations, if you would like to continue rating movies, click the button below:";
                lblLocation.Text = "Ratings Complete";

                Button moreRatings = new Button();
                moreRatings.Margin = new Padding(350, 20, 0, 0);
                moreRatings.Text = "Continue Rating!";
                moreRatings.AutoSize = true;
                moreRatings.FlatStyle = FlatStyle.Flat;
                moreRatings.ForeColor = Color.White;
                moreRatings.BackColor = Color.LightSkyBlue;

                moreRatings.MouseClick += new MouseEventHandler(moreRatings_MouseClick);

                temp.Controls.Add(error);
                temp.Controls.Add(moreRatings);
                pnlContent.Controls.Add(temp);
            }
        }