protected Genre GetGenreFromDataReader(MySqlDataReader dataReader)
        {
            string genreNaam = dataReader.GetString("genrenaam");
            int genreId = dataReader.GetInt32("genre_id");
            bool verslavend = dataReader.GetBoolean("verslavend");
            Genre genre = new Genre { ID = genreId,Naam = genreNaam, Verslavend = verslavend};

            return genre;
        }
        public ActionResult CreateGenreModelBinding(Genre genre)
        {
            try
            {
                genreDBController.InsertGenre(genre);

            }
            catch (Exception e)
            {
                ViewBag.Foutmelding = "Er is iets fout gegaan:" + e;
            }
            return RedirectToAction("Index", "Genre");
        }
 public ActionResult CreateGenreParameterBinding(String name, String verslavend)
 {
     bool isVerslavend = verslavend == "on";
     Genre genre = new Genre { Naam = name, Verslavend = isVerslavend };
     try
     {
         genreDBController.InsertGenre(genre);
     }
     catch (Exception e)
     {
         ViewBag.Foutmelding = "Er is iets fout gegaan:" + e;
     }
     return RedirectToAction("Index", "Genre");
 }
        public ActionResult CreateGenreOldSchool()
        {
            String name = Request["name"];
            bool verslavend = Request["verslavend"] == "on";
            Genre genre = new Genre { Naam = name, Verslavend = verslavend };
            try
            {
                genreDBController.InsertGenre(genre);
            }
            catch (Exception e)
            {
                ViewBag.Foutmelding = "Er is iets fout gegaan:" + e;
            }

            return RedirectToAction("Index", "Genre");
        }
        public ActionResult NieuwGame()
        {
            try
            {
                GameViewModel viewModel = new GameViewModel();

                List<Genre> genres = genreDBController.GetGenres();
                Genre emptyGenre = new Genre();
                emptyGenre.ID = -1;
                emptyGenre.Naam = "";
                genres.Insert(0, emptyGenre);

                viewModel.Genres = new SelectList(genres, "ID", "Naam");
                return View(viewModel);
            }
            catch (Exception e)
            {
                ViewBag.FoutMelding = "Er is iets fout gegaan: " + e;
                return View();
            }
        }
        private SelectList getSelectListGenres()
        {
            List<Genre> genres = genreDBController.GetGenres();
            Genre emptyGenre = new Genre();
            emptyGenre.ID = -1;
            emptyGenre.Naam = "";
            genres.Insert(0, emptyGenre);

            return new SelectList(genres, "ID", "Naam");
        }
        public ActionResult WijzigGenre(Genre genre)
        {
            try
            {
                genreDBController.UpdateGenre(genre);

            }
            catch (Exception e)
            {
                ViewBag.FoutMelding("Er is iets fout gegaan: " + e);

            }
            return RedirectToAction("Index", "Genre");
        }