Пример #1
0
        public ActionResult FastAddActivityToSesWishlist(int activityType)
        {
            try
            {
                string action;
                switch (activityType)
                {
                case 1:
                    action           = "Films";
                    ViewBag.ActionId = new SelectList(wishListRepo.getFilms(), "id", "title", null);
                    break;

                case 2:
                    action           = "Specials";
                    ViewBag.ActionId = new SelectList(wishListRepo.getSpecials(), "id", "title", null);
                    break;

                case 3:
                    action = "Restaurants";
                    break;

                default:
                    ViewBag.errors = "Activiteitttype niet herkent";
                    return(View("Index", GetActivitiesFromSession()));
                }
                EditActivityViewModel viewModel = new EditActivityViewModel(action);
                return(PartialView(viewModel));
            }
            catch
            {
                ViewBag.errors = "Wishlistitem niet gevonden";
            }

            ViewBag.errors = "Wishlistitem niet gevonden";
            return(View("Index", GetActivitiesFromSession()));
        }