protected override Expression <Func <ProductCategory, bool> > GetExpression() { if (!string.IsNullOrWhiteSpace(Keyword)) { ExpressionObj = x => x.Name.ToLower().Contains(Keyword); } if (ProductGroupId.IdIsOk()) { ExpressionObj = ExpressionObj.And(x => x.ProductGroupId == ProductGroupId); } if (IsProductCategoryActive) { ExpressionObj = ExpressionObj.And(x => x.IsActive == IsProductCategoryActive); } ExpressionObj = ExpressionObj.And(x => x.ShopId == ShopId); ExpressionObj = ExpressionObj.And(GenerateBaseEntityExpression()); return(ExpressionObj); }
protected void treeProductGroup_SelectedNodeChanged(object sender, EventArgs e) { ProductGroupId = Convert.ToInt32(treeProductGroup.SelectedNode.Value.Substring(1)); SetFilter(ProductGroupId, IncludeChilds); ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId); if (pgi != null && pgi.ProductListTabId != -1) { Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString())); } else { int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString()); Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString())); } }
protected void ddl_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = sender as DropDownList; ProductGroupId = Convert.ToInt32(ddl.SelectedValue); int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString()); if (ProductGroupId == -1) { Controller.DeleteProductFilter(PortalId, FilterSessionId, "ProductGroup"); Response.Redirect(Globals.NavigateURL(dynamicTab)); } SetFilter(ProductGroupId, IncludeChilds); ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId); if (pgi != null && pgi.ProductListTabId != -1) { Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString())); } else { Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString())); } }
protected void lstProductGroups_SelectedIndexChanging(object sender, ListViewSelectEventArgs e) { ProductGroupId = (int)lstProductGroups.DataKeys[e.NewSelectedIndex].Value; SetFilter(ProductGroupId, IncludeChilds); ProductGroupInfo pgi = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId); if (pgi != null && pgi.ProductListTabId != -1) { Response.Redirect(Globals.NavigateURL(pgi.ProductListTabId, "", "productgroup=" + ProductGroupId.ToString())); } else { int dynamicTab = Convert.ToInt32(Settings["DynamicPage"] ?? TabId.ToString()); Response.Redirect(Globals.NavigateURL(dynamicTab, "", "productgroup=" + ProductGroupId.ToString())); } }