public void ModifyRoleRes()
        {
            if (nTreeListView1.SelectedIndices.Count == 0)
            {
                return;
            }
            if (nTreeListView1.SelectedIndices[0] == 0)
            {
                return;
            }
            currentRoleResource = nTreeListView1.SelectedItems[0].Tag as RoleResourceMapping;
            AddAuthorizeForm updateAuthorizeForm = new AddAuthorizeForm(currentRole, parentRole, currentRoleResource, pageJudge, "UpdateRes");

            updateAuthorizeForm.ShowDialog();
            if (updateAuthorizeForm.DialogResult == DialogResult.OK)
            {
                LoadRoleResource();
            }
        }
        public void AddRoleRes()
        {
            if (nTreeListView1.ItemsCount == 0 || nTreeListView1.SelectedItems.Count == 0)
            {
                //设置默认根节点
                currentRoleResource             = new RoleResourceMapping();
                currentRoleResource.ParentId    = "root";
                currentRoleResource.Id          = "root";
                currentRoleResource.OrderNumber = 0;
                currentRoleResource.ValidState  = "1";
            }
            else
            {
                currentRoleResource = nTreeListView1.SelectedItems[0].Tag as RoleResourceMapping;
            }

            AddAuthorizeForm addAuthorizeForm = new AddAuthorizeForm(currentRole, parentRole, currentRoleResource, pageJudge);

            addAuthorizeForm.ShowDialog();
            if (addAuthorizeForm.DialogResult == DialogResult.OK)
            {
                AuthorizeResourceControl_Load(null, null);
            }
        }