Dim t1 As WinForm.TreeView =e.Form.Controls("TreeView1")
Dim t2 As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim t3 As WinForm.TreeView = e.Form.Controls("TreeView3")
Dim t4 As WinForm.TreeView = e.Form.Controls("TreeView4")
Dim t5 As WinForm.TreeView = e.Form.Controls("TreeView5")
Select Case e.Link.Name
Case "待我解决的BUG"
If t1.SelectedNode IsNot Nothing Then
If t1.SelectedNode.text <> "显示'" & user.group & "'所有研发的BUG" Then
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and [模块维护人] = '" & t1.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and [模块维护人] = '" & t1.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and [模块维护人] = '" & t1.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and [模块维护人] = '" & t1.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","[模块维护人] = '" & t1.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
msgbox(1)
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and [模块维护人] = '" & t1.SelectedNode.Text & "'"
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
msgbox(2)
Else
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","[研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
msgbox(3)
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and [研发组名] = '" & user.group & "'"
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
msgbox(4)
End If
Else
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and 模块维护人邮箱 = '" & user.name & "'"
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
End If
If t2.SelectedNode IsNot Nothing Then
If t2.SelectedNode.text <> "显示'" & user.group & "'所有模块的BUG" Then
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and [怀疑模块] = '" & t2.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and [怀疑模块] = '" & t2.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and [怀疑模块] = '" & t2.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and [怀疑模块] = '" & t2.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","[怀疑模块] = '" & t2.SelectedNode.Text & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and [怀疑模块] = '" & t2.SelectedNode.Text & "'"
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
Else
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and [研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","[研发组名] = '" & user.group & "' ")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and [研发组名] = '" & user.group & "'"
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
End If
Else
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("待我解决的BUG").Text = "待我解决的BUG(" & cnt1 & ")"
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已更新的BUG").Text = "我已更新的BUG(" & cnt2 & ")"
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我已解决的BUG").Text = "我已解决的BUG(" & cnt3 & ")"
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and 模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我未解决的BUG").Text = "我未解决的BUG(" & cnt4 & ")"
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","模块维护人邮箱 = '" & user.name & "'")
e.Form.Controls("TopicBar1").Pages("挂我名下的BUG").Links("我的所有的BUG").Text = "我的所有的BUG(" & cnt5 & ")"
DataTables("BUG研发表").loadFilter = "状态 = '待解决' and 模块维护人邮箱 = '" & user.name & "'"
msgbox(5)
DataTables("BUG研发表").Load()
Tables("BUG研发表").sort = "BUG_ID DESC"
End If
里面有t1,t2,t3,t4,t5 tree,经过调试,选择了t1的某个节点,然后点击topicbar的某一个,最终发现执行了t2的最后一个msgbos(5).
我知道这样写代码有问题,不知道怎么调整,另外能把代码改简洁一下不。