public ActionResult BrandSelect(int carBrandId, string parentUrl, string parentName)
        {
            var helperPage = new helperBrandSelectProductList();

            var carBrand = db.tbl_carBrand.Include("tbl_carModel").Where(a => a.carBrandId == carBrandId).FirstOrDefault();

            helperPage.breadCrumbItem = getBrandSelectBreadCrumbProductList(parentName, parentUrl, carBrand.name);
            helperPage.header = carBrand.name;

            if (!string.IsNullOrEmpty(carBrand.title))
            {
                helperPage.header = carBrand.title;
            }

            helperPage.brandWithModelList = getBrandWithModelList(carBrand, parentUrl, null);

            //productList
            var productListWithBrandId = db.tbl_product.Include("tbl_stock").Include("tbl_gallery").Include("tbl_carModelProduct.tbl_carModel.tbl_carBrand").Where(a => a.statu && a.isDeleted == false && a.tbl_stock.Any(b => b.stockCount > 0) && a.tbl_carModelProduct.Any(c => c.tbl_carModel != null) && a.tbl_carModelProduct.Any(c => c.tbl_carModel != null) && a.tbl_carModelProduct.Any(c => c.tbl_carModel.tbl_carBrand != null) && a.tbl_carModelProduct.All(c => c.tbl_carModel.tbl_carBrand.carBrandId == carBrandId) && a.langId == langId).OrderBy(a => a.sequence).ToList();

            productShared pc = new productShared(db);
            int productCount = productListWithBrandId.Count;
            int currentPage = pc.getCurrentPage(Request, productCount, 6);
            helperPage.pagingItem = pc.getPageItem(productCount, currentPage, 6, "?sayfa=");

            helperPage.productList = pc.getProductSummary(parentUrl, productListWithBrandId.Skip((currentPage - 1) * 6).Take(6).ToList(), langCulture, langCode, "240", "160");

            // Title
            var settingItem = db.tbl_settings.Where(a => a.langId == langId).FirstOrDefault();
            if (settingItem != null)
            {
                helperPage.setBrowserTitle(helperPage.header + settingItem.allPageTitle);
            }

            return View(helperPage);
        }
        public ActionResult Index(int pageId)
        {
            if (Request.QueryString["keyWord"] == null)
            {
                return null;
            }

            string searchWord = Request.QueryString["keyWord"];

            helperSearch helperItem = new helperSearch();
            pageShared ps = new pageShared(db);
            productShared pc = new productShared(db);

            var searchPage = ps.getPageByType(pageType.search, langId);
            helperItem.searchLink = Url.Content("~/") + langCode + "/" + searchPage.url + ".html";

            var item = db.tbl_page.Include("tbl_category").Where(a => a.pageId == pageId).FirstOrDefault();

            if (item == null)
            {
                return null;
            }

            helperItem.breadCrumbItem = getBreadCrumbStaticPage(item.name);
            helperItem.setTitle(item.name);
            helperItem.detail = item.detail;

            //Title
            ps.pageTitleBind(item, helperItem, langId);

            //string pattern = getPatternBySearchWord(searchWord);
            helperItem.searchWord = searchWord;

            //helperItem.searchList = new List<searchResultItem>();
            helperItem.searchList = getSearchResultList(searchWord);

            if (helperItem.searchList.Count > 0)
            {
                helperItem.resultFound = string.Format(App_GlobalResources.lang.totalResultFound, helperItem.searchList.Count);
            }
            else
            {
                helperItem.resultFound = App_GlobalResources.lang.noResultFound;
            }

            int productCount = helperItem.searchList.Count;
            int currentPage = pc.getCurrentPage(Request, productCount, 10);
            helperItem.pagingItem = pc.getPageItem(productCount, currentPage, 10, "?keyWord=" + searchWord + "&sayfa=");
            helperItem.searchList = helperItem.searchList.Skip((currentPage - 1) * 10).Take(10).ToList();
            helperItem.searchKeyWordList = Newtonsoft.Json.JsonConvert.SerializeObject(getSearchKeywordList(searchWord));

            return View(helperItem);
        }
        public ActionResult Index(int pageId)
        {
            var helperPage = new helperProductList();

            // mainProductUrl
            pageShared ps = new pageShared(db);
            var item = ps.getPageById(pageId);

            helperPage.breadCrumbItem = getIndexBreadCrumbProductList(item.name);
            helperPage.header = item.name;

            var newProductList = db.tbl_product.Include("tbl_stock").Include("tbl_gallery").Include("tbl_carModelProduct.tbl_carModel.tbl_carBrand").Where(a => a.statu && a.isDeleted == false && a.tbl_stock.Any(b => b.stockCount > 0) && a.tbl_carModelProduct.Any(c => c.tbl_carModel != null) && a.tbl_carModelProduct.Any(c => c.tbl_carModel != null) && a.tbl_carModelProduct.Any(c => c.tbl_carModel.tbl_carBrand != null) && a.langId == langId).OrderByDescending(a => a.sequence).ToList();

            productShared pc = new productShared(db);

            int productCount = newProductList.Count;
            int currentPage = pc.getCurrentPage(Request, productCount, 6);
            helperPage.pagingItem = pc.getPageItem(productCount, currentPage, 6, "?sayfa=");

            helperPage.productList = pc.getProductSummary(item.url, newProductList.Skip((currentPage - 1) * 6).Take(6).ToList(), langCulture, langCode, "240", "160");

            // Title
            ps.pageTitleBind(item, helperPage, langId);

            return View(helperPage);
        }