Esempio n. 1
0
    protected void btn_Sure_Click(object sender, EventArgs e)
    {
        List<string> funcList = GetAllSelectedTreeNodes();
        string roleCode = Request.QueryString["Code"].ToString();

        int re = new FunctionBLL().SetRole2Function(roleCode, funcList);
        if (re > 0)
        {
            UtilityService.Alert(this.Page,"设置完成!");
            LoadRoleFunction();
        }
        else
        {
            UtilityService.Alert(this.Page, "设置失败!");
        }
    }
Esempio n. 2
0
    protected void BindTreeView()
    {
        FunctionBLL bll = new FunctionBLL();
        IList<Function> list = bll.GetChildFunctionList("0",false);
        foreach (Function model in list)
        {
            string name = model.F_Name;
            string code = model.F_Code.ToString();
            TreeNode td = new TreeNode(name, code);

            td.SelectAction = TreeNodeSelectAction.None;
            td.Expanded = false;

            BindChildTree(td);
            tvModel.Nodes.Add(td);
        }
    }
Esempio n. 3
0
 private IList<Function> GetBindFuclist(string id)
 {
     int userType=Convert.ToInt32(Session["UserType"]);
     IList<Function> allChildFuc = new FunctionBLL().GetChildFunctionList(id, userType.Equals(100));
     /**************测试时关闭********************/
     IList<Function> bindFuc = new List<Function>();
     foreach (Function f in allChildFuc)
     {
         if (userFuc != null)
         {
             if (userFuc.FirstOrDefault<Function>(X => X.F_Code == f.F_Code) != null && f.F_Type == 0)
             {
                 bindFuc.Add(f);
             }
         }
     }
     return bindFuc;
     //return allChildFuc;
 }
Esempio n. 4
0
    protected void BindChildTree(TreeNode node)
    {
        string nodeid = node.Value;

        FunctionBLL bll = new FunctionBLL();
        IList<Function> list = bll.GetChildFunctionList(nodeid,false);
        if (list != null)
        {
            foreach (Function model in list)
            {
                string name = model.F_Name;
                string code = model.F_Code.ToString();
                TreeNode td = new TreeNode(name, code);
                td.SelectAction = TreeNodeSelectAction.None;
                td.Expanded = false;

                BindChildTree(td);
                node.ChildNodes.Add(td);

            }
        }
    }
Esempio n. 5
0
 protected void LoadRoleFunction()
 {
     FunctionBLL bll = new FunctionBLL();
     List<string> list = bll.GetRole2Function(Request.QueryString["Code"].ToString());
     foreach (TreeNode node in this.tvModel.Nodes)
     {
         SetCheckedNodes(node,list);
     }
 }