/// <summary> /// 批量移动 /// </summary> private void BatchMove() { if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdPermission, "colSelected")) { frmPermissionItemSelect = new FrmPermissionSelect(this.parentEntityId); if (UserInfo.IsAdministrator) { frmPermissionItemSelect.AllowNull = true; } else { frmPermissionItemSelect.AllowNull = false; } frmPermissionItemSelect.OnButtonConfirmClick += new FrmPermissionSelect.ButtonConfirmEventHandler(CheckInputMove); if (frmPermissionItemSelect.ShowDialog() == DialogResult.OK) { // 设置鼠标繁忙状态,并保留原先的状态 Cursor holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; this.ParentEntityId = frmPermissionItemSelect.SelectedId; // 调用事件 string[] tags = this.GetSelecteIds(); DotNetService.Instance.PermissionItemService.BatchMoveTo(UserInfo, tags, frmPermissionItemSelect.SelectedId); // 移动treeNode BaseInterfaceLogic.FindTreeNode(this.tvPermission, frmPermissionItemSelect.SelectedId); TreeNode parentNode = BaseInterfaceLogic.TargetNode; if (tags.Length > 0) { for (int i = 0; i < tags.Length; i++) { BaseInterfaceLogic.FindTreeNode(this.tvPermission, tags[i]); BaseInterfaceLogic.MoveTreeNode(this.tvPermission, BaseInterfaceLogic.TargetNode, parentNode); } } // 绑定grdModule this.GetPermissionList(); if (this.DTPermissionList.Rows.Count > 0) this.grdPermission.FirstDisplayedScrollingRowIndex = this.DTPermissionList.Rows.Count - 1; // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; } } }
/// <summary> /// 单个记录移动 /// </summary> public void SingleMove() { if (String.IsNullOrEmpty(this.ParentEntityId)) { return; } frmPermissionItemSelect = new FrmPermissionSelect(this.ParentEntityId); if (UserInfo.IsAdministrator) { frmPermissionItemSelect.AllowNull = true; } else { frmPermissionItemSelect.AllowNull = false; } frmPermissionItemSelect.OnButtonConfirmClick += new FrmPermissionSelect.ButtonConfirmEventHandler(this.CheckInputMove); if (frmPermissionItemSelect.ShowDialog() == DialogResult.OK) { DotNetService.Instance.PermissionItemService.MoveTo(this.UserInfo, this.CurrentEntityId, frmPermissionItemSelect.SelectedId); // 移动treeNode BaseInterfaceLogic.FindTreeNode(this.tvPermission, frmPermissionItemSelect.SelectedId); BaseInterfaceLogic.MoveTreeNode(this.tvPermission, this.tvPermission.SelectedNode, BaseInterfaceLogic.TargetNode); // 绑定grdPermission this.GetPermissionList(); if (this.DTPermissionList.Rows.Count > 0) this.grdPermission.FirstDisplayedScrollingRowIndex = this.DTPermissionList.Rows.Count - 1; } }