예제 #1
0
        //return movie out the database
        public Movie getMovie(string movie)
        {
            string name = "";
            int metascore = 0;
            int userscore = 0;
            string resume = "";
            string genre = "";
            string director = "";
            int filmTime = 0;
            int rating = 0;
            foreach (Dictionary<string, object> D in db.getMovie(movie))
            {
                name = (string)D["naam"];
                metascore = Convert.ToInt32(D["metascore"]);
                userscore = Convert.ToInt32(D["userscore"]);
                resume = (string)D["samenvatting"];
                genre = (string)D["genre"];
                director = (string)D["director"];
                filmTime = Convert.ToInt32(D["filmtijd"]);
                rating = Convert.ToInt32(D["rating"]);
            }

            Movie newMovie = new Movie(metascore, userscore, name, genre, resume, director, rating, filmTime);
            return newMovie;
        }
예제 #2
0
 public void TestGetMovie()
 {
     Movie movie = new Movie(10, 10, "name", "genre", "resume", "director", 10, 10);
     movie = movie.getMovie("Sinister");
     Assert.AreEqual("Sinister", movie.Name, "Check if movie name is equal");
 }
예제 #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;
     }
 }