コード例 #1
0
        /// <summary>
        /// 单个记录移动
        /// </summary>
        private void SingleMove()
        {
            if (String.IsNullOrEmpty(this.ParentEntityId))
            {
                return;
            }

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

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

            this.Cursor = Cursors.WaitCursor;
            // 调用事件
            moduleService.MoveTo(UserInfo, this.CurrentEntityId, frmModuleSelect.SelectedId);
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvModule, frmModuleSelect.SelectedId);
            BasePageLogic.MoveTreeNode(this.tvModule, this.tvModule.SelectedNode, BasePageLogic.TargetNode);
            // 绑定dgvInfo
            this.GetModuleList();
            if (this.DTModuleList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTModuleList.Rows.Count - 1;
            }
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }
コード例 #2
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            // 用反射获得窗体
            var frmModuleSelect = new FrmModuleSelect();

            if (frmModuleSelect.ShowDialog() == DialogResult.OK)
            {
                this.txtParentId.SelectedValue = frmModuleSelect.SelectedId;
                this.txtParentId.Text          = frmModuleSelect.SelectedFullName;
            }
            this.SetControlState();
        }
コード例 #3
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;
        }