Initial commit
This commit is contained in:
431
EDOKA/Utils/AvaloqDokumentWerte.vb
Normal file
431
EDOKA/Utils/AvaloqDokumentWerte.vb
Normal file
@@ -0,0 +1,431 @@
|
||||
Imports System.IO
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Schema
|
||||
<Serializable()> _
|
||||
Public Class AvaloqDokumentWerte
|
||||
|
||||
Dim m_Partnernr As Integer
|
||||
Property Partnernr As Integer
|
||||
Get
|
||||
Return m_Partnernr
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Partnernr = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Personnr As Integer
|
||||
Property PersonNr As Integer
|
||||
Get
|
||||
Return m_Personnr
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Personnr = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_fanummer3 As String
|
||||
Property FANummer3 As String
|
||||
Get
|
||||
Return m_fanummer3
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_fanummer3 = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_ordernr As String
|
||||
Property Ordernr As String
|
||||
Get
|
||||
Return m_ordernr
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ordernr = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_dokumenttypnr As String
|
||||
Property Dokumenttypnr As String
|
||||
Get
|
||||
Return m_dokumenttypnr
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_dokumenttypnr = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_direkteErstellung As String
|
||||
Property Direkteerstellung As String
|
||||
Get
|
||||
Return m_direkteErstellung
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_direkteErstellung = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_dokumentpaket As String
|
||||
Property Dokumentpaket As String
|
||||
Get
|
||||
Return m_dokumentpaket
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_dokumentpaket = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Postzustellung As String
|
||||
Property Postzustellung As String
|
||||
Get
|
||||
Return m_Postzustellung
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Postzustellung = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Zustaendig As String
|
||||
Property Zustaendig As String
|
||||
Get
|
||||
Return m_Zustaendig
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Zustaendig = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_uslinks As String
|
||||
Property USLinks As String
|
||||
Get
|
||||
Return m_uslinks
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_uslinks = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_usrechts As String
|
||||
Property USRechts As String
|
||||
Get
|
||||
Return m_usrechts
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_usrechts = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_BCFrage As String
|
||||
Property BCFrage As String
|
||||
Get
|
||||
Return m_BCFrage
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_BCFrage = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_statuswechsel As String
|
||||
Property Statuswechsel As String
|
||||
Get
|
||||
Return m_statuswechsel
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_statuswechsel = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_dokumentdatum As String
|
||||
Property Dokumentdatum As String
|
||||
Get
|
||||
Return m_dokumentdatum
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_dokumentdatum = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Verantwortlich As String
|
||||
Property Verantwortlich As String
|
||||
Get
|
||||
Return m_Verantwortlich
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Verantwortlich = value
|
||||
End Set
|
||||
End Property
|
||||
Dim m_adokumentwerte As ArrayList
|
||||
Property ADokumentwerte As ArrayList
|
||||
Get
|
||||
Return m_adokumentwerte
|
||||
End Get
|
||||
Set(value As ArrayList)
|
||||
m_adokumentwerte = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Dokumentid As String
|
||||
Property Dokumentid As String
|
||||
Get
|
||||
Return m_Dokumentid
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Dokumentid = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Avq_auth_extl_ref1 As String
|
||||
Property Avq_auth_extl_ref1 As String
|
||||
Get
|
||||
Return m_Avq_auth_extl_ref1
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Avq_auth_extl_ref1 = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Avq_auth_extl_ref2 As String
|
||||
Property Avq_auth_extl_ref2 As String
|
||||
Get
|
||||
Return m_Avq_auth_extl_ref2
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Avq_auth_extl_ref2 = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_avq_auth_extl_ref_dt As New DataTable
|
||||
Property Avq_extl_ref_dt As DataTable
|
||||
Get
|
||||
Return m_avq_auth_extl_ref_dt
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
m_avq_auth_extl_ref_dt = value
|
||||
End Set
|
||||
End Property
|
||||
'Dim m_dsdokumentwerte As New DataSet
|
||||
'Property DS_Dokumentwerte As DataSet
|
||||
' Get
|
||||
' Return m_dsdokumentwerte
|
||||
' End Get
|
||||
' Set(value As DataSet)
|
||||
' m_dsdokumentwerte = value
|
||||
' End Set
|
||||
'End Property
|
||||
#Region "Members"
|
||||
Private arrDoukmentWerte As New ArrayList()
|
||||
Private objDokumentWert As AvaloqDokumentWert
|
||||
#End Region
|
||||
|
||||
#Region "Public methods"
|
||||
Public Function HeaderInfo(ByRef doc As XmlDocument, ByVal xmlfile As String)
|
||||
|
||||
For Each n As XmlNode In doc.ChildNodes
|
||||
' MsgBox(n.Name)
|
||||
For Each N1 As XmlNode In n.ChildNodes
|
||||
Select Case UCase(N1.Name)
|
||||
Case "ACTIONID"
|
||||
Case "CREATORTG"
|
||||
Case "PARTNERNR"
|
||||
Me.Partnernr = N1.InnerText
|
||||
Case "PERSONNR"
|
||||
Me.PersonNr = N1.InnerText
|
||||
Case "FANUMMER3"
|
||||
Me.FANummer3 = N1.InnerText
|
||||
Case "ORDERNR"
|
||||
Me.Ordernr = N1.InnerText.ToString
|
||||
Case "DOKUMENTTYPNR"
|
||||
Me.Dokumenttypnr = N1.InnerText
|
||||
Case "DIREKTEERSTELLUNG"
|
||||
Me.Direkteerstellung = N1.InnerText
|
||||
Case "DOKUMENTPAKET"
|
||||
Me.Dokumentpaket = N1.InnerText
|
||||
Case "POSTZUSTELLUNG"
|
||||
Me.Postzustellung = N1.InnerText
|
||||
Case "USLINKS"
|
||||
Me.USLinks = N1.InnerText
|
||||
Case "USRECHTS"
|
||||
Me.USRechts = N1.InnerText
|
||||
Case "ZUSTAENDIG"
|
||||
Me.Zustaendig = N1.InnerText
|
||||
Case "VERANTWORTLICH"
|
||||
Me.Verantwortlich = N1.InnerText
|
||||
|
||||
Case "DOKUMENTDATUM"
|
||||
Me.Dokumentdatum = N1.InnerText
|
||||
Case "BC"
|
||||
Me.BCFrage = N1.InnerText
|
||||
Case "STATUSWECHSEL"
|
||||
Me.Statuswechsel = N1.InnerText
|
||||
Case "DOKUMENTID"
|
||||
Me.Statuswechsel = N1.InnerText
|
||||
End Select
|
||||
Next
|
||||
Next
|
||||
|
||||
End Function
|
||||
'''<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)
|
||||
HeaderInfo(doc, xmlImportFile.FullName)
|
||||
'read all parameter nodes
|
||||
Dim parameterNodes As XmlNodeList
|
||||
parameterNodes = doc.SelectNodes("action/dokwerte/parameter")
|
||||
|
||||
Me.Avq_extl_ref_dt.Rows.Clear()
|
||||
Me.Avq_extl_ref_dt.Columns.Clear()
|
||||
Me.Avq_extl_ref_dt.Columns.Add("Doktype")
|
||||
Me.Avq_extl_ref_dt.Columns.Add("RefNr")
|
||||
Me.Avq_extl_ref_dt.Columns.Add("avq_auth_extl_ref")
|
||||
|
||||
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)
|
||||
|
||||
Dim xname As String
|
||||
Dim doktyp As String
|
||||
xname = name
|
||||
doktyp = ""
|
||||
|
||||
If UCase(name).IndexOf("AVQ_AUTH_EXTL_REF_") > -1 Or UCase(name).IndexOf("AVQ_AUTH_EXTL_REF1_") > -1 Or UCase(name).IndexOf("AVQ_AUTH_EXTL_REF2_") > -1 Then
|
||||
If UCase(name).IndexOf("AVQ_AUTH_EXTL_REF_") > -1 Then
|
||||
xname = "AVQ_AUTH_EXTL_REF"
|
||||
doktyp = UCase(name).Substring(18, Len(name) - 18)
|
||||
End If
|
||||
If UCase(name).IndexOf("AVQ_AUTH_EXTL_REF1_") > -1 Then
|
||||
xname = "AVQ_AUTH_EXTL_REF1"
|
||||
doktyp = UCase(name).Substring(19, Len(name) - 19)
|
||||
End If
|
||||
If UCase(name).IndexOf("AVQ_AUTH_EXTL_REF2_") > -1 Then
|
||||
xname = "AVQ_AUTH_EXTL_REF2"
|
||||
doktyp = UCase(name).Substring(19, Len(name) - 19)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Select Case UCase(xname)
|
||||
Case "AVQ_AUTH_EXTL_REF", "AVQ_AUTH_EXTL_REF1"
|
||||
Dim r As DataRow = Me.Avq_extl_ref_dt.NewRow
|
||||
r.Item(0) = doktyp
|
||||
r.Item(1) = 1
|
||||
r.Item(2) = value
|
||||
'Me.Avq_auth_extl_ref1 = value
|
||||
Me.Avq_extl_ref_dt.Rows.Add(r)
|
||||
Case "AVQ_AUTH_EXTL_REF2"
|
||||
Dim r As DataRow = Me.Avq_extl_ref_dt.NewRow
|
||||
r.Item(0) = doktyp
|
||||
r.Item(1) = 2
|
||||
r.Item(2) = value
|
||||
'Me.Avq_auth_extl_ref1 = value
|
||||
Me.Avq_extl_ref_dt.Rows.Add(r)
|
||||
End Select
|
||||
|
||||
'If UCase(name) = "AVQ_AUTH_EXTL_REF" Then
|
||||
' Dim r As DataRow = Me.Avq_extl_ref_dt.NewRow
|
||||
' r.Item(0) = ""
|
||||
' r.Item(1) = 1
|
||||
' r.Item(2) = value
|
||||
' Me.Avq_auth_extl_ref1 = value
|
||||
' Me.Avq_extl_ref_dt.Rows.Add(r)
|
||||
'End If
|
||||
|
||||
|
||||
'If UCase(name) = "AVQ_AUTH_EXTL_REF1" Then
|
||||
' Dim r As DataRow = Me.Avq_extl_ref_dt.NewRow
|
||||
' r.Item(0) = ""
|
||||
' r.Item(1) = 1
|
||||
' r.Item(2) = value
|
||||
' Me.Avq_auth_extl_ref1 = value
|
||||
' Me.Avq_extl_ref_dt.Rows.Add(r)
|
||||
'End If
|
||||
'If UCase(name) = "AVQ_AUTH_EXTL_REF2" Then
|
||||
' Dim r As DataRow = Me.Avq_extl_ref_dt.NewRow
|
||||
' r.Item(0) = ""
|
||||
' r.Item(1) = 2
|
||||
' r.Item(2) = value
|
||||
' Me.Avq_auth_extl_ref1 = value
|
||||
' Me.Avq_extl_ref_dt.Rows.Add(r)
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
TKBLib.Errorhandling.TraceHelper.Msg("EdokaLib.Common.Action.Load", ex.Message & ex.StackTrace, TraceLevel.Error)
|
||||
End Try
|
||||
parameterCounter = parameterCounter + 1
|
||||
|
||||
Next
|
||||
Me.ADokumentwerte = arrDoukmentWerte
|
||||
End If
|
||||
|
||||
'Dim ds As New DataSet
|
||||
'ds.ReadXml(xmlImportFile.FullName)
|
||||
'For Each dt As DataTable In ds.Tables
|
||||
' If UCase(dt.TableName) = "DOKUMENT" Then
|
||||
' Me.DS_Dokumentwerte.Tables.Add(dt.Copy)
|
||||
' End If
|
||||
' If UCase(dt.TableName) = "PARAMETER" Then
|
||||
' Me.DS_Dokumentwerte.Tables.Add(dt.Copy)
|
||||
' End If
|
||||
|
||||
'Next
|
||||
'ds.Dispose()
|
||||
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
|
||||
|
||||
Public Function getAvaloqDokumentWertByName(ByVal aDokumentwerte As ArrayList, ByVal name As String, ByVal Techname As String) As AvaloqDokumentWert
|
||||
Dim objRet As AvaloqDokumentWert = Nothing
|
||||
Dim x As AvaloqDokumentWert
|
||||
Dim i As Integer
|
||||
Try
|
||||
For i = 0 To aDokumentwerte.Count - 1
|
||||
x = aDokumentwerte(i)
|
||||
If aDokumentwerte(i).name = name Or aDokumentwerte(i).name = Techname Then
|
||||
Return x
|
||||
objRet.name = x.name
|
||||
objRet.value = x.value
|
||||
End If
|
||||
Next
|
||||
Return objRet
|
||||
Catch
|
||||
End Try
|
||||
|
||||
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