Foxtable(狐表)用户栏目专家坐堂 → 目录树语法错误问题


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

主题:目录树语法错误问题

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


加好友 发短信
等级:一尾狐 帖子:485 积分:4069 威望:0 精华:0 注册:2015/12/16 8:22:00
目录树语法错误问题  发帖心情 Post By:2018/1/10 9:59:00 [只看该作者]

如下:

在AfterSelectNode的代码:
If e.Node.DataRow Is Nothing Then
    Tables("B_Room").Position = Tables("B_Room").FindRow("_Identify = " & e.Node.tag)
Else
    Tables("B_Room").Position = Tables("B_Room").FindRow(e.node.DataRow)
End If

在AfterEditNode的代码:
If e.NewText = "" Then
    e.Cancel = True
    Return
End If
Dim pth() As String = e.Node.FullPath.Split("\")
Select Case e.node.Level
    Case 0
        DataTables("B_Room").ReplaceFor("仓库一级",e.NewText,"仓库一级 = '" & pth(0) & "'")
    Case 1
        DataTables("B_Room").ReplaceFor("仓库二级",e.NewText,"仓库一级 = '" & pth(0) & "' And 仓库二级 = '" & pth(1) & "'")
    Case 2
        DataTables("B_Room").ReplaceFor("仓库三级",e.NewText,"仓库一级 = '" & pth(0) & "' And 仓库二级 = '" & pth(1) & "' And 仓库三级 = '" & pth(2) & "'")
Case 3
        DataTables("B_Room").ReplaceFor("仓库四级",e.NewText,"仓库一级 = '" & pth(0) & "' And 仓库二级 = '" & pth(1) & "' And 仓库三级 = '" & pth(2) & "' And 仓库四级 = '" & pth(3) & "'")
Case 4
        DataTables("B_Room").ReplaceFor("仓库伍级",e.NewText,"仓库一级 = '" & pth(0) & "' And 仓库二级 = '" & pth(1) & "' And 仓库三级 = '" & pth(2) & "' And 仓库四级 = '" & pth(3) & "' And 仓库伍级 = '" & pth(4) & "'")
Case 5
        DataTables("B_Room").ReplaceFor("仓库六级",e.NewText,"仓库一级 = '" & pth(0) & "' And 仓库二级 = '" & pth(1) & "' And 仓库三级 = '" & pth(2) & "' And 仓库四级 = '" & pth(3) & "' And 仓库伍级 = '" & pth(4) & "' And 仓库六级 = '" & pth(5) & "'")
End Select
e.Node.Name = e.NewText

在窗体按钮增加仓库的代码如下:
Dim dr As DataRow = DataTables("B_Room").AddNew
dr("仓库一级") = "新节点"
Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")
nd = tr.Nodes.Add("新节点")
tr.SelectedNode = nd
tr.Select()
tr.BeginEdit()

当在点击增加的时候会出现以下的问题,请问是什么问题?
.NET Framework 版本:2.0.50727.8669
Foxtable 版本:2017.12.18.1
错误所在事件:窗口,仓库管理,TreeView1,AfterSelectNode
详细错误信息:
语法错误:“=”运算符后缺少操作数。



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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/10 10:09:00 [只看该作者]

Dim dr As DataRow = DataTables("B_Room").AddNew
dr("仓库一级") = "新节点"
Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("TreeView1")
nd = tr.Nodes.Add("新节点")
nd.Tag = dr("_Identify")
tr.SelectedNode = nd
tr.Select()
tr.BeginEdit()

 回到顶部