예제 #1
0
        /// <summary>
        /// 编辑组织机构
        /// </summary>
        private void EditGrid()
        {
            if (this.grdPermission.RowCount == 0)
            {
                // 提高用户体验,如果grdPermission没有数据则修改tvPermissiion 中的selectedNode
                this.LastControl = this.tvPermission;
                return;
            }
            FrmPermissionItemEdit frmPermissionItemEdit = new FrmPermissionItemEdit(this.EntityId);
            if (frmPermissionItemEdit.ShowDialog(this) == DialogResult.OK)
            {
                BaseInterfaceLogic.FindTreeNode(this.tvPermission, this.EntityId);
                TreeNode selectNode = BaseInterfaceLogic.TargetNode;
                selectNode.Text = frmPermissionItemEdit.FullName;
                TreeNode oldParentNode = selectNode.Parent;

                BaseInterfaceLogic.FindTreeNode(this.tvPermission, frmPermissionItemEdit.ParentId);
                TreeNode parentNode = BaseInterfaceLogic.TargetNode;
                // 编辑节点
                BaseInterfaceLogic.EditTreeNode(this.tvPermission, selectNode, parentNode);
                // 绑定grdPermission
                this.GetPermissionList();
                if (this.DTPermissionList.Rows.Count > 0)
                    this.grdPermission.FirstDisplayedScrollingRowIndex = this.DTPermissionList.Rows.Count - 1;
            }
        }
예제 #2
0
 private void EditTree()
 {
     if (this.tvPermission.SelectedNode == null)
     {
         return;
     }
     FrmPermissionItemEdit frmPermissionItemEdit = new FrmPermissionItemEdit((this.tvPermission.SelectedNode.Tag as DataRow)[BaseModuleEntity.FieldId].ToString());
     if (frmPermissionItemEdit.ShowDialog(this) == DialogResult.OK)
     {
         // 编辑节点
         this.tvPermission.SelectedNode.Text = frmPermissionItemEdit.FullName;
         // 绑定grdPermission
         this.GetPermissionList();
         if (this.DTPermissionList.Rows.Count > 0)
         {
             this.grdPermission.FirstDisplayedScrollingRowIndex = this.DTPermissionList.Rows.Count - 1;
         }
     }
 }