加载树代码:
Dim Filter As String = "1=1"
Dim dr = e.node.FullPath.split("\") '获取生成此节点的行
If e.Node.Text <> "加载所有数据" Then
Select Case e.Node.Level
Case 0
Filter = "[项目名称] = '" & dr(0) & "'"
Case 1
Filter = "[项目名称] = '" & dr(0) & "'And [施工合同段] = '" & dr(1) & "'"
Case 2
Filter = "[项目名称] = '" & dr(0) & "'And [施工合同段] = '" & dr(1) & "' And [安全费用分类] = '" & dr(2) & "'"
End Select
End If
If User.Name = "开发者" Or User.Name = "管理员" Then
DataTables("安全费用表").LoadFilter = filter
DataTables("安全费用表").LoadOver="支出日期"
DataTables("安全费用表").LoadReverse = True
DataTables("安全费用表").LoadTop= 10
DataTables("安全费用表").Load
Tables("安全费用表").sort="支出日期"
Else
DataTables("安全费用表").loadfilter = "(承包人机构 in ('" & User.Roles.replace(",","','") & "') or 监理机构 in ('" & User.Roles.replace(",","','") & "') or 业主机构 in ('" & User.Roles.replace(",","','") & "')) and " & Filter
DataTables("安全费用表").LoadOver="支出日期"
DataTables("安全费用表").LoadReverse = True
DataTables("安全费用表").LoadTop= 10
DataTables("安全费用表").Load
Tables("安全费用表").sort="支出日期"
End If
e.Form.Controls("TextBox5").Value = 1 & "/" & DataTables("安全费用表").TotalPages
vars("安全费用表filter") = DataTables("安全费用表").LoadFilter
翻页代码:
With DataTables("安全费用表")
.LoadPage = 0 '加载第一页
.Load()
e.Form.Controls("TextBox5").Value = 1 & "/" & .TotalPages
End With
With DataTables("安全费用表")
If .LoadPage > 0 Then
.LoadPage = .LoadPage - 1
.Load()
e.Form.Controls("TextBox5").Value = (.LoadPage + 1) & "/" & .TotalPages
End If
End With
With DataTables("安全费用表")
If .LoadPage < .TotalPages - 1
.LoadPage = .LoadPage + 1
.Load()
e.Form.Controls("TextBox5").Value = (.LoadPage + 1) & "/" & .TotalPages
End If
End With
With DataTables("安全费用表")
If .LoadPage < .TotalPages - 1
.LoadPage = .TotalPages - 1
.Load()
e.Form.Controls("TextBox5").Value = .TotalPages & "/" & .TotalPages
End If
End With