public ActionResult AddToProgramme(string idstr) { idstr = idstr.Replace("pr-", ""); int id = int.Parse(idstr); SessionBesteldeItem r = productRepository.GetSessionBesteldeItem(id); r.Zaal13_Codes = "3"; r.PersonalProgrammeOrShoppingCart = 1; productsSession = (List <SessionBesteldeItem>)HttpContext.Session["products"]; productsSession.Add(r); HttpContext.Session["products"] = productsSession; return(Json(id, JsonRequestBehavior.AllowGet)); }
public SessionBesteldeItem GetSessionBesteldeItem(int productId) { SessionBesteldeItem product = new SessionBesteldeItem(); if (productId > 6) { product.Film = GetFilmForSession(productId); product.Product = productId; product.SoortProduct = 1; } else { product.Restaurant = GetRestaurant(productId); product.Product = productId; product.SoortProduct = 2; } return(product); }
public ActionResult AddEventToCart(string idstr) { string productId = idstr.Replace("pr-", ""); int id = int.Parse(productId); productsSession = (List <SessionBesteldeItem>)HttpContext.Session["products"]; SessionBesteldeItem r = productRepository.GetSessionBesteldeItem(id); r.PersonalProgrammeOrShoppingCart = 2; // productsSession.Add(r); HttpContext.Session["products"] = productsSession; return(Json(id, JsonRequestBehavior.AllowGet)); }