/// <summary>
        /// 批量移动
        /// </summary>
        private void BatchMove()
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                return;
            }
            var frmOrganizeSelect = new FrmOrganizeSelect(this.ParentEntityId, this.chkInnerOrganize.Checked);

            if (UserInfo.IsAdministrator)
            {
                frmOrganizeSelect.AllowNull = true;
            }
            else
            {
                frmOrganizeSelect.AllowNull           = false;
                frmOrganizeSelect.PermissionScopeCode = this.PermissionItemScopeCode;
            }
            frmOrganizeSelect.OnButtonConfirmClick += new BusinessLogic.CheckMoveEventHandler(CheckInputMove);
            if (frmOrganizeSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor     = Cursors.WaitCursor;
            this.FormLoaded = false;
            RDIFrameworkService.Instance.OrganizeService.BatchMoveTo(UserInfo, this.GetSelecteIds(), frmOrganizeSelect.SelectedId);
            //if ((SystemInfo.ClientCache) && (this.chkRefresh.Checked))
            //{
            //    ClientCache.Instance.DTOrganize = null;
            //}
            this.ParentEntityId = frmOrganizeSelect.SelectedId;
            // 调用事件
            var tags = this.GetSelecteIds();

            RDIFrameworkService.Instance.OrganizeService.BatchMoveTo(UserInfo, tags, frmOrganizeSelect.SelectedId);
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvOrganize, frmOrganizeSelect.SelectedId);
            var parentNode = BasePageLogic.TargetNode;

            if (tags.Length > 0)
            {
                foreach (string tmpTag in tags)
                {
                    BasePageLogic.FindTreeNode(this.tvOrganize, tmpTag);
                    BasePageLogic.MoveTreeNode(this.tvOrganize, BasePageLogic.TargetNode, parentNode);
                }
            }
            // 绑定grdOrganize
            this.GetOrganizeList();
            if (this.DTOrganizeList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
            }
            this.FormLoaded = true;
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }
        /// <summary>
        /// 单个记录移动
        /// </summary>
        public void SingleMove()
        {
            if (String.IsNullOrEmpty(this.ParentEntityId))
            {
                return;
            }
            var frmOrganizeSelect = new FrmOrganizeSelect(this.ParentEntityId, this.chkInnerOrganize.Checked);

            if (UserInfo.IsAdministrator)
            {
                frmOrganizeSelect.AllowNull = true;
            }
            else
            {
                frmOrganizeSelect.AllowNull           = false;
                frmOrganizeSelect.PermissionScopeCode = this.PermissionItemScopeCode;
            }
            frmOrganizeSelect.OnButtonConfirmClick += new BusinessLogic.CheckMoveEventHandler(CheckInputMove);
            if (frmOrganizeSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor     = Cursors.WaitCursor;
            this.FormLoaded = false;
            RDIFrameworkService.Instance.OrganizeService.MoveTo(UserInfo, this.CurrentEntityId, frmOrganizeSelect.SelectedId);
            if (!SystemInfo.ClientCache)
            {
                ClientCache.Instance.DTOrganize = null;
            }
            this.FormLoaded = false;
            //if ((SystemInfo.ClientCache) && (this.chkRefresh.Checked))
            //{
            //    ClientCache.Instance.DTOrganize = null;
            //}
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvOrganize, frmOrganizeSelect.SelectedId);
            BasePageLogic.MoveTreeNode(this.tvOrganize, this.tvOrganize.SelectedNode, BasePageLogic.TargetNode);
            // 绑定grdOrganize
            this.GetOrganizeList();
            if (this.DTOrganizeList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
            }
            this.FormLoaded = true;
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }
Esempio n. 3
0
        /// <summary>
        /// 单个记录移动
        /// </summary>
        public void SingleMove()
        {
            if (String.IsNullOrEmpty(this.EntityId))
            {
                return;
            }
            var frmOrganizeSelect = new FrmOrganizeSelect(this.EntityId)
            {
                MultiSelect         = false,
                AllowNull           = false,
                PermissionScopeCode = this.PermissionItemScopeCode
            };

            if (frmOrganizeSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            RDIFrameworkService.Instance.RoleService.MoveTo(UserInfo, this.EntityId, frmOrganizeSelect.SelectedId);
            this.GetRoleList();;
            this.Cursor = holdCursor;
        }