Initial commit
This commit is contained in:
@@ -0,0 +1,258 @@
|
||||
-- ================================================================================================================
|
||||
-- Stored Procedures generated by LLBLGen v1.21.2003.712 Final on Mittwoch, 30. November 2016, 11:18:45
|
||||
-- For the Low Level Business Logic Layer for the database 'assessmentmgmt'
|
||||
-- ================================================================================================================
|
||||
SET NOCOUNT ON
|
||||
GO
|
||||
USE [assessmentmgmt]
|
||||
GO
|
||||
|
||||
-- ========================================================================================================
|
||||
-- [Stored Procedures generated for table: PruefSchrittResultat]
|
||||
GO
|
||||
|
||||
-- //// Insert Stored procedure.
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_PruefSchrittResultat_Insert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_PruefSchrittResultat_Insert]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
-- Stored procedure that will insert 1 row in the table 'PruefSchrittResultat'
|
||||
-- Gets: @iPruefSchrittResultatNr int
|
||||
-- Gets: @iPruefschrittNr int
|
||||
-- Gets: @iPruefschrittResultatStatusNr int
|
||||
-- Gets: @sKurzbeschreibung varchar(1024)
|
||||
-- Gets: @sBeschreibung varchar(4096)
|
||||
-- Gets: @bAktiv bit
|
||||
-- Gets: @daErstellt_am datetime
|
||||
-- Gets: @daMutiert_am datetime
|
||||
-- Gets: @iMutierer int
|
||||
-- Gets: @iAnzahl_Pruefungen int
|
||||
-- Gets: @iFindings_niedrig int
|
||||
-- Gets: @iFindings_mittel int
|
||||
-- Gets: @iFindings_hoch int
|
||||
-- Gets: @iFinding_kein int
|
||||
-- Returns: @iErrorCode int
|
||||
---------------------------------------------------------------------------------
|
||||
CREATE PROCEDURE [dbo].[pr_PruefSchrittResultat_Insert]
|
||||
@iPruefSchrittResultatNr int,
|
||||
@iPruefschrittNr int,
|
||||
@iPruefschrittResultatStatusNr int,
|
||||
@sKurzbeschreibung varchar(1024),
|
||||
@sBeschreibung varchar(4096),
|
||||
@bAktiv bit,
|
||||
@daErstellt_am datetime,
|
||||
@daMutiert_am datetime,
|
||||
@iMutierer int,
|
||||
@iAnzahl_Pruefungen int,
|
||||
@iFindings_niedrig int,
|
||||
@iFindings_mittel int,
|
||||
@iFindings_hoch int,
|
||||
@iFinding_kein int,
|
||||
@iErrorCode int OUTPUT
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
-- INSERT a new row in the table.
|
||||
INSERT [dbo].[PruefSchrittResultat]
|
||||
(
|
||||
[PruefSchrittResultatNr],
|
||||
[PruefschrittNr],
|
||||
[PruefschrittResultatStatusNr],
|
||||
[Kurzbeschreibung],
|
||||
[Beschreibung],
|
||||
[Aktiv],
|
||||
[Erstellt_am],
|
||||
[Mutiert_am],
|
||||
[Mutierer],
|
||||
[Anzahl_Pruefungen],
|
||||
[Findings_niedrig],
|
||||
[Findings_mittel],
|
||||
[Findings_hoch],
|
||||
[Finding_kein]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@iPruefSchrittResultatNr,
|
||||
@iPruefschrittNr,
|
||||
@iPruefschrittResultatStatusNr,
|
||||
@sKurzbeschreibung,
|
||||
@sBeschreibung,
|
||||
@bAktiv,
|
||||
@daErstellt_am,
|
||||
@daMutiert_am,
|
||||
@iMutierer,
|
||||
@iAnzahl_Pruefungen,
|
||||
@iFindings_niedrig,
|
||||
@iFindings_mittel,
|
||||
@iFindings_hoch,
|
||||
@iFinding_kein
|
||||
)
|
||||
-- Get the Error Code for the statement just executed.
|
||||
SELECT @iErrorCode=@@ERROR
|
||||
GO
|
||||
|
||||
|
||||
-- //// Update Stored procedure for updating one single row.
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_PruefSchrittResultat_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_PruefSchrittResultat_Update]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
-- Stored procedure that will update an existing row in the table 'PruefSchrittResultat'
|
||||
-- Gets: @iPruefSchrittResultatNr int
|
||||
-- Gets: @iPruefschrittNr int
|
||||
-- Gets: @iPruefschrittResultatStatusNr int
|
||||
-- Gets: @sKurzbeschreibung varchar(1024)
|
||||
-- Gets: @sBeschreibung varchar(4096)
|
||||
-- Gets: @bAktiv bit
|
||||
-- Gets: @daErstellt_am datetime
|
||||
-- Gets: @daMutiert_am datetime
|
||||
-- Gets: @iMutierer int
|
||||
-- Gets: @iAnzahl_Pruefungen int
|
||||
-- Gets: @iFindings_niedrig int
|
||||
-- Gets: @iFindings_mittel int
|
||||
-- Gets: @iFindings_hoch int
|
||||
-- Gets: @iFinding_kein int
|
||||
-- Returns: @iErrorCode int
|
||||
---------------------------------------------------------------------------------
|
||||
CREATE PROCEDURE [dbo].[pr_PruefSchrittResultat_Update]
|
||||
@iPruefSchrittResultatNr int,
|
||||
@iPruefschrittNr int,
|
||||
@iPruefschrittResultatStatusNr int,
|
||||
@sKurzbeschreibung varchar(1024),
|
||||
@sBeschreibung varchar(4096),
|
||||
@bAktiv bit,
|
||||
@daErstellt_am datetime,
|
||||
@daMutiert_am datetime,
|
||||
@iMutierer int,
|
||||
@iAnzahl_Pruefungen int,
|
||||
@iFindings_niedrig int,
|
||||
@iFindings_mittel int,
|
||||
@iFindings_hoch int,
|
||||
@iFinding_kein int,
|
||||
@iErrorCode int OUTPUT
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
-- UPDATE an existing row in the table.
|
||||
UPDATE [dbo].[PruefSchrittResultat]
|
||||
SET
|
||||
[PruefschrittNr] = @iPruefschrittNr,
|
||||
[PruefschrittResultatStatusNr] = @iPruefschrittResultatStatusNr,
|
||||
[Kurzbeschreibung] = @sKurzbeschreibung,
|
||||
[Beschreibung] = @sBeschreibung,
|
||||
[Aktiv] = @bAktiv,
|
||||
[Erstellt_am] = @daErstellt_am,
|
||||
[Mutiert_am] = @daMutiert_am,
|
||||
[Mutierer] = @iMutierer,
|
||||
[Anzahl_Pruefungen] = @iAnzahl_Pruefungen,
|
||||
[Findings_niedrig] = @iFindings_niedrig,
|
||||
[Findings_mittel] = @iFindings_mittel,
|
||||
[Findings_hoch] = @iFindings_hoch,
|
||||
[Finding_kein] = @iFinding_kein
|
||||
WHERE
|
||||
[PruefSchrittResultatNr] = @iPruefSchrittResultatNr
|
||||
-- Get the Error Code for the statement just executed.
|
||||
SELECT @iErrorCode=@@ERROR
|
||||
GO
|
||||
|
||||
|
||||
-- //// Delete Stored procedure using Primary Key.
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_PruefSchrittResultat_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_PruefSchrittResultat_Delete]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
-- Stored procedure that will delete an existing row from the table 'PruefSchrittResultat'
|
||||
-- using the Primary Key.
|
||||
-- Gets: @iPruefSchrittResultatNr int
|
||||
-- Returns: @iErrorCode int
|
||||
---------------------------------------------------------------------------------
|
||||
CREATE PROCEDURE [dbo].[pr_PruefSchrittResultat_Delete]
|
||||
@iPruefSchrittResultatNr int,
|
||||
@iErrorCode int OUTPUT
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
-- DELETE an existing row from the table.
|
||||
DELETE FROM [dbo].[PruefSchrittResultat]
|
||||
WHERE
|
||||
[PruefSchrittResultatNr] = @iPruefSchrittResultatNr
|
||||
-- Get the Error Code for the statement just executed.
|
||||
SELECT @iErrorCode=@@ERROR
|
||||
GO
|
||||
|
||||
|
||||
-- //// Select Stored procedure, based on Primary Key.
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_PruefSchrittResultat_SelectOne]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_PruefSchrittResultat_SelectOne]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
-- Stored procedure that will select an existing row from the table 'PruefSchrittResultat'
|
||||
-- based on the Primary Key.
|
||||
-- Gets: @iPruefSchrittResultatNr int
|
||||
-- Returns: @iErrorCode int
|
||||
---------------------------------------------------------------------------------
|
||||
CREATE PROCEDURE [dbo].[pr_PruefSchrittResultat_SelectOne]
|
||||
@iPruefSchrittResultatNr int,
|
||||
@iErrorCode int OUTPUT
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
-- SELECT an existing row from the table.
|
||||
SELECT
|
||||
[PruefSchrittResultatNr],
|
||||
[PruefschrittNr],
|
||||
[PruefschrittResultatStatusNr],
|
||||
[Kurzbeschreibung],
|
||||
[Beschreibung],
|
||||
[Aktiv],
|
||||
[Erstellt_am],
|
||||
[Mutiert_am],
|
||||
[Mutierer],
|
||||
[Anzahl_Pruefungen],
|
||||
[Findings_niedrig],
|
||||
[Findings_mittel],
|
||||
[Findings_hoch],
|
||||
[Finding_kein]
|
||||
FROM [dbo].[PruefSchrittResultat]
|
||||
WHERE
|
||||
[PruefSchrittResultatNr] = @iPruefSchrittResultatNr
|
||||
-- Get the Error Code for the statement just executed.
|
||||
SELECT @iErrorCode=@@ERROR
|
||||
GO
|
||||
|
||||
|
||||
-- //// Select All Stored procedure.
|
||||
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_PruefSchrittResultat_SelectAll]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_PruefSchrittResultat_SelectAll]
|
||||
GO
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
-- Stored procedure that will select all rows from the table 'PruefSchrittResultat'
|
||||
-- Returns: @iErrorCode int
|
||||
---------------------------------------------------------------------------------
|
||||
CREATE PROCEDURE [dbo].[pr_PruefSchrittResultat_SelectAll]
|
||||
@iErrorCode int OUTPUT
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
-- SELECT all rows from the table.
|
||||
SELECT
|
||||
[PruefSchrittResultatNr],
|
||||
[PruefschrittNr],
|
||||
[PruefschrittResultatStatusNr],
|
||||
[Kurzbeschreibung],
|
||||
[Beschreibung],
|
||||
[Aktiv],
|
||||
[Erstellt_am],
|
||||
[Mutiert_am],
|
||||
[Mutierer],
|
||||
[Anzahl_Pruefungen],
|
||||
[Findings_niedrig],
|
||||
[Findings_mittel],
|
||||
[Findings_hoch],
|
||||
[Finding_kein]
|
||||
FROM [dbo].[PruefSchrittResultat]
|
||||
ORDER BY
|
||||
[PruefSchrittResultatNr] ASC
|
||||
-- Get the Error Code for the statement just executed.
|
||||
SELECT @iErrorCode=@@ERROR
|
||||
GO
|
||||
|
||||
|
||||
-- [End of Stored Procedures for table: PruefSchrittResultat]
|
||||
-- ========================================================================================================
|
||||
GO
|
||||
Binary file not shown.
@@ -0,0 +1,412 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
Imports DevComponents
|
||||
Imports DropDownControls
|
||||
|
||||
Public Class clsISIUebersicht
|
||||
Dim SpaltenTitel As New Utils.Tabellenspalte
|
||||
Dim daten As New DataTable
|
||||
|
||||
Public Sub Get_Data(ByRef c1daten As C1.Win.C1TrueDBGrid.C1TrueDBGrid, ByVal Typ As Integer)
|
||||
Try
|
||||
Dim ds As New DataSet
|
||||
Dim connection As New SqlConnection()
|
||||
Dim da As New SqlDataAdapter("", connection)
|
||||
Dim sqlcmd As New SqlCommand
|
||||
|
||||
sqlcmd.CommandText = "sp_get_isidata"
|
||||
sqlcmd.Parameters.Add(New SqlParameter("@typ", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Typ))
|
||||
sqlcmd.CommandType = CommandType.StoredProcedure
|
||||
sqlcmd.Connection = connection
|
||||
Try
|
||||
connection.ConnectionString = Globals.sConnectionString
|
||||
connection.Open()
|
||||
da.SelectCommand = sqlcmd
|
||||
da.Fill(ds, "Datatable1")
|
||||
Dim status As New clsStatus
|
||||
c1daten.DataSource = Nothing
|
||||
c1daten.DataSource = ds.Tables(0)
|
||||
c1daten.DataMember = ds.Tables(0).TableName
|
||||
SpaltenTitel.Spaltentitel_aktualisieren(c1daten, "Pruefschritt", ds.Tables(0))
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Finally
|
||||
connection.Close()
|
||||
da.Dispose()
|
||||
sqlcmd.Dispose()
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IsiTree
|
||||
#Region "Deklarationen"
|
||||
|
||||
Dim treedata As New DataSet
|
||||
|
||||
Dim TreeaufbauSuche As Boolean = False
|
||||
Dim TreeaufbauNr As Integer = 0
|
||||
Dim FoundNode As Integer = 0
|
||||
Dim Searchstring As String = ""
|
||||
Public Treesearch As New AdvTree.AdvTree
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "Tree"
|
||||
|
||||
Public Sub Load_Treeview(ByRef tree As DevComponents.AdvTree.AdvTree)
|
||||
tree.Nodes.Clear()
|
||||
TreeaufbauNr = -1
|
||||
Load_Treedata("")
|
||||
If Not (treedata Is Nothing) Then
|
||||
Dim oView As DataView = treedata.Tables(0).DefaultView
|
||||
Dim oTable As DataTable = oView.Table
|
||||
Dim oDS As DataSet = New DataSet()
|
||||
oDS.Tables.Add(oTable.Copy())
|
||||
|
||||
If oDS.Relations.Contains("SelfRefenceRelation") = False Then
|
||||
oDS.Relations.Add("SelfRefenceRelation",
|
||||
oDS.Tables(0).Columns("id"),
|
||||
oDS.Tables(0).Columns("Parentid"))
|
||||
End If
|
||||
oTable.Dispose()
|
||||
oTable = Nothing
|
||||
|
||||
LoadTreeView(oDS, tree)
|
||||
oDS.Dispose()
|
||||
oDS = Nothing
|
||||
tree.ExpandAll()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function Load_Treedata(ByVal datatype As String) As DataTable
|
||||
treedata.Tables.Clear()
|
||||
Dim selectcommand As New SqlCommand
|
||||
Dim connection As New SqlConnection()
|
||||
Dim da As New SqlDataAdapter("", connection)
|
||||
|
||||
selectcommand.CommandText = "sp_get_Isi_Struktur"
|
||||
selectcommand.Parameters.Add("@Root", SqlDbType.VarChar)
|
||||
selectcommand.Parameters(0).Value = datatype
|
||||
selectcommand.CommandType = CommandType.StoredProcedure
|
||||
selectcommand.Connection = connection
|
||||
Try
|
||||
connection.ConnectionString = Globals.sConnectionString
|
||||
connection.Open()
|
||||
da.SelectCommand = selectcommand
|
||||
da.Fill(treedata, "Tree")
|
||||
If treedata_for_search.Rows.Count < 1 Then
|
||||
For Each c As DataColumn In treedata.Tables(0).Columns
|
||||
If c.ColumnName = "ErweiterteSuche" Then
|
||||
Dim dc As New DataColumn
|
||||
dc.ColumnName = "ErweiterteSuche"
|
||||
dc.DataType = System.Type.GetType("System.String")
|
||||
dc.DefaultValue = " "
|
||||
Try
|
||||
Globals.treedata_for_search.Columns.Add(dc)
|
||||
Catch
|
||||
End Try
|
||||
Else
|
||||
Try
|
||||
Globals.treedata_for_search.Columns.Add(c.ColumnName)
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
For Each row As DataRow In treedata.Tables(0).Rows
|
||||
Globals.treedata_for_search.ImportRow(row)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
'MsgBox(ex.Message)
|
||||
Finally
|
||||
connection.Close()
|
||||
da.Dispose()
|
||||
selectcommand.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Protected Function GetAllNodes(ByVal treestruktur As DevComponents.AdvTree.AdvTree) As List(Of TreeNode)
|
||||
|
||||
Dim allNodes As List(Of TreeNode) = New List(Of TreeNode)()
|
||||
|
||||
' start recursion for each root node of the treeview
|
||||
For i As Integer = 0 To treestruktur.Nodes.Count - 1
|
||||
GetAllNodes(treestruktur.Nodes(i), allNodes)
|
||||
Next
|
||||
|
||||
Return allNodes
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub GetAllNodes(ByVal subRoot As DevComponents.AdvTree.Node, ByVal allNodes As List(Of TreeNode))
|
||||
|
||||
' check for null (this can be removed since within th
|
||||
If (subRoot Is Nothing) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' add subroot
|
||||
Dim r As DataRow
|
||||
r = treedata_for_search.NewRow
|
||||
r.Item(0) = subRoot.Tag
|
||||
Try
|
||||
r.Item(1) = subRoot.Parent.Tag
|
||||
Catch
|
||||
r.Item(1) = 0
|
||||
End Try
|
||||
|
||||
r.Item(2) = subRoot.Text
|
||||
r.Item(3) = subRoot.ImageIndex
|
||||
treedata_for_search.Rows.Add(r)
|
||||
'allNodes.Add(subRoot)
|
||||
' add all it's children
|
||||
For i As Integer = 0 To subRoot.Nodes.Count - 1
|
||||
GetAllNodes(subRoot.Nodes(i), allNodes)
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Tree aufbauen
|
||||
''' </summary>
|
||||
''' <param name="oDS"></param>
|
||||
''' <param name="oTreeview"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub LoadTreeView(ByVal oDS As DataSet, ByRef oTreeview As DevComponents.AdvTree.AdvTree)
|
||||
'Dim oTreeView As TreeView = New TreeView()
|
||||
Dim oDataRow As DataRow
|
||||
For Each oDataRow In oDS.Tables(0).Rows
|
||||
If Not oDataRow.IsNull("Parentid") Then
|
||||
If oDataRow.Item("Parentid") = 0 Then
|
||||
'If oDataRow.IsNull("Parentid") Then
|
||||
Dim oNode As New DevComponents.AdvTree.Node
|
||||
oNode.Text = Trim(oDataRow("Bezeichnung").ToString())
|
||||
Try
|
||||
'oNode.ToolTipText = Trim(oDataRow("ErweiterteSuche").ToString)
|
||||
Catch
|
||||
End Try
|
||||
oNode.Tag = oDataRow("id").ToString
|
||||
oNode.ImageIndex = oDataRow("ImageIndex")
|
||||
oTreeview.Nodes.Add(oNode)
|
||||
RecursivelyLoadTree(oDataRow, oNode)
|
||||
End If
|
||||
End If
|
||||
Next oDataRow
|
||||
oDS.Dispose()
|
||||
oDS = Nothing
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Child-Nodes hinzufügen
|
||||
''' </summary>
|
||||
''' <param name="oDataRow"></param>
|
||||
''' <param name="oNode"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub RecursivelyLoadTree(ByVal oDataRow As DataRow, ByRef oNode As DevComponents.AdvTree.Node)
|
||||
Dim oChildRow As DataRow
|
||||
For Each oChildRow In oDataRow.GetChildRows("SelfRefenceRelation")
|
||||
Dim oChildNode As New DevComponents.AdvTree.Node
|
||||
oChildNode.Text = Trim(oChildRow("Bezeichnung").ToString())
|
||||
oChildNode.Tag = oChildRow("id").ToString()
|
||||
oChildNode.ImageIndex = oChildRow("ImageIndex")
|
||||
|
||||
oNode.Nodes.Add(oChildNode)
|
||||
RecursivelyLoadTree(oChildRow, oChildNode)
|
||||
Next oChildRow
|
||||
End Sub
|
||||
Public Function FindNode(ByVal _nodeCollection As AdvTree.NodeCollection, ByVal SearchVal As Integer, ByVal SearchString As String) As AdvTree.Node
|
||||
Dim tmpNode As AdvTree.Node
|
||||
For Each _child As AdvTree.Node In _nodeCollection
|
||||
If _child.Tag = SearchVal Then
|
||||
|
||||
Return _child
|
||||
End If
|
||||
' If InStr(UCase(_child.Text), UCase(SearchString)) > 0 Then
|
||||
' Return _child
|
||||
' End If
|
||||
tmpNode = FindNode(_child.Nodes, SearchVal, SearchString)
|
||||
If Not tmpNode Is Nothing Then
|
||||
Return tmpNode
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
|
||||
Public Function Init_Search()
|
||||
FoundNode = 0
|
||||
Searchstring = ""
|
||||
Me.Treesearch.Nodes.Clear()
|
||||
End Function
|
||||
|
||||
Public Function SearchNode(ByRef tree As AdvTree.AdvTree, ByVal SearchString As String) As AdvTree.Node
|
||||
'Return tree.FindNodeByCellText(SearchString)
|
||||
|
||||
Me.Treesearch.Nodes.Clear()
|
||||
For Each dr As DataRow In treedata_for_search.Rows
|
||||
'InStr(UCase(SearchString), UCase(dr.Item("Bezeichnung")))
|
||||
If InStr(UCase(dr.Item("Bezeichnung")), UCase(SearchString)) > 0 Or InStr(UCase(dr.Item("ErweiterteSuche")), UCase(SearchString)) > 0 Then
|
||||
Dim tn As New AdvTree.Node
|
||||
tn.Text = dr.Item("Bezeichnung")
|
||||
tn.Tag = dr.Item("id")
|
||||
Treesearch.Nodes.Add(tn)
|
||||
End If
|
||||
Next
|
||||
Return FindFirst(tree)
|
||||
End Function
|
||||
|
||||
Public Function FindFirst(ByRef Tree As AdvTree.AdvTree) As AdvTree.Node
|
||||
Try
|
||||
If Me.Treesearch.Nodes.Count > 0 Then Me.Treesearch.SelectedNode = Me.Treesearch.Nodes(0)
|
||||
Return FindNode(Tree.Nodes, Treesearch.SelectedNode.Tag, "")
|
||||
Catch
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function FindNextNode(ByRef tree As AdvTree.AdvTree) As AdvTree.Node
|
||||
Try
|
||||
Treesearch.SelectedNode = Treesearch.SelectedNode.NextNode
|
||||
If Treesearch.SelectedNode Is Nothing Then
|
||||
Return FindFirst(tree)
|
||||
End If
|
||||
Return Me.FindNode(tree.Nodes, Treesearch.SelectedNode.Tag, "")
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function FindPrevNode(ByRef tree As AdvTree.AdvTree) As AdvTree.Node
|
||||
Try
|
||||
Treesearch.SelectedNode = Treesearch.SelectedNode.PrevNode
|
||||
If Treesearch.SelectedNode Is Nothing Then
|
||||
Return FindLastNode(tree)
|
||||
End If
|
||||
Return Me.FindNode(tree.Nodes, Treesearch.SelectedNode.Tag, "")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function FindLastNode(ByRef tree As AdvTree.AdvTree) As AdvTree.Node
|
||||
Try
|
||||
Treesearch.SelectedNode = Treesearch.Nodes(Treesearch.Nodes.Count - 1)
|
||||
Return Me.FindNode(tree.Nodes, Treesearch.SelectedNode.Tag, "")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "ComboboxTree"
|
||||
|
||||
Public Sub Load_ComboboxTree(ByRef tree As Object)
|
||||
tree.Nodes.Clear()
|
||||
TreeaufbauNr = -1
|
||||
Load_Treedata("")
|
||||
If Not (treedata Is Nothing) Then
|
||||
Dim oView As DataView = treedata.Tables(0).DefaultView
|
||||
Dim oTable As DataTable = oView.Table
|
||||
Dim oDS As DataSet = New DataSet()
|
||||
oDS.Tables.Add(oTable.Copy())
|
||||
|
||||
If oDS.Relations.Contains("SelfRefenceRelation") = False Then
|
||||
oDS.Relations.Add("SelfRefenceRelation",
|
||||
oDS.Tables(0).Columns("id"),
|
||||
oDS.Tables(0).Columns("Parentid"))
|
||||
End If
|
||||
oTable.Dispose()
|
||||
oTable = Nothing
|
||||
|
||||
LoadTreeView1(oDS, tree)
|
||||
oDS.Dispose()
|
||||
oDS = Nothing
|
||||
tree.ExpandAll()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadTreeView1(ByVal oDS As DataSet, ByRef oTreeview As Object)
|
||||
'Dim oTreeView As TreeView = New TreeView()
|
||||
Dim oDataRow As DataRow
|
||||
For Each oDataRow In oDS.Tables(0).Rows
|
||||
If Not oDataRow.IsNull("Parentid") Then
|
||||
If oDataRow.Item("Parentid") = 0 Then
|
||||
'If oDataRow.IsNull("Parentid") Then
|
||||
Dim oNode As New ComboTreeNode
|
||||
oNode.Text = Trim(oDataRow("Bezeichnung").ToString())
|
||||
Try
|
||||
'oNode.ToolTipText = Trim(oDataRow("ErweiterteSuche").ToString)
|
||||
Catch
|
||||
End Try
|
||||
oNode.Tag = oDataRow("id").ToString
|
||||
oNode.ImageIndex = oDataRow("ImageIndex")
|
||||
oTreeview.Nodes.Add(oNode)
|
||||
RecursivelyLoadTree1(oDataRow, oNode)
|
||||
End If
|
||||
End If
|
||||
Next oDataRow
|
||||
oDS.Dispose()
|
||||
oDS = Nothing
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' Child-Nodes hinzufügen
|
||||
''' </summary>
|
||||
''' <param name="oDataRow"></param>
|
||||
''' <param name="oNode"></param>
|
||||
''' <remarks></remarks>
|
||||
Private Sub RecursivelyLoadTree1(ByVal oDataRow As DataRow, ByRef oNode As ComboTreeNode)
|
||||
Dim oChildRow As DataRow
|
||||
For Each oChildRow In oDataRow.GetChildRows("SelfRefenceRelation")
|
||||
Dim oChildNode As New ComboTreeNode
|
||||
oChildNode.Text = Trim(oChildRow("Bezeichnung").ToString())
|
||||
oChildNode.Tag = oChildRow("id").ToString()
|
||||
oChildNode.ImageIndex = oChildRow("ImageIndex")
|
||||
|
||||
oNode.Nodes.Add(oChildNode)
|
||||
RecursivelyLoadTree1(oChildRow, oChildNode)
|
||||
Next oChildRow
|
||||
End Sub
|
||||
|
||||
Public Function ComboboxTree_FindNode(ByVal _nodeCollection As ComboTreeNodeCollection, ByVal SearchVal As Integer, ByVal SearchString As String) As ComboTreeNode
|
||||
Dim tmpNode As ComboTreeNode
|
||||
For Each _child As ComboTreeNode In _nodeCollection
|
||||
If _child.Tag = SearchVal Then
|
||||
|
||||
Return _child
|
||||
End If
|
||||
' If InStr(UCase(_child.Text), UCase(SearchString)) > 0 Then
|
||||
' Return _child
|
||||
' End If
|
||||
tmpNode = ComboboxTree_FindNode(_child.Nodes, SearchVal, SearchString)
|
||||
If Not tmpNode Is Nothing Then
|
||||
Return tmpNode
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
3503
.svn/pristine/00/0078788ce228eb0b83e76da5d21686f9b9e4208c.svn-base
Normal file
3503
.svn/pristine/00/0078788ce228eb0b83e76da5d21686f9b9e4208c.svn-base
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user