以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]求助目录树授权问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=124120) |
||||
-- 作者:紫色幽魂 -- 发布时间:2018/8/31 0:36:00 -- [求助]求助目录树授权问题
左边用户,右边是导航栏,怎么才能将用户加入到授权表里对应的位置
|
||||
-- 作者:有点甜 -- 发布时间:2018/8/31 9:24:00 -- 参考
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=109942&skin=0
|
||||
-- 作者:紫色幽魂 -- 发布时间:2018/8/31 14:31:00 -- 回复:(有点甜)参考?http://www.foxtable.... 感觉不一样,用select筛选出来符合条件的所有行后,怎么才能判断这些行里面有没有包含指定的文字(暂解决,帖子发出后不能撤销,比较麻烦) [此贴子已经被作者于2018/8/31 14:33:57编辑过]
|
||||
-- 作者:有点甜 -- 发布时间:2018/8/31 14:35:00 -- 1、请换成2楼的方式处理。
2、包含文字的判断,请用like,参考 http://www.foxtable.com/webhelp/scr/1647.htm
|
||||
-- 作者:紫色幽魂 -- 发布时间:2018/8/31 15:23:00 -- 回复:(有点甜)1、请换成2楼的方式处理。 ... 现在能够选择第一个节点,第二个节点显示不正确,应该怎么改 Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim mc As String = "& e.Node.Name &" Dim drs As List(Of DataRow) = DataTables("用户_授权").Select("用户 like \'*"& e.Node.Name &"*\'") For Each nd As WinForm.TreeNode In trv2.AllNodes nd.Checked = False Next For Each dr As DataRow In DataTables("用户_授权").Select("用户 like \'*"& e.Node.Name &"*\'") For Each nd1 As WinForm.TreeNode In trv2.Nodes nd1.Checked = dr("父节点").Contains(nd1.Name) And dr.IsNull("子节点") For Each nd2 As WinForm.TreeNode In trv2.Nodes(nd1.Name).Nodes nd2.Checked = dr("子节点").Contains(nd2.Name) Next Next Next |
||||
-- 作者:有点甜 -- 发布时间:2018/8/31 15:33:00 -- 请参考,照抄里面的例子
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=109942&skin=0 |
||||
-- 作者:紫色幽魂 -- 发布时间:2018/9/1 12:11:00 -- 回复:(有点甜)请参考,照抄里面的例子?ht... 弄了一两天还是没有弄出来,麻烦看看需要怎么改,现在一选择用户后,用户单元格就会出现所有用户 Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim nd1 As WinForm.TreeNode = trv1.SelectedNode Dim nd2 As WinForm.TreeNode = trv2.SelectedNode Dim dr As DataRow Dim sl As Integer If nd2.Level = 0 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.Name &"\'") ElseIf nd2.Level = 1 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.ParentNode.Name &"\' and 子节点 = \'"& e.Node.Name &"\'") End If If dr IsNot Nothing Then Dim nms As String If e.Node.Level = 0 Then For Each yh1 As WinForm.TreeNode In trv1.Nodes If nd2.Checked = True nms = nms & "," & yh1.Name End If If nms > "" Then dr("用户") = nms.Trim(",") Else dr("用户") = Nothing End If Next ElseIf e.Node.Level = 1 Then For Each yh1 As WinForm.TreeNode In trv1.Nodes If nd2.Checked = True nms = nms & "," & yh1.Name End If If nms > "" Then dr("用户") = nms.Trim(",") Else dr("用户") = Nothing End If Next End If End If
[此贴子已经被作者于2018/9/1 12:12:00编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2018/9/1 14:36:00 -- Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim nd1 As WinForm.TreeNode = trv1.SelectedNode Dim nd2 As WinForm.TreeNode = trv2.SelectedNode Dim dr As DataRow Dim sl As Integer If nd2.Level = 0 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.Name &"\'") ElseIf nd2.Level = 1 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.ParentNode.Name &"\' and 子节点 = \'"& e.Node.Name &"\'") End If If dr IsNot Nothing Then dr("用户") = nd1.Text End If |
||||
-- 作者:有点蓝 -- 发布时间:2018/9/1 14:47:00 -- Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim nd1 As WinForm.TreeNode = trv1.SelectedNode Dim nd2 As WinForm.TreeNode = trv2.SelectedNode Dim dr As DataRow Dim sl As Integer If nd2.Level = 0 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.Name &"\'") ElseIf nd2.Level = 1 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.ParentNode.Name &"\' and 子节点 = \'"& e.Node.Name &"\'") End If If dr IsNot Nothing Then If dr("用户").contains(nd1.Text) = False dr("用户") = dr("用户") & "," & nd1.Text End If End If
|
||||
-- 作者:紫色幽魂 -- 发布时间:2018/9/2 16:53:00 -- 回复:(有点蓝)Dim trv1 As WinForm.TreeView = e.F... 我选择目录树第一层节点的最后一个节点,为什么增加,删除用户名的却是这个节点的下一个层级的节点最后一个 Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1") Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2") Dim nd1 As WinForm.TreeNode = trv1.SelectedNode Dim nd2 As WinForm.TreeNode = trv2.SelectedNode Dim dr As DataRow Dim sl As Integer If nd2.Level = 0 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.Name &"\'") ElseIf nd2.Level = 1 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.ParentNode.Name &"\' and 子节点 = \'"& e.Node.Name &"\'") End If If nd2.Level = 0 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.Name &"\'") ElseIf nd2.Level = 1 Then dr = DataTables("用户_授权").Find("父节点 = \'"& e.Node.ParentNode.Name &"\' and 子节点 = \'"& e.Node.Name &"\'") End If If dr IsNot Nothing Then If e.Node.IsSelected = True If dr("用户").contains(nd1.Text) = False If dr.IsNull("用户") dr("用户") = nd1.Text Else dr("用户") = dr("用户") & "," & nd1.Text End If End If End If If e.Node.Checked = False Dim ss() As String = dr("用户").split(",") Dim lst As new List(of String) lst.AddRange(ss) lst.remove(nd1.Text) dr("用户") = String.Join(",",lst.ToArray()) End If End If
|