private void BindCate() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DropCategory.DataSource = bll.GetAllList(); this.DropCategory.DataTextField = "Name"; DropCategory.DataValueField = "CategoryId"; DropCategory.DataBind(); }
private void BindCate() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DropCategory.DataSource = bll.GetAllList(); this.DropCategory.DataTextField = "Name"; DropCategory.DataValueField = "CategoryId"; DropCategory.DataBind(); }
private void BiudCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataSet ds = bll.GetAllList(); this.dropCategory.DataSource = ds.Tables[0].DefaultView; this.dropCategory.DataTextField = "Name"; this.dropCategory.DataValueField = "CategoryId"; this.dropCategory.DataBind(); }
private void BiudCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataSet ds = bll.GetAllList(); this.dropCategory.DataSource = ds.Tables[0].DefaultView; this.dropCategory.DataTextField = "Name"; this.dropCategory.DataValueField = "CategoryId"; this.dropCategory.DataBind(); }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataTable dt = bll.GetAllList().Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 bool menuExpand = true; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string ClassID = r["CategoryId"].ToString(); string ClassDesc = "<b>" + r["Name"].ToString() + "</b>"; string ParentId = r["ParentId"].ToString(); //string Orders = r["Orders"].ToString(); //string IsShow = r["IsShow"].ToString(); //if (IsShow == "false") //{ // ClassDesc = ""; //} //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = ClassDesc; rootnode.NodeData = ClassID; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; //rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(ClassID);// or =location CreateNode(sonparentid, rootnode, dt); } }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataTable dt = bll.GetAllList().Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 bool menuExpand = true; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string ClassID = r["CategoryId"].ToString(); string ClassDesc = "<b>" + r["Name"].ToString() + "</b>"; string ParentId = r["ParentId"].ToString(); //string Orders = r["Orders"].ToString(); //string IsShow = r["IsShow"].ToString(); //if (IsShow == "false") //{ // ClassDesc = ""; //} //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = ClassDesc; rootnode.NodeData = ClassID; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; //rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(ClassID);// or =location CreateNode(sonparentid, rootnode, dt); } }
private void ShowCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DataList1.DataSource = bll.GetAllList(); this.DataList1.DataBind(); }
private void ShowCategory() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); this.DataList1.DataSource = bll.GetAllList(); this.DataList1.DataBind(); }