Ejemplo n.º 1
0
 /// <summary>
 /// 编辑组织机构
 /// </summary>
 private void EditTree()
 {
     if (this.tvOrganize.SelectedNode == null)
     {
         return;
     }
     FrmOrganizeEdit frmOrganizeEdit = new FrmOrganizeEdit((this.tvOrganize.SelectedNode.Tag as DataRow)[BaseModuleEntity.FieldId].ToString());
     if (frmOrganizeEdit.ShowDialog(this) == DialogResult.OK)
     {
         if ((BaseSystemInfo.ClientCache) && (this.chkRefresh.Checked))
         {
             ClientCache.Instance.DTOrganize = null;
         }
         // 编辑节点
         this.tvOrganize.SelectedNode.Text = frmOrganizeEdit.FullName;
         // 绑定grdOrganize
         this.GetOrganizeList();
         if (this.DTOrganizeList.Rows.Count > 0)
         {
             this.grdOrganize.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 编辑组织机构
        /// </summary>
        private void EditGrid()
        {
            if (this.grdOrganize.RowCount == 0)
            {
                // 提高用户体验,如果grdPermission没有数据则修改tvPermissiion 中的selectedNode
                this.LastControl = this.tvOrganize;
                return;
            }
            FrmOrganizeEdit frmOrganizeEdit = new FrmOrganizeEdit(this.EntityId);
            if (frmOrganizeEdit.ShowDialog(this) == DialogResult.OK)
            {
                if ((BaseSystemInfo.ClientCache) && (this.chkRefresh.Checked))
                {
                    ClientCache.Instance.DTOrganize = null;
                }

                BaseInterfaceLogic.FindTreeNode(this.tvOrganize, this.EntityId);
                TreeNode selectNode = BaseInterfaceLogic.TargetNode;
                selectNode.Text = frmOrganizeEdit.FullName;
                TreeNode oldParentNode = selectNode.Parent;
                BaseInterfaceLogic.FindTreeNode(this.tvOrganize, frmOrganizeEdit.ParentId);
                TreeNode parentNode = BaseInterfaceLogic.TargetNode;
                // 编辑节点
                BaseInterfaceLogic.EditTreeNode(this.tvOrganize, selectNode, parentNode);
                // 绑定屏幕数据
                this.GetOrganizeList();
                if (this.DTOrganizeList.Rows.Count > 0)
                    this.grdOrganize.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
            }
        }