Beispiel #1
0
        /// <summary>
        /// 批量移动
        /// </summary>
        private void BatchMove()
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                return;
            }

            frmModuleSelect = new FrmModuleSelect(this.ParentEntityId)
            {
                AllowNull = true
            };
            frmModuleSelect.OnButtonConfirmClick += new FrmModuleSelect.ButtonConfirmEventHandler(CheckInputMove);
            if (frmModuleSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor         = Cursors.WaitCursor;
            this.ParentEntityId = frmModuleSelect.SelectedId;
            // 调用事件
            var tags = this.GetSelecteIds();

            moduleService.BatchMoveTo(UserInfo, tags, frmModuleSelect.SelectedId);
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvModule, frmModuleSelect.SelectedId);
            var parentNode = BasePageLogic.TargetNode;

            if (tags.Length > 0)
            {
                foreach (string tmpTag in tags)
                {
                    BasePageLogic.FindTreeNode(this.tvModule, tmpTag);
                    BasePageLogic.MoveTreeNode(this.tvModule, BasePageLogic.TargetNode, parentNode);
                }
            }
            // 绑定dgvInfo
            this.GetModuleList();
            if (this.DTModuleList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTModuleList.Rows.Count - 1;
            }
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }