Foxtable(狐表)用户栏目专家坐堂 → [求助]请教一个目录树定位的问题


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

主题:[求助]请教一个目录树定位的问题

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/5/3 10:54:00 [显示全部帖子]

“法律服务人员维护”窗口,“保存”按钮:

Dim t As Table = e.Form.Controls("基层法律服务人员信息表").Table
t.Filter = "_Identify = " & t.Current("_Identify")
For Each c As Col In t.Cols
    For Each ctl As WinForm.Control In e.Form.Controls
        If ctl.Name.Contains(c.Name) Then
            If c.IsBoolean Then
                t.Current(c.Name) = e.Form.Controls(ctl.Name).Checked
            Else
                t.Current(c.Name) = e.Form.Controls(ctl.Name).Value
            End If
        End If
    Next
Next
e.Form.Controls("基层法律服务人员信息表").Table.DataTable.Save
If Forms("导航窗口").Opened Then
    Dim tv As WinForm.TreeView = Forms("导航窗口").Controls("TreeView3")
    Forms("导航窗口").Controls("目录树刷新").PerformClick
    Dim name As String = e.Form.Controls("基层法律服务人员信息表").Table.Current("姓名")
    For Each nd As WinForm.TreeNode In tv.AllNodes
        If nd.Name = name Then
            tv.SelectedNode = nd
            nd.EnsureVisible
        End If
    Next
End If


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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/5/3 13:22:00 [显示全部帖子]

姓名可能有重复的,改用身份证:

Dim t As Table = e.Form.Controls("基层法律服务人员信息表").Table
t.Filter = "_Identify = " & t.Current("_Identify")
For Each c As Col In t.Cols
    For Each ctl As WinForm.Control In e.Form.Controls
        If ctl.Name.Contains(c.Name) Then
            If c.IsBoolean Then
                t.Current(c.Name) = e.Form.Controls(ctl.Name).Checked
            Else
                t.Current(c.Name) = e.Form.Controls(ctl.Name).Value
            End If
        End If
    Next
Next
e.Form.Controls("基层法律服务人员信息表").Table.DataTable.Save
If Forms("导航窗口").Opened Then
    Dim tv As WinForm.TreeView = Forms("导航窗口").Controls("TreeView3")
    Forms("导航窗口").Controls("目录树刷新").PerformClick
    Dim identifier As String = e.Form.Controls("基层法律服务人员信息表").Table.Current("身份证号码")
    For Each nd As WinForm.TreeNode In tv.AllNodes
        If nd.DataRow("身份证号码") = identifier Then
            tv.SelectedNode = nd
            nd.EnsureVisible
        End If
    Next
End If


 回到顶部