Exemplo n.º 1
0
 /// <summary>
 /// 批量移动
 /// </summary>
 private void BatchMove()
 {
     if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdOrganize, "colSelected"))
     {
         FrmOrganizeSelect frmOrganizeSelect = new FrmOrganizeSelect(this.ParentEntityId, this.chkInnerOrganize.Checked);
         if (UserInfo.IsAdministrator)
         {
             frmOrganizeSelect.AllowNull = true;
         }
         else
         {
             frmOrganizeSelect.AllowNull = false;
             frmOrganizeSelect.PermissionItemScopeCode = this.PermissionItemScopeCode;
         }
         frmOrganizeSelect.OnButtonConfirmClick += new BaseBusinessLogic.CheckMoveEventHandler(CheckInputMove);
         if (frmOrganizeSelect.ShowDialog() == DialogResult.OK)
         {
             // 设置鼠标繁忙状态,并保留原先的状态
             Cursor holdCursor = this.Cursor;
             this.Cursor = Cursors.WaitCursor;
             this.FormLoaded = false;
             DotNetService.Instance.OrganizeService.BatchMoveTo(UserInfo, this.GetSelecteIds(), frmOrganizeSelect.SelectedId);
             if ((BaseSystemInfo.ClientCache) && (this.chkRefresh.Checked))
             {
                 ClientCache.Instance.DTOrganize = null;
             }
             this.ParentEntityId = frmOrganizeSelect.SelectedId;
             // 调用事件
             string[] tags = this.GetSelecteIds();
             DotNetService.Instance.OrganizeService.BatchMoveTo(UserInfo, tags, frmOrganizeSelect.SelectedId);
             // 移动treeNode
             BaseInterfaceLogic.FindTreeNode(this.tvOrganize, frmOrganizeSelect.SelectedId);
             TreeNode parentNode = BaseInterfaceLogic.TargetNode;
             if (tags.Length > 0)
             {
                 for (int i = 0; i < tags.Length; i++)
                 {
                     BaseInterfaceLogic.FindTreeNode(this.tvOrganize, tags[i]);
                     BaseInterfaceLogic.MoveTreeNode(this.tvOrganize, BaseInterfaceLogic.TargetNode, parentNode);
                 }
             }
             // 绑定grdOrganize
             this.GetOrganizeList();
             if (this.DTOrganizeList.Rows.Count > 0)
                 this.grdOrganize.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
             this.FormLoaded = true;
             // 设置鼠标默认状态,原来的光标状态
             this.Cursor = holdCursor;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 单个记录移动
 /// </summary>
 public void SingleMove()
 {
     if (String.IsNullOrEmpty(this.ParentEntityId))
     {
         return;
     }
     FrmOrganizeSelect frmOrganizeSelect = new FrmOrganizeSelect(this.ParentEntityId, this.chkInnerOrganize.Checked);
     if (UserInfo.IsAdministrator)
     {
         frmOrganizeSelect.AllowNull = true;
     }
     else
     {
         frmOrganizeSelect.AllowNull = false;
         frmOrganizeSelect.PermissionItemScopeCode = this.PermissionItemScopeCode;
     }
     frmOrganizeSelect.OnButtonConfirmClick += new BaseBusinessLogic.CheckMoveEventHandler(CheckInputMove);
     if (frmOrganizeSelect.ShowDialog() == DialogResult.OK)
     {
         // 设置鼠标繁忙状态,并保留原先的状态
         Cursor holdCursor = this.Cursor;
         this.Cursor = Cursors.WaitCursor;
         this.FormLoaded = false;
         DotNetService.Instance.OrganizeService.MoveTo(UserInfo, this.CurrentEntityId, frmOrganizeSelect.SelectedId);
         if (!BaseSystemInfo.ClientCache)
         {
             ClientCache.Instance.DTOrganize = null;
         }
         this.FormLoaded = false;
         if ((BaseSystemInfo.ClientCache) && (this.chkRefresh.Checked))
         {
             ClientCache.Instance.DTOrganize = null;
         }
         // 移动treeNode
         BaseInterfaceLogic.FindTreeNode(this.tvOrganize, frmOrganizeSelect.SelectedId);
         BaseInterfaceLogic.MoveTreeNode(this.tvOrganize, this.tvOrganize.SelectedNode, BaseInterfaceLogic.TargetNode);
         // 绑定grdOrganize
         this.GetOrganizeList();
         if (this.DTOrganizeList.Rows.Count > 0)
             this.grdOrganize.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
         this.FormLoaded = true;
         // 设置鼠标默认状态,原来的光标状态
         this.Cursor = holdCursor;
     }
 }