private void GetByKeywordAndBaseCategory() { if (!string.IsNullOrEmpty(Request.QueryString["k"]) && !string.IsNullOrEmpty(Request.QueryString["bc"])) { string keyword = Business.Encryption.Encryption64.Decrypt(Request.QueryString["k"], "12345678").Replace("+"," "); int baseCatId = Convert.ToInt32(Business.Encryption.Encryption64.Decrypt(Request.QueryString["bc"], "!#$a54?3")); if (baseCatId != 0) { CategoryEntity category = new CategoryAdapter().GetCategoryById(baseCatId); BaseCategoryNameLabel.Text = category.Name; CategoryNameLabel.Text = keyword; SubCategoriesRepeater.DataSource = new CategoryAdapter().GetSubCategories(baseCatId); SubCategoriesRepeater.DataBind(); ProductListRepeater.DataSource = new ProductAdapter().GetProductsByKeywordAndBaseCatId(keyword, baseCatId); ProductCollection productList = (ProductCollection)ProductListRepeater.DataSource; Session["ProductList"] = productList; ProductListRepeater.DataBind(); } else { BaseCategoryNameLabel.Text = keyword; CategoryNameLabel.Text = keyword; ProductCollection products = new ProductAdapter().GetProductsByKeyword(keyword); Session["ProductList"] = products; //Disable CategorySlider SubCategoriesRepeater.Visible = false; ProductListRepeater.DataSource = products; ProductListRepeater.DataBind(); } } else Response.Redirect("~/Default.aspx"); }
private void GetBySubCategoryId() { if (!string.IsNullOrEmpty(Request.QueryString["c"])) { int subCatId = Convert.ToInt32(Business.Encryption.Encryption64.Decrypt(Request.QueryString["c"], "!#$a54?3")); CategoryEntity category = new CategoryAdapter().GetCategoryById(subCatId); BaseCategoryNameLabel.Text = category.Category.Name; CategoryNameLabel.Text = category.Name; SubCategoriesRepeater.DataSource = new CategoryAdapter().GetRelatedSubCategories(subCatId); SubCategoriesRepeater.DataBind(); ProductListRepeater.DataSource = new ProductAdapter().GetProductsByCategoryId(subCatId); ProductCollection productList = (ProductCollection)ProductListRepeater.DataSource; Session["ProductList"] = productList; ProductListRepeater.DataBind(); } else Response.Redirect("~/Default.aspx"); }
private void LoadData() { CategoryAdapter categoryAdapter = new CategoryAdapter(); BaseCategoryListRepeater.DataSource = categoryAdapter.GetMainCategories(); BaseCategoryListRepeater.DataBind(); }