private void btnCopy_Click(object sender, EventArgs e)
        {
            PermissionScopes permissionScopes = new PermissionScopes();

            // 模块访问权限复制到剪切板
            for (int i = 0; i < this.cklstUser.CheckedItems.Count; i++)
            {
                BaseUserEntity userEntity = new BaseUserEntity(((System.Data.DataRowView) this.cklstUser.CheckedItems[i]).Row);
                this.GrantUsers += userEntity.Id.ToString() + ";";
            }
            string[] grantUserIds = this.GrantUsers.Split(';');
            permissionScopes.GrantUserIds = grantUserIds;

            for (int i = 0; i < this.cklstRole.CheckedItems.Count; i++)
            {
                BaseRoleEntity roleEntity = new BaseRoleEntity(((System.Data.DataRowView) this.cklstRole.CheckedItems[i]).Row);
                this.GrantRoles += roleEntity.Id.ToString() + ";";
            }
            string[] grantRoleIds = this.GrantRoles.Split(';');
            permissionScopes.GrantRoleIds = grantRoleIds;

            string[] grantOrganizeIds = this.GetGrantOrganizeIds();
            permissionScopes.GrantOrganizeIds = grantOrganizeIds;
            string[] grantModuleIds = this.GetGrantModuleIds();
            permissionScopes.GrantModuleIds = grantModuleIds;
            string[] grantPermissionIds = this.GetGrantPermissionIds();
            permissionScopes.GrantPermissionIds = grantPermissionIds;
            Clipboard.SetData("permissionScopes", permissionScopes);
            this.btnPaste.Enabled = true;
        }
        private void btnPaste_Click(object sender, EventArgs e)
        {
            object clipboardData = Clipboard.GetData("permissionScopes");

            if (clipboardData != null)
            {
                PermissionScopes permissionScopes = (PermissionScopes)clipboardData;
                string[]         grantUserIds     = permissionScopes.GrantUserIds;
                DotNetService.Instance.PermissionService.GrantRoleUserScopes(this.UserInfo, this.TargetRoleId, this.PermissionItemScopeCode, grantUserIds);
                string[] grantRoleIds = permissionScopes.GrantRoleIds;
                DotNetService.Instance.PermissionService.GrantRoleRoleScopes(this.UserInfo, this.TargetRoleId, this.PermissionItemScopeCode, grantRoleIds);
                string[] grantOrganizeIds = permissionScopes.GrantOrganizeIds;
                DotNetService.Instance.PermissionService.GrantRoleOrganizeScopes(this.UserInfo, this.TargetRoleId, this.PermissionItemScopeCode, grantOrganizeIds);
                string[] grantModuleIds = permissionScopes.GrantModuleIds;
                DotNetService.Instance.PermissionService.GrantRoleModuleScopes(this.UserInfo, this.TargetRoleId, this.PermissionItemScopeCode, grantModuleIds);
                string[] grantPermissionIds = permissionScopes.GrantPermissionIds;
                DotNetService.Instance.PermissionService.GrantRolePermissionItemScopes(this.UserInfo, this.TargetRoleId, this.PermissionItemScopeCode, grantPermissionIds);

                this.GetCurrentPermission();
            }
        }
        private void btnCopy_Click(object sender, EventArgs e)
        {
            PermissionScopes permissionScopes = new PermissionScopes();
            // 模块访问权限复制到剪切板
            for (int i = 0; i < this.cklstUser.CheckedItems.Count; i++)
            {
                BaseUserEntity userEntity = new BaseUserEntity(((System.Data.DataRowView)this.cklstUser.CheckedItems[i]).Row);
                this.GrantUsers += userEntity.Id.ToString() + ";";
            }
            string[] grantUserIds = this.GrantUsers.Split(';');
            permissionScopes.GrantUserIds = grantUserIds;

            for (int i = 0; i < this.cklstRole.CheckedItems.Count; i++)
            {
                BaseRoleEntity roleEntity = new BaseRoleEntity(((System.Data.DataRowView)this.cklstRole.CheckedItems[i]).Row);
                this.GrantRoles += roleEntity.Id.ToString() + ";";
            }
            string[] grantRoleIds = this.GrantRoles.Split(';');
            permissionScopes.GrantRoleIds = grantRoleIds;

            string[] grantOrganizeIds = this.GetGrantOrganizeIds();
            permissionScopes.GrantOrganizeIds = grantOrganizeIds;
            string[] grantModuleIds = this.GetGrantModuleIds();
            permissionScopes.GrantModuleIds = grantModuleIds;
            string[] grantPermissionIds = this.GetGrantPermissionIds();
            permissionScopes.GrantPermissionIds = grantPermissionIds;
            Clipboard.SetData("permissionScopes", permissionScopes);
            this.btnPaste.Enabled = true;
        }