Foxtable(狐表)用户栏目专家坐堂 → [求助]目录树


  共有2191人关注过本帖平板打印复制链接

主题:[求助]目录树

帅哥哟,离线,有人找我吗?
lesliecheung912
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:452 积分:3015 威望:0 精华:0 注册:2014/4/23 17:12:00
[求助]目录树  发帖心情 Post By:2014/7/24 10:57:00 [只看该作者]

现有目录树共有7层:单位名称,部门体系,工作部门,办事处,岗位名称,职位层级,职系,职位职级
增加办事处的代码为:
Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")
nd = tr.SelectedNode
If nd IsNot Nothing Then
    If nd.Level = 6 Then
        MessageBox.Show("最多允许7层节点!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    ElseIf nd.Level = 1 Then
        Dim dr As DataRow = DataTables("部门岗位").Find("部门体系='" &nd.ParentNode.Text & "' and 部门名称='" & nd.text & "' and 办事处 is null")
        If dr Is Nothing Then
            dr = DataTables("部门岗位").AddNew
        End If
        dr("单位名称")="XX有限公司"
        dr("部门体系") = nd.ParentNode.Text
        dr("部门名称") = nd.Text
        dr("办事处") = "请增加办事处"
        
        nd = nd.Nodes.Add("请增加办事处")
        tr.SelectedNode = nd
        tr.Select()
        tr.BeginEdit()
    End If
End If

但是在增加岗位以及更下层的内容时,部门体系等值应该如何取呢?比如增加岗位时
dr("部门名称") = nd.ParentNode.Text
那部门体系的值应该如何取得?


 回到顶部