예제 #1
0
        public ActionResult GetSavedWishlist(string wislistToken)
        {
            Wishlists wishlist = wishListRepo.getWishList(wislistToken);

            if (wishlist == null)
            {
                ViewBag.errors = "Code niet gevonden";
                return(View("Index", GetActivitiesFromSession()));
            }
            Session["wishlist"] = wishlist;
            IEnumerable <WishlistViewModel> activities = wishListRepo.GetActivities(wishlist);

            if (activities.Count() < 1)
            {
                ViewBag.errors = "Code niet gevonden";
                return(View("Index", GetActivitiesFromSession()));
            }
            foreach (var activity in activities)
            {
                AddActivityToSesWishlist(activity.NumberOfPersons, activity.Activity);
            }
            ViewBag.succes = "Wishslist geladen";

            return(View("Index", GetActivitiesFromSession()));
        }