Пример #1
0
        //初始化权限
        private void initAuthorityMenu()
        {
            listMenu = GridControlHelper.GetMenusData();
            string authority = Settings.Default.Authority;

            string[]      arr           = authority.Split(',');
            List <string> AuthorityName = listMenu.Where(c => arr.Contains(c.ID)).Select(c => c.MenuName).ToList <string>();


            foreach (NavBarGroup g in navBarControl1.Groups)
            {
                g.Visible = false;
                foreach (NavBarItemLink i in g.ItemLinks)
                {
                    if (AuthorityName.Contains(i.Caption))
                    {
                        i.Visible = true;
                        g.Visible = true;
                    }
                    else
                    {
                        i.Visible = false;
                    }
                }
            }
        }
Пример #2
0
        private void RoleForm_Load(object sender, EventArgs e)
        {
            htRole = GridControlHelper.GetRoleName("");
            htDept = GridControlHelper.GetDeptName("");
            string[] roleList = new string[htRole.Count + 1];
            roleList[0] = "";
            htRole.Values.CopyTo(roleList, 1);
            this.cbRole.Properties.Items.AddRange(roleList);
            listMenu = GridControlHelper.GetMenusData();

            ResfurbishData();
        }