Пример #1
0
        public ActionResult KiesLand(Leerling leerling, Continent continent, KlimatogramKiezenLandViewModel kVM)
        {
            if (!ModelState.IsValid)
            {
                return(null);
            }
            Land land = continent.GeefLand(kVM.Land);

            if (land != null && (kVM.Land == null || !land.HeeftKlimatogrammen()))
            {
                TempData["Error"] = "Er zijn geen gegevens beschikbaar voor het geselecteerde land.";
                return(JavaScript("window.location = '" + Url.Action("Index") + "'"));
            }
            if (HttpContext != null && HttpContext.Session != null)
            {
                HttpContext.Session["land"] = land;
            }
            return(PartialView("_KiesLocatie", new KlimatogramKiezenLocatieViewModel(land.Klimatogrammen)));
        }