标题:asp.net 读代码
取消只看楼主
洗洗梦晨
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2016-6-23
结帖率:0
已结贴  问题点数:20 回复次数:0 
asp.net 读代码
protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["UsersId"] != null)
                {
                    BLL.Users users = new BLL.Users();
                    Model.Users user = users.GetModel((int)Session["UsersId"]);
                    BLL.Roles roles =new BLL.Roles();
                    Model.Roles role = roles.GetModel(user.Fk_Roles_Id.Value);
                    BLL.PermisssionsNodes permisssionsNodes = new BLL.PermisssionsNodes();

                    List<Model.PermisssionsNodes> permisssionsNodesList = permisssionsNodes.GetModelList("Fk_Permissions_Id='" + role.Fk_Permissions_Id + "'");
                    List<Model.Nodes> nodes = new List<Model.Nodes>();
                    foreach (Model.PermisssionsNodes pn in permisssionsNodesList)
                    {
                        BLL.Nodes nodesBLL = new BLL.Nodes();
                        Model.Nodes node = nodesBLL.GetModel(pn.Fk_Nodes_Id.Value);
                        if (node != null)
                        {
                            if (node.ParentId == 0 && node.IsVisible == true)
                            {
                                nodes.Add(node);
                            }
                        }
                    }
                    Repeater1.DataSource = nodes.OrderBy(p=>p.Orders).ToList();
                    Repeater1.DataBind();
搜索更多相关主题的帖子: null 
2016-06-23 23:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-466300-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.161450 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved