public void DelettAllRoleRes()
        {
            if (nTreeListView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("请选择要删除的节点!");
                return;
            }
            if (nTreeListView1.SelectedIndices[0] == 0)
            {
                MessageBox.Show("不可以删除根节点!");
                return;
            }
            if (MessageBox.Show("是否要删除该节点?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            if (nTreeListView1.SelectedItems[0].Items.Count > 0)
            {
                if (MessageBox.Show("删除节点,将删除其下属节点,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }
            }

            PrivilegeService _proxy = Common.Util.CreateProxy();

            using (_proxy as IDisposable)
            {
                List <RoleResourceMapping> deleteList = GetALLItem(nTreeListView1.SelectedItems[0]);
                if (deleteList == null)
                {
                    deleteList = new List <RoleResourceMapping>();
                }
                deleteList.Add(nTreeListView1.SelectedItems[0].Tag as RoleResourceMapping);
                try
                {
                    FrameWork.Management.PublicTrans.BeginTransaction();
                    _proxy.DeleteRoleResource(deleteList);
                    FrameWork.Management.PublicTrans.Commit();
                }
                catch (Exception e)
                {
                    FrameWork.Management.PublicTrans.RollBack();
                    throw e;
                }
            }

            LoadRoleResource();
        }
        public void DelettRoleRes()
        {
            if (nTreeListView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("请选择要删除的节点!");
                return;
            }
            if (nTreeListView1.SelectedIndices[0] == 0)
            {
                MessageBox.Show("不可以删除根节点!");
                return;
            }
            if (MessageBox.Show("是否要删除该节点?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            PrivilegeService _proxy = Common.Util.CreateProxy();

            using (_proxy as IDisposable)
            {
                List <RoleResourceMapping> deleteList = GetALLItem(nTreeListView1.SelectedItems[0]);
                if (deleteList == null)
                {
                    try
                    {
                        FrameWork.Management.PublicTrans.BeginTransaction();
                        _proxy.DeleteRoleResource(nTreeListView1.SelectedItems[0].Tag as RoleResourceMapping, ChildList);
                        FrameWork.Management.PublicTrans.Commit();
                    }
                    catch (Exception e)
                    {
                        FrameWork.Management.PublicTrans.RollBack();
                        throw e;
                    }
                }
                else
                {
                    MessageBox.Show("请删除其子节点后再删除该节点!");
                    return;
                }
            }

            AuthorizeResourceControl_Load(null, null);
        }