📄 roleusercontrol.ascx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Office.Model;
using Office.BLL;
public partial class SysManage_RoleUserControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
DisplayRoleRightMenu();
}
//显示角色菜单信息
protected void DisplayRoleRightMenu()
{
//得到父节点的值
int nodeId = int.Parse(hidParentMenu.Value);
//得到角色权限ID
int roleId = int.Parse(hidRoleId.Value);
ArrayList arrRoleChildMenu = new ArrayList();
//根据角色ID和父节点ID得到ROLERIGHT表中已经存在的子菜单信息
IList<RoleRight> roleChildRights = RoleRightManager.GetRoleRightByRoleIdAndParentNodeId(roleId, nodeId);
//将子节点存放进数组里面
foreach (RoleRight roleRight in roleChildRights)
{
arrRoleChildMenu.Add(roleRight.Node.NodeId.ToString());
}
IList<SysFun> sysFuns = SysFunManager.GetSysFunByParentNodeId(nodeId);
foreach (SysFun sysFun in sysFuns)
{
ListItem li = new ListItem();
li.Value = sysFun.NodeId.ToString();
li.Text = sysFun.DisplayName;
if (arrRoleChildMenu.Contains(li.Value))
li.Selected = true;
chkChildMenu.Items.Add(li);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -