Example #1
0
        public IActionResult Index(ProductUserSearchViewModel searchModel)
        {
            var serviceResult = _userService.GetProducts(searchModel.ToDto());

            if (!serviceResult.IsSuccess)
            {
                Swal(false, "دسته بندی یافت نشد");
                return(RedirectPermanent("/"));
            }
            ViewBag.CategoryName = serviceResult.Data.CategoryName;
            return(View_Search(searchModel, serviceResult.Data.Products.ToViewModel()));
        }
        public IActionResult Search(ProductUserSearchViewModel searchModel)
        {
            var data = _userService.SearchProducts(searchModel.ToDto());

            return(View_Search(searchModel, data.ToViewModel()));
        }