Ejemplo n.º 1
0
        protected void LoadTree(Ext.Net.NodeCollection rootNode, string userID)
        {
            if (rootNode == null)
            {
                rootNode = new Ext.Net.NodeCollection();
            }
            rolefunMgr rolefunMgr = new rolefunMgr();

            TreePanel1.GetRootNode().RemoveAll();
            TreePanel1.GetRootNode().AppendChild(rolefunMgr.GetAllFun(3, Request.Cookies["Userinfo"]["role"].ToString().Trim()));
            TreePanel1.GetRootNode().Expand(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取用户角色功能菜单树
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void NodeLoad(object sender, NodeLoadEventArgs e)
 {
     if (e.NodeID == "root")
     {
         rolefunMgr rolefunMgr = new rolefunMgr();
         if (Request.Cookies["Userinfo"]["role"] != null && Request.Cookies["Userinfo"]["role"].ToString().Trim().Length > 0)
         {
             e.Nodes = rolefunMgr.GetMenu(3, Request.Cookies["Userinfo"]["role"].ToString().Trim());
         }
         string sql = "select privilege from UserInfor where UserID=" + Request.Cookies["Userinfo"]["UserID"].ToString().Trim();
         if (DbHelperSQL.FindTable(2, sql).Rows[0][0].ToString().Length > 0)//判断该用户是否有已购买的功能模块
         {
             exampleTree.GetRootNode().AppendChild(rolefunMgr.GetPaidFun(2, Request.Cookies["Userinfo"]["UserID"].ToString().Trim()));
         }
     }
 }