Esempio n. 1
0
        private void btnCurrLocation_Click(object sender, EventArgs e)
        {
            String temp = ((Button)sender).Text;

            pnlContent.Controls.Clear();

            //Don't bother moving if we're in the right place
            if (temp.Equals(lblLocation.Text))
            {
                //Stay here
            }
            else //otherwise change location
            {
                pnlContent.Controls.Clear();

                if (temp.Length >= 7 && temp.Substring(0, 7).Equals("Search:"))
                {
                    //MessageBox.Show("SEARCH TYPE LINK: "+loc+" + "+ temp);
                    pnlContent.Controls.Add(pnlSearch);
                    String[] renamer = temp.Split(' ');
                    renamer[0] = renamer[0].Substring(0, (renamer[0].Length - 1));
                    String newTitle = temp;
                    if (renamer.Length >= 2)
                    {
                        newTitle = renamer[0] + " Results for '" + renamer[1] + "'";
                    }
                    lblLocation.Text = newTitle;
                }
                else if (temp.Contains("Profile"))
                {
                    changetoProfilePage();
                    lblLocation.Text = temp;
                }
                else if (temp.Contains("Recommendations"))
                {
                    DBConnect helper = new DBConnect();
                    changeToRecPage(helper.selectRecomendations(UID));
                    lblLocation.Text = temp;
                }
                else
                {
                    //MessageBox.Show("MOVIE INFO LINK: " + loc + " + " + loc.Substring(0, 7));
                    pnlContent.Controls.Add(pnlMovieInfo);
                    lblLocation.Text = temp;
                }

                //FIND AND REMOVE EVERYTHING BEFORE THIS ONE
                //We record the location of it (farthest to the right)
                int location = breadcrumbsLayout.Controls.IndexOf((Button)sender) + 1;

                int len    = breadcrumbsLayout.Controls.Count; //then we see how many breacrumbs there are.
                int stopAt = len - location;

                for (int i = 0; i < stopAt; i++) //And remove all the ones after the one we just removed.
                {
                    breadcrumbsLayout.Controls.RemoveAt(breadcrumbsLayout.Controls.Count - 1);
                }
            }
        }
Esempio n. 2
0
        private void btnGetRecommends_Click(object sender, EventArgs e)
        {
            DBConnect helper = new DBConnect();

            changeToRecPage(helper.selectRecomendations(UID));
        }
Esempio n. 3
0
 private void btnGetRecommends_Click(object sender, EventArgs e)
 {
     DBConnect helper = new DBConnect();
     changeToRecPage(helper.selectRecomendations(UID));
 }
Esempio n. 4
0
        private void btnCurrLocation_Click(object sender, EventArgs e)
        {
            String temp = ((Button)sender).Text;
            pnlContent.Controls.Clear();

            //Don't bother moving if we're in the right place
            if (temp.Equals(lblLocation.Text))
            {
                //Stay here
            }
            else //otherwise change location
            {
                pnlContent.Controls.Clear();

                if (temp.Length >= 7 && temp.Substring(0, 7).Equals("Search:"))
                {
                    //MessageBox.Show("SEARCH TYPE LINK: "+loc+" + "+ temp);
                    pnlContent.Controls.Add(pnlSearch);
                    String[] renamer = temp.Split(' ');
                    renamer[0] = renamer[0].Substring(0, (renamer[0].Length - 1));
                    String newTitle = temp;
                    if(renamer.Length>=2)
                        newTitle = renamer[0] + " Results for '" + renamer[1] + "'";
                    lblLocation.Text = newTitle;

                }
                else if (temp.Contains("Profile"))
                {
                    changetoProfilePage();
                    lblLocation.Text = temp;
                }
                else if(temp.Contains("Recommendations"))
                {
                    DBConnect helper = new DBConnect();
                    changeToRecPage(helper.selectRecomendations(UID));
                    lblLocation.Text = temp;

                }
                else
                {
                    //MessageBox.Show("MOVIE INFO LINK: " + loc + " + " + loc.Substring(0, 7));
                    pnlContent.Controls.Add(pnlMovieInfo);
                    lblLocation.Text = temp;
                }

                //FIND AND REMOVE EVERYTHING BEFORE THIS ONE
                //We record the location of it (farthest to the right)
                int location = breadcrumbsLayout.Controls.IndexOf((Button)sender)+1;

                int len = breadcrumbsLayout.Controls.Count; //then we see how many breacrumbs there are.
                int stopAt = len - location;

                for (int i = 0; i < stopAt; i++) //And remove all the ones after the one we just removed.
                    breadcrumbsLayout.Controls.RemoveAt(breadcrumbsLayout.Controls.Count - 1);
            }
        }