Foxtable(狐表)用户栏目专家坐堂 → 目录树删除节点问题


  共有2280人关注过本帖树形打印复制链接

主题:目录树删除节点问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/16 12:25:00 [显示全部帖子]

Dim tr As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim nd As WinForm.TreeNode = tr.SelectedNode
If nd IsNot Nothing Then
    Dim Result As DialogResult
    Result = MessageBox.Show("    如果删除选定的组织机构,将导致本机构的安全职责及责任制考核标准同时被删除.  您确定要删除当前节点吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        Dim pth() As String = nd.FullPath.Split("\")
        Select Case nd.Level
            Case 0
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "'")
            Case 1
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "' And 部门设置 = '" & pth(1) & "'")
            Case 2
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "' And 部门设置 = '" & pth(1) & "' And 岗位设置 = '" & pth(2) & "'")
            Case 3
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "' And 部门设置 = '" & pth(1) & "' And 岗位设置 = '" & pth(2) & "' and 第四层机构设置 = '" & pth(3) & "'")
            Case 4
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "' And 部门设置 = '" & pth(1) & "' And 岗位设置 = '" & pth(2) & "' and 第四层机构设置 = '" & pth(3) & "' and 第五层机构设置 = '" & pth(4) & "'")
            Case 5
                DataTables("组织机构和职责").DeleteFor("企业名称 = '" & pth(0) & "' And 部门设置 = '" & pth(1) & "' And 岗位设置 = '" & pth(2) & "' and 第四层机构设置 = '" & pth(3) & "' and 第五层机构设置 = '" & pth(4) & "' and 第六层机构设置 = '" & pth(5) & "'")
        End Select
        nd.Delete()
    Else
    End If
End If
tr.Select()

 回到顶部