MS1108_1
This commit is contained in:
@@ -281,7 +281,7 @@ Public Class frmConstructor_Main
|
||||
Dim bimage = row.Item("NODE_IMAGE")
|
||||
If Not IsDBNull(bimage) Then
|
||||
Dim Node_image = ByteArrayToBitmap(bimage)
|
||||
TREEVIEW_IMAGELIST.Images.Add("LEVEL#ENTITY" & row.Item("TYPE_NODE").ToString & row.Item("ENTITY_ID"), Node_image)
|
||||
TREEVIEW_IMAGELIST.Images.Add(row.Item("GUID").ToString & "#" & row.Item("ENTITY_ID"), Node_image)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -1179,392 +1179,407 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Sub Load_Tree_View(ConstructorId As Integer)
|
||||
Dim sw As New SW("Load_Tree_View")
|
||||
Try
|
||||
Dim sw As New SW("Load_Tree_View")
|
||||
|
||||
TreeViewMain.Nodes.Clear()
|
||||
If NODE_NAVIGATION = True Then
|
||||
' Rootnode erstellen und taggen
|
||||
If DT_TREEVIEW_PER_CONTROLS.Rows.Count > 1 Then
|
||||
' Presuming the DataTable has a column named ENTITY_ID and TYPE_NODE.
|
||||
Dim expression As String
|
||||
expression = "TYPE_NODE = 0"
|
||||
Dim foundRowsLevel0() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRowsLevel0 = DT_TREEVIEW_PER_CONTROLS.Select(expression)
|
||||
Dim i As Integer
|
||||
' For each row create a Node
|
||||
For i = 0 To foundRowsLevel0.GetUpperBound(0)
|
||||
Dim ID = foundRowsLevel0(i)("GUID")
|
||||
Dim LevelEntity = foundRowsLevel0(i)("ENTITY_ID")
|
||||
Dim controlID = foundRowsLevel0(i)("CONTROL_ID")
|
||||
Dim nodetext = foundRowsLevel0(i)("NODE_CAPTION")
|
||||
Dim Type_node = foundRowsLevel0(i)("TYPE_NODE")
|
||||
Dim RECORD_ID = foundRowsLevel0(i)("RECORD_ID")
|
||||
Dim LEVEL0_NODE As TreeNode
|
||||
LEVEL0_NODE = New TreeNode(nodetext)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL0_NODE.Tag = LevelEntity & " - CONTROL-ID" & controlID.ToString & "#" & ID & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL0_NODE.Tag = LevelEntity & " - CONTROL-ID" & controlID.ToString & "#" & ID
|
||||
End If
|
||||
|
||||
Dim index As Integer = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = Type_node.ToString & LevelEntity.ToString Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL0_NODE.ImageIndex = index
|
||||
LEVEL0_NODE.SelectedImageIndex = index
|
||||
TreeViewMain.Nodes.Add(LEVEL0_NODE)
|
||||
'### LEVEL 1 laden #######
|
||||
Dim expressionLevel1 As String
|
||||
expressionLevel1 = "TYPE_NODE = 1 AND PARENT_GUID = " & ID 'Einschränkung auf Type 2 und Parent_Guid
|
||||
Dim foundRowsLevel1() As DataRow
|
||||
foundRowsLevel1 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel1)
|
||||
Dim j As Integer
|
||||
For j = 0 To foundRowsLevel1.GetUpperBound(0)
|
||||
Dim ID1 = foundRowsLevel1(j)("GUID")
|
||||
Dim LevelEntity1 = foundRowsLevel1(j)("ENTITY_ID")
|
||||
Dim controlID1 = foundRowsLevel1(j)("CONTROL_ID")
|
||||
Dim nodetext1 = foundRowsLevel1(j)("NODE_CAPTION")
|
||||
Dim Type_node1 = foundRowsLevel1(j)("TYPE_NODE")
|
||||
RECORD_ID = foundRowsLevel1(j)("RECORD_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL1_NODE As TreeNode
|
||||
LEVEL1_NODE = New TreeNode(nodetext1)
|
||||
TreeViewMain.Nodes.Clear()
|
||||
If NODE_NAVIGATION = True Then
|
||||
' Rootnode erstellen und taggen
|
||||
If DT_TREEVIEW_PER_CONTROLS.Rows.Count > 1 Then
|
||||
' Presuming the DataTable has a column named ENTITY_ID and TYPE_NODE.
|
||||
Dim expression As String
|
||||
expression = "TYPE_NODE = 0"
|
||||
Dim foundRowsLevel0() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRowsLevel0 = DT_TREEVIEW_PER_CONTROLS.Select(expression)
|
||||
Dim i As Integer
|
||||
Dim NODE_CONFIG_ID
|
||||
' For each row create a Node
|
||||
For i = 0 To foundRowsLevel0.GetUpperBound(0)
|
||||
Dim ID = foundRowsLevel0(i)("GUID")
|
||||
Dim LevelEntity = foundRowsLevel0(i)("ENTITY_ID")
|
||||
Dim controlID = foundRowsLevel0(i)("CONTROL_ID")
|
||||
Dim nodetext = foundRowsLevel0(i)("NODE_CAPTION")
|
||||
Dim Type_node = foundRowsLevel0(i)("TYPE_NODE")
|
||||
Dim RECORD_ID = foundRowsLevel0(i)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel0(i)("NODE_CONFIG_ID")
|
||||
Dim LEVEL0_NODE As TreeNode
|
||||
LEVEL0_NODE = New TreeNode(nodetext)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL1_NODE.Tag = LevelEntity1 & "-CONTROL-ID" & controlID1.ToString & "#" & ID1 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL0_NODE.Tag = LevelEntity & " - CONTROL-ID" & controlID.ToString & "#" & ID & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL1_NODE.Tag = LevelEntity1 & "-CONTROL-ID" & controlID1.ToString & "#" & ID1
|
||||
LEVEL0_NODE.Tag = LevelEntity & " - CONTROL-ID" & controlID.ToString & "#" & ID
|
||||
End If
|
||||
|
||||
index = 0
|
||||
Dim index As Integer = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = Type_node1 & LevelEntity1.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL1_NODE.ImageIndex = index
|
||||
LEVEL1_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL0_NODE.Nodes.Add(LEVEL1_NODE)
|
||||
'### LEVEL 2 laden #######
|
||||
Dim expressionLevel2 As String
|
||||
expressionLevel2 = "TYPE_NODE = 2 AND PARENT_GUID = " & ID1 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel2() As DataRow
|
||||
foundRowsLevel2 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel2)
|
||||
Dim k As Integer
|
||||
For k = 0 To foundRowsLevel2.GetUpperBound(0)
|
||||
Dim ID2 = foundRowsLevel2(k)("GUID")
|
||||
Dim LevelEntity2 = foundRowsLevel2(k)("ENTITY_ID")
|
||||
Dim controlID2 = foundRowsLevel2(k)("CONTROL_ID")
|
||||
Dim nodetext2 = foundRowsLevel2(k)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel2(k)("RECORD_ID")
|
||||
LEVEL0_NODE.ImageIndex = index
|
||||
LEVEL0_NODE.SelectedImageIndex = index
|
||||
TreeViewMain.Nodes.Add(LEVEL0_NODE)
|
||||
'### LEVEL 1 laden #######
|
||||
Dim expressionLevel1 As String
|
||||
expressionLevel1 = "PARENT_GUID = " & ID 'TYPE_NODE = 1 AND Einschränkung auf Type 2 und Parent_Guid
|
||||
Dim foundRowsLevel1() As DataRow
|
||||
foundRowsLevel1 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel1)
|
||||
Dim j As Integer
|
||||
For j = 0 To foundRowsLevel1.GetUpperBound(0)
|
||||
Dim ID1 = foundRowsLevel1(j)("GUID")
|
||||
Dim LevelEntity1 = foundRowsLevel1(j)("ENTITY_ID")
|
||||
Dim controlID1 = foundRowsLevel1(j)("CONTROL_ID")
|
||||
Dim nodetext1 = foundRowsLevel1(j)("NODE_CAPTION")
|
||||
Dim Type_node1 = foundRowsLevel1(j)("TYPE_NODE")
|
||||
RECORD_ID = foundRowsLevel1(j)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel1(j)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL2_NODE As TreeNode
|
||||
LEVEL2_NODE = New TreeNode(nodetext2)
|
||||
Dim LEVEL1_NODE As TreeNode
|
||||
LEVEL1_NODE = New TreeNode(nodetext1)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL2_NODE.Tag = LevelEntity2 & "-CONTROL-ID" & controlID2.ToString & "#" & ID2 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL1_NODE.Tag = LevelEntity1 & "-CONTROL-ID" & controlID1.ToString & "#" & ID1 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL2_NODE.Tag = LevelEntity2 & "-CONTROL-ID" & controlID2.ToString & "#" & ID2
|
||||
LEVEL1_NODE.Tag = LevelEntity1 & "-CONTROL-ID" & controlID1.ToString & "#" & ID1
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "2" & LevelEntity2.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity1 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL2_NODE.ImageIndex = index
|
||||
LEVEL2_NODE.SelectedImageIndex = index
|
||||
LEVEL1_NODE.ImageIndex = index
|
||||
LEVEL1_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL1_NODE.Nodes.Add(LEVEL2_NODE)
|
||||
'### LEVEL 3 laden #######
|
||||
Dim expressionLevel3 As String
|
||||
expressionLevel3 = "TYPE_NODE = 3 AND PARENT_GUID = " & ID2 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel3() As DataRow
|
||||
foundRowsLevel3 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel3)
|
||||
Dim l As Integer
|
||||
For l = 0 To foundRowsLevel3.GetUpperBound(0)
|
||||
Dim ID3 = foundRowsLevel3(l)("GUID")
|
||||
Dim LevelEntity3 = foundRowsLevel3(l)("ENTITY_ID")
|
||||
Dim controlID3 = foundRowsLevel3(l)("CONTROL_ID")
|
||||
Dim nodetext3 = foundRowsLevel3(l)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel3(l)("RECORD_ID")
|
||||
LEVEL0_NODE.Nodes.Add(LEVEL1_NODE)
|
||||
'### LEVEL 2 laden #######
|
||||
Dim expressionLevel2 As String
|
||||
expressionLevel2 = "PARENT_GUID = " & ID1 'TYPE_NODE = 2 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel2() As DataRow
|
||||
foundRowsLevel2 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel2)
|
||||
Dim k As Integer
|
||||
For k = 0 To foundRowsLevel2.GetUpperBound(0)
|
||||
Dim ID2 = foundRowsLevel2(k)("GUID")
|
||||
Dim LevelEntity2 = foundRowsLevel2(k)("ENTITY_ID")
|
||||
Dim controlID2 = foundRowsLevel2(k)("CONTROL_ID")
|
||||
Dim nodetext2 = foundRowsLevel2(k)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel2(k)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel2(k)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL3_NODE As TreeNode
|
||||
LEVEL3_NODE = New TreeNode(nodetext3)
|
||||
Dim LEVEL2_NODE As TreeNode
|
||||
LEVEL2_NODE = New TreeNode(nodetext2)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL3_NODE.Tag = LevelEntity3 & "-CONTROL-ID" & controlID3.ToString & "#" & ID3 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL2_NODE.Tag = LevelEntity2 & "-CONTROL-ID" & controlID2.ToString & "#" & ID2 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL3_NODE.Tag = LevelEntity3 & "-CONTROL-ID" & controlID3.ToString & "#" & ID3
|
||||
LEVEL2_NODE.Tag = LevelEntity2 & "-CONTROL-ID" & controlID2.ToString & "#" & ID2
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "3" & LevelEntity3.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity2 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL3_NODE.ImageIndex = index
|
||||
LEVEL3_NODE.SelectedImageIndex = index
|
||||
LEVEL2_NODE.ImageIndex = index
|
||||
LEVEL2_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL2_NODE.Nodes.Add(LEVEL3_NODE)
|
||||
'### LEVEL 4 laden #######
|
||||
Dim expressionLevel4 As String
|
||||
expressionLevel4 = "TYPE_NODE = 4 AND PARENT_GUID = " & ID3 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel4() As DataRow
|
||||
foundRowsLevel4 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel4)
|
||||
Dim m As Integer
|
||||
For m = 0 To foundRowsLevel4.GetUpperBound(0)
|
||||
Dim ID5 = foundRowsLevel4(m)("GUID")
|
||||
Dim LevelEntity5 = foundRowsLevel4(m)("ENTITY_ID")
|
||||
Dim controlID5 = foundRowsLevel4(m)("CONTROL_ID")
|
||||
Dim nodetext5 = foundRowsLevel4(m)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel4(m)("RECORD_ID")
|
||||
LEVEL1_NODE.Nodes.Add(LEVEL2_NODE)
|
||||
'### LEVEL 3 laden #######
|
||||
Dim expressionLevel3 As String
|
||||
expressionLevel3 = "PARENT_GUID = " & ID2 'TYPE_NODE = 3 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel3() As DataRow
|
||||
foundRowsLevel3 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel3)
|
||||
Dim l As Integer
|
||||
For l = 0 To foundRowsLevel3.GetUpperBound(0)
|
||||
Dim ID3 = foundRowsLevel3(l)("GUID")
|
||||
Dim LevelEntity3 = foundRowsLevel3(l)("ENTITY_ID")
|
||||
Dim controlID3 = foundRowsLevel3(l)("CONTROL_ID")
|
||||
Dim nodetext3 = foundRowsLevel3(l)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel3(l)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel3(l)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL4_NODE As TreeNode
|
||||
LEVEL4_NODE = New TreeNode(nodetext5)
|
||||
Dim LEVEL3_NODE As TreeNode
|
||||
LEVEL3_NODE = New TreeNode(nodetext3)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL4_NODE.Tag = LevelEntity5 & "-CONTROL-ID" & controlID5.ToString & "#" & ID5 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL3_NODE.Tag = LevelEntity3 & "-CONTROL-ID" & controlID3.ToString & "#" & ID3 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL4_NODE.Tag = LevelEntity5 & "-CONTROL-ID" & controlID5.ToString & "#" & ID5
|
||||
LEVEL3_NODE.Tag = LevelEntity3 & "-CONTROL-ID" & controlID3.ToString & "#" & ID3
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "4" & LevelEntity5.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity3 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL4_NODE.ImageIndex = index
|
||||
LEVEL4_NODE.SelectedImageIndex = index
|
||||
LEVEL3_NODE.ImageIndex = index
|
||||
LEVEL3_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL3_NODE.Nodes.Add(LEVEL4_NODE)
|
||||
'### LEVEL 5 laden #######
|
||||
Dim expressionLevel5 As String
|
||||
expressionLevel5 = "TYPE_NODE = 5 AND PARENT_GUID = " & ID5 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel5() As DataRow
|
||||
foundRowsLevel5 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel5)
|
||||
Dim n As Integer
|
||||
For n = 0 To foundRowsLevel5.GetUpperBound(0)
|
||||
Dim ID6 = foundRowsLevel5(n)("GUID")
|
||||
Dim LevelEntity6 = foundRowsLevel5(n)("ENTITY_ID")
|
||||
Dim controlID6 = foundRowsLevel5(n)("CONTROL_ID")
|
||||
Dim nodetext6 = foundRowsLevel5(n)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel5(n)("RECORD_ID")
|
||||
LEVEL2_NODE.Nodes.Add(LEVEL3_NODE)
|
||||
'### LEVEL 4 laden #######
|
||||
Dim expressionLevel4 As String
|
||||
expressionLevel4 = "PARENT_GUID = " & ID3 'TYPE_NODE = 4 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel4() As DataRow
|
||||
foundRowsLevel4 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel4)
|
||||
Dim m As Integer
|
||||
For m = 0 To foundRowsLevel4.GetUpperBound(0)
|
||||
Dim ID5 = foundRowsLevel4(m)("GUID")
|
||||
Dim LevelEntity5 = foundRowsLevel4(m)("ENTITY_ID")
|
||||
Dim controlID5 = foundRowsLevel4(m)("CONTROL_ID")
|
||||
Dim nodetext5 = foundRowsLevel4(m)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel4(m)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel4(m)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL5_NODE As TreeNode
|
||||
LEVEL5_NODE = New TreeNode(nodetext6)
|
||||
Dim LEVEL4_NODE As TreeNode
|
||||
LEVEL4_NODE = New TreeNode(nodetext5)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL5_NODE.Tag = LevelEntity6 & "-CONTROL-ID" & controlID6.ToString & "#" & ID6 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL4_NODE.Tag = LevelEntity5 & "-CONTROL-ID" & controlID5.ToString & "#" & ID5 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL5_NODE.Tag = LevelEntity6 & "-CONTROL-ID" & controlID6.ToString & "#" & ID6
|
||||
LEVEL4_NODE.Tag = LevelEntity5 & "-CONTROL-ID" & controlID5.ToString & "#" & ID5
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "5" & LevelEntity6.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity5 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL5_NODE.ImageIndex = index
|
||||
LEVEL5_NODE.SelectedImageIndex = index
|
||||
LEVEL4_NODE.ImageIndex = index
|
||||
LEVEL4_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL4_NODE.Nodes.Add(LEVEL5_NODE)
|
||||
LEVEL3_NODE.Nodes.Add(LEVEL4_NODE)
|
||||
'### LEVEL 5 laden #######
|
||||
Dim expressionLevel6 As String
|
||||
expressionLevel6 = "TYPE_NODE = 6 AND PARENT_GUID = " & ID6 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel6() As DataRow
|
||||
foundRowsLevel6 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel6)
|
||||
Dim o As Integer
|
||||
For o = 0 To foundRowsLevel6.GetUpperBound(0)
|
||||
Dim ID7 = foundRowsLevel6(o)("GUID")
|
||||
Dim LevelEntity7 = foundRowsLevel6(o)("ENTITY_ID")
|
||||
Dim controlID7 = foundRowsLevel6(o)("CONTROL_ID")
|
||||
Dim nodetext7 = foundRowsLevel6(o)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel6(o)("RECORD_ID")
|
||||
Dim expressionLevel5 As String
|
||||
expressionLevel5 = "PARENT_GUID = " & ID5 'TYPE_NODE = 5 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel5() As DataRow
|
||||
foundRowsLevel5 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel5)
|
||||
Dim n As Integer
|
||||
For n = 0 To foundRowsLevel5.GetUpperBound(0)
|
||||
Dim ID6 = foundRowsLevel5(n)("GUID")
|
||||
Dim LevelEntity6 = foundRowsLevel5(n)("ENTITY_ID")
|
||||
Dim controlID6 = foundRowsLevel5(n)("CONTROL_ID")
|
||||
Dim nodetext6 = foundRowsLevel5(n)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel5(n)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel5(n)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL6_NODE As TreeNode
|
||||
LEVEL6_NODE = New TreeNode(nodetext7)
|
||||
Dim LEVEL5_NODE As TreeNode
|
||||
LEVEL5_NODE = New TreeNode(nodetext6)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL6_NODE.Tag = LevelEntity7 & "-CONTROL-ID" & controlID7.ToString & "#" & ID7 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL5_NODE.Tag = LevelEntity6 & "-CONTROL-ID" & controlID6.ToString & "#" & ID6 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL6_NODE.Tag = LevelEntity7 & "-CONTROL-ID" & controlID7.ToString & "#" & ID7
|
||||
LEVEL5_NODE.Tag = LevelEntity6 & "-CONTROL-ID" & controlID6.ToString & "#" & ID6
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "6" & LevelEntity7.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity6 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL6_NODE.ImageIndex = index
|
||||
LEVEL6_NODE.SelectedImageIndex = index
|
||||
LEVEL5_NODE.ImageIndex = index
|
||||
LEVEL5_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL5_NODE.Nodes.Add(LEVEL6_NODE)
|
||||
'### LEVEL 7 laden #######
|
||||
Dim expressionLevel7 As String
|
||||
expressionLevel7 = "TYPE_NODE = 7 AND PARENT_GUID = " & ID7 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel7() As DataRow
|
||||
foundRowsLevel7 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel7)
|
||||
Dim p As Integer
|
||||
For p = 0 To foundRowsLevel7.GetUpperBound(0)
|
||||
Dim ID8 = foundRowsLevel7(p)("GUID")
|
||||
Dim LevelEntity8 = foundRowsLevel7(p)("ENTITY_ID")
|
||||
Dim controlID8 = foundRowsLevel7(p)("CONTROL_ID")
|
||||
Dim nodetext8 = foundRowsLevel7(p)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel7(p)("RECORD_ID")
|
||||
LEVEL4_NODE.Nodes.Add(LEVEL5_NODE)
|
||||
'### LEVEL 5 laden #######
|
||||
Dim expressionLevel6 As String
|
||||
expressionLevel6 = "PARENT_GUID = " & ID6 'TYPE_NODE = 6 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel6() As DataRow
|
||||
foundRowsLevel6 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel6)
|
||||
Dim o As Integer
|
||||
For o = 0 To foundRowsLevel6.GetUpperBound(0)
|
||||
Dim ID7 = foundRowsLevel6(o)("GUID")
|
||||
Dim LevelEntity7 = foundRowsLevel6(o)("ENTITY_ID")
|
||||
Dim controlID7 = foundRowsLevel6(o)("CONTROL_ID")
|
||||
Dim nodetext7 = foundRowsLevel6(o)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel6(o)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel6(o)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL7_NODE As TreeNode
|
||||
LEVEL7_NODE = New TreeNode(nodetext8)
|
||||
Dim LEVEL6_NODE As TreeNode
|
||||
LEVEL6_NODE = New TreeNode(nodetext7)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL7_NODE.Tag = LevelEntity8 & "-CONTROL-ID" & controlID8.ToString & "#" & ID8 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL6_NODE.Tag = LevelEntity7 & "-CONTROL-ID" & controlID7.ToString & "#" & ID7 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL7_NODE.Tag = LevelEntity8 & "-CONTROL-ID" & controlID8.ToString & "#" & ID8
|
||||
LEVEL6_NODE.Tag = LevelEntity7 & "-CONTROL-ID" & controlID7.ToString & "#" & ID7
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "6" & LevelEntity8.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity7 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL7_NODE.ImageIndex = index
|
||||
LEVEL7_NODE.SelectedImageIndex = index
|
||||
LEVEL6_NODE.ImageIndex = index
|
||||
LEVEL6_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL6_NODE.Nodes.Add(LEVEL7_NODE)
|
||||
LEVEL5_NODE.Nodes.Add(LEVEL6_NODE)
|
||||
'### LEVEL 7 laden #######
|
||||
Dim expressionLevel8 As String
|
||||
expressionLevel8 = "TYPE_NODE = 7 AND PARENT_GUID = " & ID7 'Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel8() As DataRow
|
||||
foundRowsLevel8 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel8)
|
||||
Dim q As Integer
|
||||
For q = 0 To foundRowsLevel8.GetUpperBound(0)
|
||||
Dim ID9 = foundRowsLevel8(q)("GUID")
|
||||
Dim LevelEntity9 = foundRowsLevel8(q)("ENTITY_ID")
|
||||
Dim controlID9 = foundRowsLevel8(q)("CONTROL_ID")
|
||||
Dim nodetext9 = foundRowsLevel8(q)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel8(q)("RECORD_ID")
|
||||
Dim expressionLevel7 As String
|
||||
expressionLevel7 = "PARENT_GUID = " & ID7 'TYPE_NODE = 7 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel7() As DataRow
|
||||
foundRowsLevel7 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel7)
|
||||
Dim p As Integer
|
||||
For p = 0 To foundRowsLevel7.GetUpperBound(0)
|
||||
Dim ID8 = foundRowsLevel7(p)("GUID")
|
||||
Dim LevelEntity8 = foundRowsLevel7(p)("ENTITY_ID")
|
||||
Dim controlID8 = foundRowsLevel7(p)("CONTROL_ID")
|
||||
Dim nodetext8 = foundRowsLevel7(p)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel7(p)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel7(p)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL8_NODE As TreeNode
|
||||
LEVEL8_NODE = New TreeNode(nodetext9)
|
||||
Dim LEVEL7_NODE As TreeNode
|
||||
LEVEL7_NODE = New TreeNode(nodetext8)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL8_NODE.Tag = LevelEntity9 & "-CONTROL-ID" & controlID9.ToString & "#" & ID9 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
LEVEL7_NODE.Tag = LevelEntity8 & "-CONTROL-ID" & controlID8.ToString & "#" & ID8 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL8_NODE.Tag = LevelEntity9 & "-CONTROL-ID" & controlID9.ToString & "#" & ID9
|
||||
LEVEL7_NODE.Tag = LevelEntity8 & "-CONTROL-ID" & controlID8.ToString & "#" & ID8
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img.Replace("LEVEL#ENTITY", "") = "6" & LevelEntity9.ToString Then
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity8 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL8_NODE.ImageIndex = index
|
||||
LEVEL8_NODE.SelectedImageIndex = index
|
||||
LEVEL7_NODE.ImageIndex = index
|
||||
LEVEL7_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL7_NODE.Nodes.Add(LEVEL8_NODE)
|
||||
'### LEVEL 8 laden #######
|
||||
LEVEL6_NODE.Nodes.Add(LEVEL7_NODE)
|
||||
'### LEVEL 7 laden #######
|
||||
Dim expressionLevel8 As String
|
||||
expressionLevel8 = "PARENT_GUID = " & ID8 'TYPE_NODE = 7 AND Einschränkung auf Type und Parent_Guid
|
||||
Dim foundRowsLevel8() As DataRow
|
||||
foundRowsLevel8 = DT_TREEVIEW_PER_CONTROLS.Select(expressionLevel8)
|
||||
Dim q As Integer
|
||||
For q = 0 To foundRowsLevel8.GetUpperBound(0)
|
||||
Dim ID9 = foundRowsLevel8(q)("GUID")
|
||||
Dim LevelEntity9 = foundRowsLevel8(q)("ENTITY_ID")
|
||||
Dim controlID9 = foundRowsLevel8(q)("CONTROL_ID")
|
||||
Dim nodetext9 = foundRowsLevel8(q)("NODE_CAPTION")
|
||||
RECORD_ID = foundRowsLevel8(q)("RECORD_ID")
|
||||
NODE_CONFIG_ID = foundRowsLevel8(q)("NODE_CONFIG_ID")
|
||||
' Node erstellen..
|
||||
Dim LEVEL8_NODE As TreeNode
|
||||
LEVEL8_NODE = New TreeNode(nodetext9)
|
||||
If Not IsDBNull(RECORD_ID) Then
|
||||
LEVEL8_NODE.Tag = LevelEntity9 & "-CONTROL-ID" & controlID9.ToString & "#" & ID9 & "#RECORD-ID" & RECORD_ID.ToString
|
||||
Else
|
||||
LEVEL8_NODE.Tag = LevelEntity9 & "-CONTROL-ID" & controlID9.ToString & "#" & ID9
|
||||
End If
|
||||
|
||||
index = 0
|
||||
For Each img As String In TREEVIEW_IMAGELIST.Images.Keys
|
||||
If img = NODE_CONFIG_ID & "#" & LevelEntity9 Then
|
||||
Exit For
|
||||
End If
|
||||
index += 1
|
||||
Next
|
||||
LEVEL8_NODE.ImageIndex = index
|
||||
LEVEL8_NODE.SelectedImageIndex = index
|
||||
' ..und einfügen
|
||||
LEVEL7_NODE.Nodes.Add(LEVEL8_NODE)
|
||||
'### LEVEL 8 laden #######
|
||||
Next ' Level 7 Ende
|
||||
Next ' Level 7 Ende
|
||||
Next ' Level 7 Ende
|
||||
Next ' Level 6 Ende
|
||||
Next ' Level 5 Ende
|
||||
Next 'Level 4 Ende
|
||||
Next 'Level 3 Ende
|
||||
Next ' Level 2 Ende
|
||||
Next 'Level 1 Ende
|
||||
Next
|
||||
Next ' Level 6 Ende
|
||||
Next ' Level 5 Ende
|
||||
Next 'Level 4 Ende
|
||||
Next 'Level 3 Ende
|
||||
Next ' Level 2 Ende
|
||||
Next 'Level 1 Ende
|
||||
Next
|
||||
|
||||
|
||||
Else
|
||||
MsgBox("Check the Control Navigation Option or inform Digital Data!", MsgBoxStyle.Critical)
|
||||
Me.Close()
|
||||
End If
|
||||
Else
|
||||
MsgBox("Check the Control Navigation Option or inform Digital Data!", MsgBoxStyle.Critical)
|
||||
Me.Close()
|
||||
End If
|
||||
Else
|
||||
' LINQ für Zugriff auf DT_VWPMO_CONSTRUCTOR_FORMS
|
||||
Dim query1 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
Select form
|
||||
Order By form.Item("SEQUENCE")
|
||||
Where form.Item("PARENT_ID") = 0
|
||||
|
||||
Dim Rows1 = query1.ToList()
|
||||
|
||||
For Each LEVEL1ROW In Rows1
|
||||
Dim LEVEL0_NODE As TreeNode
|
||||
|
||||
Dim LEVEL2_NODE As TreeNode
|
||||
|
||||
'################## LEVEL 1 wird geladen ###########################
|
||||
Dim LEVEL1_TITLE = LEVEL1ROW.Item("CAPTION").ToString
|
||||
Dim NODE1_ENTITY_ID = LEVEL1ROW.Item("FORM_ID").ToString
|
||||
Dim ENTITY_ID = LEVEL1ROW.Item("FORM_ID")
|
||||
|
||||
' Rootnode erstellen und taggen
|
||||
LEVEL0_NODE = New TreeNode(LEVEL1_TITLE)
|
||||
LEVEL0_NODE.Tag = NODE1_ENTITY_ID
|
||||
' TreeView Rootnode einfügen
|
||||
TreeViewMain.Nodes.Add(LEVEL0_NODE)
|
||||
|
||||
'################## LEVEL 2 wird geladen #########
|
||||
Dim LEVEL1_NODE As TreeNode
|
||||
|
||||
Dim query2 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
' LINQ für Zugriff auf DT_VWPMO_CONSTRUCTOR_FORMS
|
||||
Dim query1 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
Select form
|
||||
Order By form.Item("SEQUENCE")
|
||||
Where form.Item("PARENT_ID") = NODE1_ENTITY_ID
|
||||
Where form.Item("PARENT_ID") = 0
|
||||
|
||||
Dim Rows2 = query2.ToList()
|
||||
For Each Row2 In Rows2
|
||||
Dim Rows1 = query1.ToList()
|
||||
|
||||
Dim LEVEL2_TITLE As String = Row2.Item("CAPTION").ToString
|
||||
Dim LEVEL2_ID As Integer = Row2.Item("FORM_ID")
|
||||
Dim LEVEL2_PARENT_ID As Integer = Row2.Item("PARENT_ID")
|
||||
For Each LEVEL1ROW In Rows1
|
||||
Dim LEVEL0_NODE As TreeNode
|
||||
|
||||
' Node erstellen..
|
||||
LEVEL1_NODE = New TreeNode(LEVEL2_TITLE)
|
||||
LEVEL1_NODE.Tag = LEVEL2_ID
|
||||
' ..und einfügen
|
||||
LEVEL0_NODE.Nodes.Add(LEVEL1_NODE)
|
||||
'##### LEVEL 3 wird geladen #########
|
||||
Dim query3 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
Select form
|
||||
Order By form.Item("SEQUENCE")
|
||||
Where form.Item("PARENT_ID") = LEVEL2_ID
|
||||
Dim LEVEL2_NODE As TreeNode
|
||||
|
||||
Dim Rows3 = query3.ToList()
|
||||
'################## LEVEL 1 wird geladen ###########################
|
||||
Dim LEVEL1_TITLE = LEVEL1ROW.Item("CAPTION").ToString
|
||||
Dim NODE1_ENTITY_ID = LEVEL1ROW.Item("FORM_ID").ToString
|
||||
Dim ENTITY_ID = LEVEL1ROW.Item("FORM_ID")
|
||||
|
||||
For Each Row3 In Rows3
|
||||
' Rootnode erstellen und taggen
|
||||
LEVEL0_NODE = New TreeNode(LEVEL1_TITLE)
|
||||
LEVEL0_NODE.Tag = NODE1_ENTITY_ID
|
||||
' TreeView Rootnode einfügen
|
||||
TreeViewMain.Nodes.Add(LEVEL0_NODE)
|
||||
|
||||
Dim LEVEL3_TITLE As String = Row3.Item("CAPTION")
|
||||
Dim LEVEL3_ID As Integer = Row3.Item("FORM_ID")
|
||||
'################## LEVEL 2 wird geladen #########
|
||||
Dim LEVEL1_NODE As TreeNode
|
||||
|
||||
Dim query2 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
Select form
|
||||
Order By form.Item("SEQUENCE")
|
||||
Where form.Item("PARENT_ID") = NODE1_ENTITY_ID
|
||||
|
||||
Dim Rows2 = query2.ToList()
|
||||
For Each Row2 In Rows2
|
||||
|
||||
Dim LEVEL2_TITLE As String = Row2.Item("CAPTION").ToString
|
||||
Dim LEVEL2_ID As Integer = Row2.Item("FORM_ID")
|
||||
Dim LEVEL2_PARENT_ID As Integer = Row2.Item("PARENT_ID")
|
||||
|
||||
' Node erstellen..
|
||||
LEVEL2_NODE = New TreeNode(LEVEL3_TITLE)
|
||||
LEVEL2_NODE.Tag = LEVEL3_ID
|
||||
LEVEL1_NODE = New TreeNode(LEVEL2_TITLE)
|
||||
LEVEL1_NODE.Tag = LEVEL2_ID
|
||||
' ..und einfügen
|
||||
LEVEL1_NODE.Nodes.Add(LEVEL2_NODE)
|
||||
LEVEL0_NODE.Nodes.Add(LEVEL1_NODE)
|
||||
'##### LEVEL 3 wird geladen #########
|
||||
Dim query3 = From form In DT_VWPMO_CONSTRUCTOR_FORMS.AsEnumerable()
|
||||
Select form
|
||||
Order By form.Item("SEQUENCE")
|
||||
Where form.Item("PARENT_ID") = LEVEL2_ID
|
||||
|
||||
Dim Rows3 = query3.ToList()
|
||||
|
||||
For Each Row3 In Rows3
|
||||
|
||||
Dim LEVEL3_TITLE As String = Row3.Item("CAPTION")
|
||||
Dim LEVEL3_ID As Integer = Row3.Item("FORM_ID")
|
||||
|
||||
' Node erstellen..
|
||||
LEVEL2_NODE = New TreeNode(LEVEL3_TITLE)
|
||||
LEVEL2_NODE.Tag = LEVEL3_ID
|
||||
' ..und einfügen
|
||||
LEVEL1_NODE.Nodes.Add(LEVEL2_NODE)
|
||||
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
If NODE_NAVIGATION = False Then
|
||||
TreeViewMain.ExpandAll()
|
||||
End If
|
||||
TreeViewMain.Nodes(0).EnsureVisible()
|
||||
End If
|
||||
If NODE_NAVIGATION = False Then
|
||||
TreeViewMain.ExpandAll()
|
||||
End If
|
||||
TreeViewMain.Nodes(0).EnsureVisible()
|
||||
|
||||
sw.Done()
|
||||
sw.Done()
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Load TreeView:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Sub Create_variable_node()
|
||||
|
||||
Reference in New Issue
Block a user