Exemplo n.º 1
0
        //returns a show from the database
        public Show getShow(string show)
        {
            string name = "";
            int metascore = 0;
            int userscore = 0;
            string resume = "";
            string genre = "";
            DateTime date = DateTime.Today;
            int length = 0;
            int time = 0;
            foreach (Dictionary<string, object> D in db.getSerie(show))
            {
                name = (string)D["naam"];
                metascore = Convert.ToInt32(D["metascore"]);
                userscore = Convert.ToInt32(D["userscore"]);
                resume = (string)D["samenvatting"];
                genre = (string)D["genre"];
                date = (DateTime)D["datum"];
                length = Convert.ToInt32(D["lengte"]);
                time = Convert.ToInt32(D["tijdstip"]);
            }

            Show newShow = new Show(metascore, userscore, name, genre, resume, date, length, time);
            return newShow;
        }
Exemplo n.º 2
0
 public void TestGetShow()
 {
     Show show = new Show(10, 10, "name", "genre", "resume", DateTime.Now, 10, 10);
     show = show.getShow("Power");
     Assert.AreEqual("Power", show.Name, "Check if show name is equal");
 }
Exemplo n.º 3
0
 public void getInfo()
 {
     //check session to see what image is clicked then fill the page with the information
     //uses InnerHtml tag to write data to the asp page.
     switch ((string) Session["imageClicked"])
     {
         case "Fallout4":
             game = game.getGame("Fallout4");
             info.InnerHtml += "Naam:" + game.Name + ", Userscore: <font color=\"" +getColor(getAverage(3)) + "\">" + getAverage(3) + "</font>" + ", Metascore: <font color=\"" + getColor(game.Metascore) + "\">" + game.Metascore + "</font>";
             samenvatting.InnerHtml += game.Resume;
             reviews.InnerHtml += getReviews(3);
             Session["categorienr"] = 3;
             break;
         case "Sinister":
             movie = movie.getMovie("Sinister");
             info.InnerHtml += "Naam:" + movie.Name + ", Userscore: <font color=\"" + getColor(getAverage(1)) + "\">" + getAverage(1) + "</font>" + ", Metascore: <font color=\"" + getColor(movie.Metascore) + "\">" + movie.Metascore + "</font>";
             samenvatting.InnerHtml += movie.Resume;
             reviews.InnerHtml += getReviews(1);
             Session["categorienr"] = 1;
             break;
         case "Thedrop":
             movie = movie.getMovie("TheDrop");
             info.InnerHtml += "Naam:" + movie.Name + ", Userscore: <font color=\"" + getColor(getAverage(2)) + "\">" + getAverage(2) + "</font>" + ", Metascore: <font color=\"" + getColor(movie.Metascore) + "\">" + movie.Metascore + "</font>";
             samenvatting.InnerHtml += movie.Resume;
             reviews.InnerHtml += getReviews(2);
             Session["categorienr"] = 2;
             break;
         case "Dishonored":
             game = game.getGame("Dishonored");
             info.InnerHtml += "Naam:" + game.Name + ", Userscore: <font color=\"" + getColor(getAverage(4)) + "\">" + getAverage(4) + "</font>" + ", Metascore: <font color=\"" + getColor(game.Metascore) + "\">" + game.Metascore + "</font>";
             samenvatting.InnerHtml += game.Resume;
             reviews.InnerHtml += getReviews(4);
             Session["categorienr"] = 4;
             break;
         case "Power":
             show = show.getShow("Power");
             info.InnerHtml += "Naam:" + show.Name + ", Userscore: <font color=\"" + getColor(getAverage(5)) + "\">" + getAverage(5) + "</font>" + ", Metascore:<font color=\"" + getColor(show.Metascore) + "\">" + show.Metascore + "</font>";
             samenvatting.InnerHtml += show.Resume;
             reviews.InnerHtml += getReviews(5);
             Session["categorienr"] = 5;
             break;
         case "Scandal":
             show = show.getShow("Scandal");
             info.InnerHtml += "Naam:" + show.Name + ", Userscore: <font color=\"" + getColor(getAverage(6)) + "\">" + getAverage(6) + "</font>" + ", Metascore: <font color=\"" + getColor(show.Metascore) + "\">" + show.Metascore + "</font>";
             samenvatting.InnerHtml += show.Resume;
             reviews.InnerHtml += getReviews(6);
             Session["categorienr"] = 6;
             break;
         case "Blackmill":
             music = music.getMusic("Blackmill");
             info.InnerHtml += "Naam:" + music.Name + ", Userscore:<font color=\"" + getColor(getAverage(7)) + "\">" + getAverage(7) + "</font>" + ", Metascore: <font color=\"" + getColor(music.Metascore) + "\">" + music.Metascore + "</font>";
             samenvatting.InnerHtml += music.Resume;
             reviews.InnerHtml += getReviews(7);
             Session["categorienr"] = 7;
             break;
         case "Eminem":
             music = music.getMusic("Eminem");
             info.InnerHtml += "Naam:" + music.Name + ", Userscore: <font color=\"" + getColor(getAverage(8)) + "\">" + getAverage(8) + "</font>" + ", Metascore: <font color=\"" + getColor(music.Metascore) + "\">" + music.Metascore + "</font>";
             samenvatting.InnerHtml += music.Resume;
             reviews.InnerHtml += getReviews(8);
             Session["categorienr"] = 8;
             break;
     }
 }