Пример #1
0
        public IActionResult Survey(SurveyFormVM vm)
        {
            if (!ModelState.IsValid)
            {
                foreach (Park park in ParkDAO.GetAllParks())
                {
                    SelectListItem item = new SelectListItem(park.ParkName, park.ParkCode);
                    vm.Parks.Add(item);
                }
                return(View(vm));
            }
            ParkDAO.AddSurvey(vm.Survey);

            return(RedirectToAction("Favorites"));
        }