Dim Page1 As WinForm.Topicpage
Dim Page2 As WinForm.Topicpage
Dim filter As String = DataTables("设备").LoadFilter
If filter > "" Then
filter = filter & "and "
End If
msgbox(filter & "[有效期] <= 0 and 设备状态='正常'") '有符合条件的数据吗
Dim cnt1 As Integer = DataTables("设备").SQLCompute("Count(设备编号)", filter & "[有效期] <= 0 and 设备状态='正常'")
Dim cnt2 As Integer = DataTables("设备").SQLCompute("Count(设备编号)",filter & "有效期 < 30 And 有效期 > 0 And 设备状态='正常'")
Dim cnt3 As Integer = DataTables("设备").SQLCompute("Count(设备编号)",filter & "设备状态='正常'")
Dim cnt4 As Integer = DataTables("设备").SQLCompute("Count(设备编号)",filter & "设备状态='停用'")
Dim cnt5 As Integer = DataTables("设备").SQLCompute("Count(设备编号)",filter & "设备状态='报废'")
Dim cnt6 As Integer = DataTables("设备").SQLCompute("Count(设备编号)",filter & "设备状态 is null")
Page1 = e.Form.Controls("TopicBar1").Pages.Add("设备检定","设备检定")
Page1.Links.Add("已过期","已过期(" & cnt1 & ")" )
Page1.Links.Add("即将过期","即将过期(" & cnt2 & ")" )
Page2 = e.Form.Controls("TopicBar1").Pages.Add("设备状态","设备状态")
Page2.Links.Add("正常","正常(" & cnt3 & ")" )
Page2.Links.Add("停用","停用(" & cnt4 & ")" )
Page2.Links.Add("报废","报废(" & cnt5 & ")" )
Page2.Links.Add("其他","其他(" & cnt6 & ")" )