void RenderJsonData() { List <ProductCategory> pcs = ProductCategories.GetCategoreisByProductID(productID); StringBuilder sb1 = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); foreach (ProductCategory pc in pcs) { sb1.AppendFormat("[{0}]:", pc.CategoryID); sb2.AppendFormat(catHtml, pc.CategoryID, pc.CategoryName); } hfCategories.Value = sb1.ToString(); hfCatHTML.Value = sb2.ToString(); sb1 = new StringBuilder(); sb2 = new StringBuilder(); List <ProductIndustry> pis = ProductIndustries.GetIndustriesByProductID(productID); foreach (ProductIndustry pi in pis) { sb1.AppendFormat("[{0}]:", pi.IndustryID); sb2.AppendFormat(indHtml, pi.IndustryID, pi.IndustryName); } hfIndustries.Value = sb1.ToString(); hfIndHTML.Value = sb2.ToString(); }
private bool CheckSelected(TreeNode tn) { List <ProductCategory> selectedCategories = ProductCategories.GetCategoreisByProductID(productID); foreach (ProductCategory category in selectedCategories) { if (category.CategoryID.ToString() == tn.Value) { return(true); } } return(false); }
List <ProductCategory> GetCategories(int pId) { return(ProductCategories.GetCategoreisByProductID(pId)); }