예제 #1
0
        public IActionResult SearchByCategory(int id)
        {
            List <Product> products = _temp.GetProducts(id);

            Category category = _temp.GetCategory(id);

            List <Category> categories = _temp.GetCategoryById(Convert.ToInt32(category.ParentId));

            Category parentCategory = _temp.GetCategory(Convert.ToInt32(category.ParentId));

            List <Store> stores = _temp.GetStores(id);

            var viewmodel = new SearchCategoryViewModel();

            viewmodel.FillCategories     = categories;
            viewmodel.FillProducts       = products;
            viewmodel.FillParentCategory = parentCategory;
            viewmodel.FillSelectCategory = category;
            viewmodel.FillStores         = stores;

            return(View(viewmodel));
        }