Initial commit
This commit is contained in:
74
EDOKA/Backup1/Utils/AvaloqDokumentWerte.vb
Normal file
74
EDOKA/Backup1/Utils/AvaloqDokumentWerte.vb
Normal file
@@ -0,0 +1,74 @@
|
||||
Imports System.IO
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Schema
|
||||
|
||||
Public Class AvaloqDokumentWerte
|
||||
|
||||
#Region "Members"
|
||||
Private arrDoukmentWerte As New ArrayList()
|
||||
Private objDokumentWert As AvaloqDokumentWert
|
||||
#End Region
|
||||
|
||||
#Region "Public methods"
|
||||
|
||||
'''<summary>Lädt externes Xml file für automatisierte Aktionen</summary>
|
||||
'''<param name="xmlImportFile">Das Xml File mit den entsprechenden Parametern</param>
|
||||
Public Function init(ByVal xmlImportFile As FileInfo)
|
||||
Try
|
||||
|
||||
Dim doc As New XmlDocument()
|
||||
|
||||
doc.Load(xmlImportFile.FullName)
|
||||
|
||||
'read all parameter nodes
|
||||
Dim parameterNodes As XmlNodeList
|
||||
parameterNodes = doc.SelectNodes("action/dokwerte/parameter")
|
||||
|
||||
If parameterNodes.Count > 0 Then
|
||||
Dim node As XmlNode
|
||||
Dim name, value, dataType As String
|
||||
|
||||
Dim parameterCounter As Integer = 0
|
||||
|
||||
For Each node In parameterNodes
|
||||
'Read all Document specified Values
|
||||
'20080401 RGL zusätzliches TRY wenn node <parameter> leer geliefert wird kein Absturz
|
||||
Try
|
||||
name = node.SelectSingleNode("name").InnerText
|
||||
value = node.SelectSingleNode("value").InnerText
|
||||
objDokumentWert = New AvaloqDokumentWert(name, value)
|
||||
arrDoukmentWerte.Add(objDokumentWert)
|
||||
Catch ex As Exception
|
||||
TKBLib.Errorhandling.TraceHelper.Msg("EdokaLib.Common.Action.Load", ex.Message & ex.StackTrace, TraceLevel.Error)
|
||||
End Try
|
||||
parameterCounter = parameterCounter + 1
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
TKBLib.Errorhandling.TraceHelper.Msg("EdokaLib.Common.Action.Load", ex.Message & ex.StackTrace, TraceLevel.Error)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function getAvaloqDokumentWertByName(ByVal name As String) As AvaloqDokumentWert
|
||||
Dim objRet As AvaloqDokumentWert = Nothing
|
||||
Dim i As Integer
|
||||
|
||||
For i = 0 To arrDoukmentWerte.Count - 1
|
||||
If arrDoukmentWerte(i).name = name Then
|
||||
objRet = arrDoukmentWerte(i)
|
||||
End If
|
||||
Next
|
||||
Return objRet
|
||||
End Function
|
||||
|
||||
'20080401 RGL Funktion zum Löschen der Werte, damit nicht 2x abgefüllt (auch bei manuellem Erstellen)
|
||||
Public Sub clearAvaloqDokumentWerte()
|
||||
arrDoukmentWerte.Clear()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user