Foxtable(狐表)用户栏目专家坐堂 → 关于编辑目录树的问题!


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

主题:关于编辑目录树的问题!

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


加好友 发短信
等级:幼狐 帖子:183 积分:1312 威望:0 精华:0 注册:2014/11/26 8:49:00
  发帖心情 Post By:2014/12/20 9:11:00 [只看该作者]

甜版主,因为一个区域中有多个车间,一个车间内有多台设备,我想实现删除 禁止删除区域和车间,删除设备的时候该设备对应目录树第三层、第4层节点和在作业区域表里对应的行全部删除() 代码如下:

Dim tr As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim nd As WinForm.TreeNode = tr.SelectedNode
If nd IsNot Nothing Then
    Dim pth() As String = nd.FullPath.Split("\")
    Dim nd1 As WinForm.TreeNode = tr.SelectedNode
    Select Case nd.Level
       
            '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) & "'And 备注 = '" & pth(3) & "'")
            nd.Delete()
        Case 1
            MessageBox.show ("车间严禁删除","提示",MessageBoxButtons.OK,messageboxicon.Information)
        Case 0
            MessageBox.show ("区域严禁删除","提示",MessageBoxButtons.OK,messageboxicon.Information)
           
    End Select
   
End If
tr.Select

 

报错:“索引超出了数组界限。”

请指点!谢谢了!


 回到顶部
总数 16 1 2 下一页