Exemple #1
0
        public ActionResult ProductList(int CategoryId = 0, string CategoryName = "")
        {
            List <CategoryDropHomeResponse> catDropsHome = new List <CategoryDropHomeResponse>();

            if (Session["CatDrop"] != null)
            {
                catDropsHome = (List <CategoryDropHomeResponse>)Session["CatDrop"];
            }
            else
            {
                catDropsHome       = new CommonController().GetHomeDropdowns();
                Session["CatDrop"] = catDropsHome;
            }
            ViewBag.CatsDrop = catDropsHome;
            List <ServiceCategoriesResponse> serviceDrop = new List <ServiceCategoriesResponse>();

            if (Session["ServiceDrop"] != null)
            {
                serviceDrop = (List <ServiceCategoriesResponse>)Session["ServiceDrop"];
            }
            else
            {
                serviceDrop            = new CommonController().GetServiceCategories();
                Session["ServiceDrop"] = serviceDrop;
            }
            ViewBag.ServiceDrop = serviceDrop;

            List <Category>        SubCats    = new List <Category>();
            SubCategoryListRequest requestSub = new SubCategoryListRequest();

            requestSub.CategoryId = CategoryId;
            var apiResponse = _categoryManagementService.GetSubcategories(requestSub);

            SubCats = apiResponse.Response;


            ViewBag.SubCats      = SubCats;
            ViewBag.CategoryId   = CategoryId;
            ViewBag.CategoryName = CategoryName;

            return(View());
        }