public ActionResult Brands(int id, ShopModel m) //Sadece ProductsManager ile yapıldı { if (BrandsFilter == null) { BrandsFilter = new List <int>(); } //if (m.BrandsFilter == null) //{ // m.BrandsFilter = new List<Brands>(); //} ProductsManager pm = new ProductsManager(); BrandsManager bm = new BrandsManager(); BrandsFilter.Add(id); //m.marka.Add(bm.Single(id).BrandName); //m.BrandsFilter.Add(bm.Single(id)); //m.BrandsFilter = bm.GetAll().Where(x => x.BrandID == id).ToList(); //Session["BrandsFilter"] = BrandsFilter; //foreach (var item in m.BrandsFilter) //{ // m.BrandsFilter.Add(bm.Single(id)); //} m.plist = pm.GetAll().Where(x => BrandsFilter.Contains(x.BrandID)).ToList(); Session["Products"] = m.plist; return(RedirectToAction("Shop", "Shop", m)); }
// GET: Home public ActionResult Index() { CategoriesManager cm = new CategoriesManager(); ProductsManager pm = new ProductsManager(); BrandsManager bm = new BrandsManager(); ColorManager colm = new ColorManager(); SizeManager sm = new SizeManager(); ProductCategoriesManager pcm = new ProductCategoriesManager(); ProductColorsManager pcolm = new ProductColorsManager(); ProductSizesManager pszm = new ProductSizesManager(); BasketManager basm = new BasketManager(); BasketDetailManager bdm = new BasketDetailManager(); BasketTempManager btm = new BasketTempManager(); ParamManager parm = new ParamManager(); Session["Categories"] = cm.GetAll(); Session["Products"] = pm.GetAll(); Session["Brands"] = bm.GetAll(); Session["Colors"] = colm.GetAll(); Session["Sizes"] = sm.GetAll(); Session["ProductCategories"] = pcm.GetAll(); Session["ProductColorsManager"] = pcolm.GetAll(); Session["ProductSizesManager"] = pszm.GetAll(); Session["Basket"] = basm.GetAll(); Session["BasketDetail"] = bdm.GetAll(); Session["BasketTemp"] = btm.GetAll(); Session["Param"] = parm.GetAll(); baskettlist = btm.GetAll();; ViewBag.Login = "******"; ViewBag.Logout = "Logout"; return(View()); }