private void BindChildTree(TreeNodeCollection TNC, int SuperID) { IList <BBS_Board> _list = BBS_BoardBLL.GetModelList(" Catalog= " + SuperID.ToString()); foreach (BBS_Board _m in _list) { bool flag = false; IList <BBS_BoardUserMember> userList = new BBS_BoardUserMemberBLL()._GetModelList(" Board=" + _m.ID); if (userList != null) { foreach (BBS_BoardUserMember user in userList) { if (user.UserName == (string)Session["UserName"]) { flag = true; } } } if (_m.IsPublic == "1" || (_m.IsPublic == "2" && flag)) { TreeNode tn = new TreeNode(); tn.Text = _m.Name; tn.Value = _m.ID.ToString(); TNC.Add(tn); } } }
private int BindChildTree(TreeNodeCollection TNC, int SuperID) { int isExpanded = 0; BBS_BoardBLL boardbll = new BBS_BoardBLL((int)ViewState["Board"]); string selectName = boardbll.Model.Name.ToString(); IList <BBS_Board> _list = BBS_BoardBLL.GetModelList(" Catalog= " + SuperID.ToString()); foreach (BBS_Board _m in _list) { bool flag = false; IList <BBS_BoardUserMember> userList = new BBS_BoardUserMemberBLL()._GetModelList(" Board=" + _m.ID); foreach (BBS_BoardUserMember user in userList) { if (user.UserName == (string)Session["UserName"]) { flag = true; } } if (_m.IsPublic == "1" || (_m.IsPublic == "2" && flag)) { TreeNode tn = new TreeNode(); tn.Text = _m.Name; if (selectName.Equals(_m.Name) == true) { tn.Selected = true; isExpanded = 1; } tn.Value = _m.ID.ToString(); TNC.Add(tn); } } return(isExpanded); }
private void BindBSS() { string boards = ConfigHelper.GetConfigString("BBSBoard"); //获取要查询的板块 if (string.IsNullOrEmpty(boards)) { return; } dl_Board.DataSource = BBS_BoardBLL.GetModelList("ID IN (" + boards + ")"); dl_Board.DataBind(); return; }
private void BindGrid() { dll_Board.DataSource = BBS_BoardBLL.GetModelList(""); dll_Board.DataBind(); dll_Board.Items.Insert(0, new ListItem("全部", "0")); }