You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1281 lines
55 KiB
1281 lines
55 KiB
Imports System
|
|
Imports System.Configuration
|
|
Imports System.Data
|
|
Imports System.Data.SqlClient
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Net
|
|
Imports System.Xml
|
|
Imports System.IO
|
|
Public Class frmHostTransfer
|
|
Inherits System.Windows.Forms.Form
|
|
|
|
#Region " Vom Windows Form Designer generierter Code "
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
|
|
|
End Sub
|
|
|
|
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
|
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
If disposing Then
|
|
If Not (components Is Nothing) Then
|
|
components.Dispose()
|
|
End If
|
|
End If
|
|
MyBase.Dispose(disposing)
|
|
End Sub
|
|
|
|
' Für Windows Form-Designer erforderlich
|
|
Private components As System.ComponentModel.IContainer
|
|
|
|
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
|
|
'Sie kann mit dem Windows Form-Designer modifiziert werden.
|
|
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
|
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
|
|
Friend WithEvents Button1 As System.Windows.Forms.Button
|
|
Friend WithEvents Button2 As System.Windows.Forms.Button
|
|
Friend WithEvents Button3 As System.Windows.Forms.Button
|
|
Friend WithEvents label1 As System.Windows.Forms.TextBox
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmHostTransfer))
|
|
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
|
|
Me.Button1 = New System.Windows.Forms.Button()
|
|
Me.Button2 = New System.Windows.Forms.Button()
|
|
Me.Button3 = New System.Windows.Forms.Button()
|
|
Me.label1 = New System.Windows.Forms.TextBox()
|
|
Me.SuspendLayout()
|
|
'
|
|
'ProgressBar1
|
|
'
|
|
Me.ProgressBar1.Location = New System.Drawing.Point(8, 104)
|
|
Me.ProgressBar1.Name = "ProgressBar1"
|
|
Me.ProgressBar1.Size = New System.Drawing.Size(448, 23)
|
|
Me.ProgressBar1.TabIndex = 0
|
|
'
|
|
'Button1
|
|
'
|
|
Me.Button1.Location = New System.Drawing.Point(376, 136)
|
|
Me.Button1.Name = "Button1"
|
|
Me.Button1.TabIndex = 1
|
|
Me.Button1.Text = "Weiter >>"
|
|
'
|
|
'Button2
|
|
'
|
|
Me.Button2.Location = New System.Drawing.Point(8, 136)
|
|
Me.Button2.Name = "Button2"
|
|
Me.Button2.TabIndex = 2
|
|
Me.Button2.Text = "Abbruch"
|
|
'
|
|
'Button3
|
|
'
|
|
Me.Button3.Location = New System.Drawing.Point(200, 136)
|
|
Me.Button3.Name = "Button3"
|
|
Me.Button3.TabIndex = 4
|
|
Me.Button3.Text = "&OK"
|
|
Me.Button3.Visible = False
|
|
'
|
|
'label1
|
|
'
|
|
Me.label1.Location = New System.Drawing.Point(8, 8)
|
|
Me.label1.Multiline = True
|
|
Me.label1.Name = "label1"
|
|
Me.label1.ReadOnly = True
|
|
Me.label1.Size = New System.Drawing.Size(448, 88)
|
|
Me.label1.TabIndex = 5
|
|
Me.label1.Text = "TextBox1"
|
|
'
|
|
'frmHostTransfer
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(464, 166)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.label1, Me.Button3, Me.Button2, Me.Button1, Me.ProgressBar1})
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
Me.Name = "frmHostTransfer"
|
|
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
|
Me.Text = "Partner-Daten vom HOST übermitteln"
|
|
Me.TopMost = True
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Deklarationen"
|
|
|
|
Dim PartnerExists As Boolean = False
|
|
Dim m_nrpar00_aufbereitet As String
|
|
|
|
|
|
Property Nrpar00_aufbereitet()
|
|
Get
|
|
Return m_nrpar00_aufbereitet
|
|
End Get
|
|
Set(ByVal Value)
|
|
m_nrpar00_aufbereitet = Microsoft.VisualBasic.Left(Value, 3) + "." + Microsoft.VisualBasic.Mid(Value, 4, 3) + "." + Microsoft.VisualBasic.Right(Value, 3)
|
|
End Set
|
|
End Property
|
|
|
|
Dim m_nrpar00 As String
|
|
Property Nrpar00() As String
|
|
Get
|
|
Return m_nrpar00
|
|
End Get
|
|
Set(ByVal Value As String)
|
|
m_nrpar00 = Value
|
|
While Len(m_nrpar00) < 9
|
|
m_nrpar00 = "0" + m_nrpar00
|
|
End While
|
|
Me.Nrpar00_aufbereitet = Me.Nrpar00
|
|
End Set
|
|
End Property
|
|
|
|
Dim vv As New edokadb.clsVV()
|
|
Dim partner As New edokadb.clsPartner()
|
|
Dim ha As New edokadb.clsPartner_Hauptadresse()
|
|
Dim etbez0 As New edokadb.clsEdoka_etbez0()
|
|
Dim etparn As New edokadb.clsEtparn()
|
|
Dim etparu As New edokadb.clsEtparu()
|
|
Dim etpar0 As New edokadb.clsEdoka_etpar0()
|
|
|
|
Dim da As New DataTable()
|
|
|
|
Dim db As New edokadb.clsServices()
|
|
Dim url As String
|
|
Dim RequestName As String
|
|
Dim ResutlSetContent As String
|
|
Dim Resultobject As String
|
|
Dim xmlstring As String
|
|
Dim xmldoc As New Xml.XmlDocument()
|
|
Dim xmlElement As Xml.XmlElement
|
|
Dim xmlNodes As Xml.XmlNodeList
|
|
Dim DoInsert As Boolean = False
|
|
Dim doinsert1 As Boolean = False
|
|
Dim doinsert_etparn As Boolean = False
|
|
Dim doinsert_etbez0 As Boolean = False
|
|
Dim doinsert_etparu As Boolean = False
|
|
Dim doinsert_etpar0 As Boolean = False
|
|
Dim statustext As String = ""
|
|
Dim m_PartnerIstNP As Boolean = False
|
|
Dim m_PartnerIstUP As Boolean = False
|
|
Dim m_PartnerHatBetreuer As Boolean = False
|
|
|
|
Dim BKPAR00 As String
|
|
Dim filename As String = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_temporaer_dokumente") + "\XMLRequest.xml"
|
|
Dim vvz As Integer = 0
|
|
|
|
#End Region
|
|
|
|
#Region "Datenbank"
|
|
|
|
Public Function Partner_Exists() As Boolean
|
|
Dim db As New edokadb.clsPartner()
|
|
Dim da As New DataTable()
|
|
db.iNRPAR00 = New SqlInt32(CType(Me.Nrpar00, Int32))
|
|
db.cpMainConnectionProvider = Globals.conn
|
|
da = db.SelectOne()
|
|
If da.Rows.Count = 0 Then Return False Else Return True
|
|
da.Dispose()
|
|
db.Dispose()
|
|
End Function
|
|
|
|
Private Function Get_URL() As String
|
|
Dim db As New edokadb.clsServices()
|
|
db.cpMainConnectionProvider = conn
|
|
db.iNreintrag = New SqlInt32(CType(1, Int32))
|
|
db.SelectOne()
|
|
Me.url = db.sURL.Value
|
|
Return db.sURL.Value
|
|
db.Dispose()
|
|
End Function
|
|
|
|
Private Function Get_DBValues(ByVal i As Integer) As String
|
|
Dim db As New edokadb.clsServices()
|
|
db.cpMainConnectionProvider = Globals.conn
|
|
Select Case i
|
|
Case 1
|
|
'Parnter
|
|
db.iNreintrag = New SqlInt32(CType(2, Int32))
|
|
Case 2
|
|
'VV
|
|
db.iNreintrag = New SqlInt32(CType(3, Int32))
|
|
Case 3
|
|
'Aufbereitete adresse
|
|
db.iNreintrag = New SqlInt32(CType(4, Int32))
|
|
End Select
|
|
db.SelectOne()
|
|
Me.RequestName = db.sRequestName.Value
|
|
Me.Resultobject = db.sResultObject.Value
|
|
Me.ResutlSetContent = db.sResultsetContent.Value
|
|
End Function
|
|
|
|
#End Region
|
|
|
|
Public Sub load_data()
|
|
If Me.Partner_Exists Then
|
|
Me.PartnerExists = True
|
|
label1.Text = MyTxt.gettext(101)
|
|
Button1.Visible = True
|
|
Button2.Visible = True
|
|
Else
|
|
Me.PartnerExists = True
|
|
label1.Text = MyTxt.gettext(102)
|
|
Button1.Visible = True
|
|
Button2.Visible = True
|
|
End If
|
|
End Sub
|
|
|
|
Public Function Get_Data(ByVal type As Integer) As Boolean
|
|
Dim s As String
|
|
Me.Update_Progress("", 0)
|
|
Select Case type
|
|
Case 1
|
|
Me.Create_Partner_Anfrage()
|
|
Me.Update_Progress("Partner-Daten übermitteln", 20)
|
|
Case 2
|
|
Me.Create_VV_Abfrage()
|
|
Me.Update_Progress("VV-Daten übermitteln", 50)
|
|
Case 3
|
|
Me.Create_Adress_Abfrage()
|
|
Me.Update_Progress("Adress-Daten übermitteln", 80)
|
|
Case Else
|
|
End Select
|
|
read_data()
|
|
If Check_Result() = False Then
|
|
'MyMsg.show_standardmessage(103, MsgBoxStyle.Critical)
|
|
Return False
|
|
' MsgBox("Beim Zugriff auf die HOST-Daten ist ein Fehler aufgetreten.")
|
|
Exit Function
|
|
End If
|
|
Select Case type
|
|
Case 1
|
|
Parse_Partner()
|
|
Me.Update_Progress("Partner-Daten speichern", 35)
|
|
If statustext <> "" Then statustext = statustext + vbCrLf + vbCrLf
|
|
statustext = statustext + "Die wichtigsten Partner- und Adressdaten sind in den" + vbCrLf + "EDOKA-Datenbestand übernommen worden." + vbCrLf + vbCrLf
|
|
Case 2
|
|
Parse_VV()
|
|
If statustext <> "" Then statustext = statustext + vbCrLf + vbCrLf
|
|
Me.Update_Progress("VV-Daten speichern", 75)
|
|
statustext = statustext + "Es wurden " + LTrim(Str(vvz)) + " neue VV-Einträge gespeichert." + vbCrLf + vbCrLf
|
|
Case 3
|
|
Parse_Adresse()
|
|
Me.Update_Progress("Adress-Daten speichern", 100)
|
|
End Select
|
|
Return True
|
|
End Function
|
|
|
|
#Region "XML"
|
|
|
|
Private Sub read_data()
|
|
Dim xstreamer As StreamReader
|
|
Dim sStream As Stream
|
|
Dim URLReq As HttpWebRequest
|
|
Dim URLRes As HttpWebResponse
|
|
Dim swriter As System.IO.StreamWriter
|
|
Dim sreader As System.IO.StreamReader
|
|
Dim surl As String = Get_URL()
|
|
Try
|
|
|
|
xstreamer = File.OpenText(filename)
|
|
xmlstring = xstreamer.ReadToEnd
|
|
|
|
URLReq = WebRequest.Create(surl)
|
|
'URLReq.Method = "GET"
|
|
URLReq.Method = "POST"
|
|
swriter = New System.IO.StreamWriter(URLReq.GetRequestStream())
|
|
swriter.Write(xmlstring)
|
|
swriter.Close()
|
|
Application.DoEvents()
|
|
|
|
URLRes = URLReq.GetResponse()
|
|
Application.DoEvents()
|
|
|
|
URLRes = URLReq.GetResponse
|
|
Application.DoEvents()
|
|
sreader = New System.IO.StreamReader(URLRes.GetResponseStream(), System.Text.Encoding.GetEncoding("ISO-8859-1"))
|
|
|
|
'TEMP TEMP
|
|
Dim x As String
|
|
Dim sw As System.IO.StreamWriter
|
|
Dim ss As String
|
|
'ss = sreader.ReadToEnd
|
|
'MsgBox(ss)
|
|
|
|
xmldoc.Load(sreader)
|
|
sreader.Close()
|
|
xstreamer.Close()
|
|
Catch EX As Exception
|
|
xstreamer.Close()
|
|
MsgBox(EX.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Function Check_Result() As Boolean
|
|
'xmldoc.Load("H:\vb.net\EDOKA\XMLParser\XML-Files\Me_pepe_PartnerGesamtLesenAnswer.xml")
|
|
Dim i As Integer
|
|
Try
|
|
xmlNodes = xmldoc.GetElementsByTagName("is-successful-executed")
|
|
For i = 0 To xmlNodes.Count - 1
|
|
If UCase(xmlNodes(i).InnerText) = "TRUE" Then Return True
|
|
Next
|
|
Catch
|
|
MsgBox("Ausführung gescheitert")
|
|
Return False
|
|
End Try
|
|
End Function
|
|
|
|
Public Function Get_Value(ByVal KeyValue As String, ByVal xmlElement As Xml.XmlElement) As String
|
|
Dim s As String
|
|
Dim i As Integer
|
|
For i = 0 To xmlElement.Attributes.Count - 1
|
|
If xmlElement.Attributes(i).Value = KeyValue Then
|
|
Return xmlElement.Attributes(i + 1).Value
|
|
End If
|
|
Next
|
|
End Function
|
|
|
|
Sub attrib(ByVal xmlelement As Xml.XmlElement)
|
|
Dim s As String
|
|
Dim i As Integer
|
|
For i = 0 To xmlelement.Attributes.Count - 1
|
|
s = s + xmlelement.Attributes(i).Name & ":" + Chr(9)
|
|
s = s + xmlelement.Attributes(i).Value + Chr(9)
|
|
s = s + Chr(9)
|
|
Next
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Partner"
|
|
|
|
Private Sub Parse_Partner()
|
|
Dim i As Integer
|
|
Dim o As Integer
|
|
Dim k As Integer
|
|
Dim nrpar00 As Integer
|
|
xmlNodes = xmldoc.GetElementsByTagName("result-object")
|
|
For i = 0 To xmlNodes.Count - 1
|
|
nrpar00 = 0
|
|
nrpar00 = Me.Nrpar00
|
|
Me.BKPAR00 = ""
|
|
For o = 0 To xmlNodes(i).ChildNodes.Count - 1
|
|
If Me.BKPAR00 = "" Then
|
|
Me.BKPAR00 = Get_Value("kurzname", xmlNodes(i).ChildNodes(o))
|
|
Else
|
|
Exit For
|
|
End If
|
|
Next
|
|
|
|
'Exit Sub
|
|
|
|
partner.cpMainConnectionProvider = Globals.conn
|
|
partner.iNRPAR00 = New SqlInt32(CType(nrpar00, Int32))
|
|
da = partner.SelectOne()
|
|
If da.Rows.Count = 0 Then
|
|
DoInsert = True
|
|
Else
|
|
DoInsert = False
|
|
End If
|
|
|
|
ha.cpMainConnectionProvider = Globals.conn
|
|
ha.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = ha.SelectOne
|
|
If da.Rows.Count = 0 Then
|
|
doinsert1 = True
|
|
Else
|
|
doinsert1 = False
|
|
End If
|
|
|
|
'Prüfen ob bereits ein Eintrag vorhanden ist
|
|
etparn.cpMainConnectionProvider = Globals.conn
|
|
etparn.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = etparn.SelectOne
|
|
If da.Rows.Count = 0 Then
|
|
doinsert_etparn = True
|
|
Else
|
|
doinsert_etparn = False
|
|
End If
|
|
|
|
'Prüfen ob bereits ein Haubtbetreuer vorhanden ist
|
|
etbez0.cpMainConnectionProvider = Globals.conn
|
|
etbez0.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = etbez0.SelectOne
|
|
If da.Rows.Count = 0 Then
|
|
doinsert_etbez0 = True
|
|
Else
|
|
doinsert_etbez0 = False
|
|
End If
|
|
|
|
'Prüfen ob bereits ein Eintrag vorhanden ist
|
|
etparu.cpMainConnectionProvider = Globals.conn
|
|
etparu.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = etparu.SelectOne
|
|
If da.Rows.Count = 0 Then
|
|
doinsert_etparu = True
|
|
Else
|
|
doinsert_etparu = False
|
|
End If
|
|
|
|
'Prüfen ob bereits ein Eintrag vorhanden ist
|
|
etpar0.cpMainConnectionProvider = Globals.conn
|
|
etpar0.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = etpar0.SelectOne
|
|
If da.Rows.Count = 0 Then
|
|
doinsert_etpar0 = True
|
|
Else
|
|
doinsert_etpar0 = False
|
|
End If
|
|
|
|
For k = 0 To xmlNodes(0).ChildNodes.Count - 1
|
|
partner_values(xmlNodes(i).ChildNodes(k))
|
|
Next
|
|
|
|
Globals.conn.OpenConnection()
|
|
If DoInsert Then
|
|
partner.sCDBAL00 = New SqlString(CType("N", String))
|
|
partner.bCDVSA00 = New SqlBoolean(CType(False, Boolean))
|
|
partner.sCDBAL00 = New SqlString(CType("N", String))
|
|
partner.bCDVSA00 = New SqlBoolean(CType(False, Boolean))
|
|
partner.iAZEPL00 = New SqlInt32(CType(1, Integer))
|
|
partner.sNRPARAD = New SqlString(CType(Me.Nrpar00, String))
|
|
partner.sBKPAR00 = New SqlString(CType(Me.BKPAR00, String))
|
|
partner.Insert()
|
|
Else
|
|
partner.Update()
|
|
End If
|
|
If doinsert1 Then
|
|
ha.Insert()
|
|
Else
|
|
ha.Update()
|
|
End If
|
|
|
|
'Wenn Partner ein NP ist
|
|
If m_PartnerIstNP = True Then
|
|
etparn.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
If doinsert_etparn Then
|
|
etparn.siNRVRN00 = New SqlInt16(9999)
|
|
etparn.sBEBERAL = New SqlString("")
|
|
etparn.sCDIPA00 = New SqlString("")
|
|
etparn.sCDMUTER = New SqlString("")
|
|
etparn.daTSMUT00 = New SqlDateTime(Now())
|
|
etparn.sSAREC00 = New SqlString("2")
|
|
etparn.Insert()
|
|
Else
|
|
etparn.Update()
|
|
End If
|
|
End If
|
|
|
|
'Wenn Partner ein UP ist
|
|
If m_PartnerIstUP = True Then
|
|
etparu.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
If doinsert_etparn Then
|
|
etparu.siNRVRN00 = New SqlInt16(9999)
|
|
etparu.sCDIPA00 = New SqlString("")
|
|
etparu.sCDMUTER = New SqlString("")
|
|
etparu.daTSMUT00 = New SqlDateTime(Now())
|
|
etparu.sSAREC00 = New SqlString("2")
|
|
etparu.Insert()
|
|
Else
|
|
etparu.Update()
|
|
End If
|
|
End If
|
|
|
|
'Wenn Partner ein Hauptbetreuer hat
|
|
If m_PartnerHatBetreuer = True Then
|
|
etbez0.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
If doinsert_etbez0 Then
|
|
etbez0.iNRBEZ00 = New SqlInt32(GetNewKey)
|
|
etbez0.siNRVRN00 = New SqlInt16(9999)
|
|
etbez0.siNRBEO00 = New SqlInt16(200)
|
|
etbez0.sCDMUTER = New SqlString("")
|
|
etbez0.daTSMUT00 = New SqlDateTime(Now())
|
|
etbez0.sSAREC00 = New SqlString("2")
|
|
etbez0.Insert()
|
|
Else
|
|
etbez0.Update()
|
|
End If
|
|
End If
|
|
|
|
'ETPAR0
|
|
etpar0.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
If doinsert_etpar0 Then
|
|
etpar0.siNRERF00 = New SqlInt16(0)
|
|
etpar0.siNRAFG00 = New SqlInt16(0)
|
|
etpar0.siNRBBG00 = New SqlInt16(0)
|
|
etpar0.sSAWBG00 = New SqlString("")
|
|
|
|
etpar0.siNRVRN00 = New SqlInt16(9999)
|
|
etpar0.sCDMUTER = New SqlString("")
|
|
etpar0.daTSMUT00 = New SqlDateTime(Now())
|
|
etpar0.sSAREC00 = New SqlString("2")
|
|
etpar0.Insert()
|
|
Else
|
|
etpar0.Update()
|
|
End If
|
|
|
|
|
|
Globals.conn.CloseConnection(True)
|
|
Next
|
|
End Sub
|
|
|
|
Private Function GetNewKey() As Integer
|
|
GetNewKey = 0
|
|
Dim ssql As String
|
|
ssql = "SELECT TOP 1 NRBEZ00 + 1 AS NewRow FROM edoka_etbez0 Order By NRBEZ00 DESC"
|
|
|
|
Dim connection As New SqlConnection()
|
|
Dim daTemp As New SqlDataAdapter(ssql, connection)
|
|
Dim dsTemp As New DataSet()
|
|
Try
|
|
connection.ConnectionString = Globals.sConnectionString
|
|
connection.Open()
|
|
daTemp.Fill(dsTemp)
|
|
GetNewKey = dsTemp.Tables(0).Rows(0).Item(0)
|
|
|
|
Catch ex As Exception
|
|
Return False
|
|
Finally
|
|
dsTemp = Nothing
|
|
daTemp = Nothing
|
|
connection.Close()
|
|
connection = Nothing
|
|
End Try
|
|
End Function
|
|
|
|
Sub partner_values(ByVal xmlelement As Xml.XmlElement)
|
|
Dim i As Integer
|
|
Dim s As String
|
|
Dim w As Integer
|
|
For i = 0 To xmlelement.Attributes.Count - 2
|
|
Debug.Write(xmlelement.Attributes(i + 1).Name + ": " + xmlelement.Attributes(i + 1).Value + vbNewLine)
|
|
s = xmlelement.Attributes(i + 1).Value
|
|
If s = "noData" Or s = "null" Then s = ""
|
|
Select Case xmlelement.Attributes(i).Value
|
|
Case "kurzname"
|
|
partner.sBKPAR00 = New SqlString(CType(s, String)) 'New SqlString(CType(Me.BKPAR00, String))
|
|
etpar0.sBKPAR00 = New SqlString(CType(s, String))
|
|
Case "status"
|
|
ha.sSAREC00 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "domizilKanton"
|
|
partner.sCDBNK00 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
etpar0.sCDDOMKT = New SqlString(CType(s, String))
|
|
Case "hauptbetreuer" 'NRBEU01 in edoka_etbez0 + SAREC00 fix = 2
|
|
If s = "" Then
|
|
m_PartnerHatBetreuer = False
|
|
s = "0"
|
|
Else
|
|
m_PartnerHatBetreuer = True
|
|
End If
|
|
etbez0.iNRBEU01 = New SqlInt32(CType(s, Int32))
|
|
etpar0.iNRBEU01 = New SqlInt32(CType(s, Int32))
|
|
Case "abwicklungsformKurzbezeichnung"
|
|
If s = "NP" Then
|
|
m_PartnerIstNP = True
|
|
End If
|
|
If s = "UP" Then
|
|
m_PartnerIstUP = True
|
|
End If
|
|
Case "npGeburtsdatum"
|
|
If s <> "" Then
|
|
etparn.daDMGEB00 = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "npGeburtsjahr"
|
|
If s = "" Then s = "0"
|
|
etparn.siDMGEBJJ = New SqlInt16(CType(s, Int16))
|
|
Case "eroeffnungsdatum"
|
|
If s = "" Then s = "01.01.1900"
|
|
etparn.daDMERF00 = New SqlDateTime(CType(s, DateTime))
|
|
etbez0.daDMERF00 = New SqlDateTime(CType(s, DateTime))
|
|
etparu.daDMERF00 = New SqlDateTime(CType(s, DateTime))
|
|
etpar0.daDMPAREO = New SqlDateTime(CType(s, DateTime))
|
|
etpar0.daDMERF00 = New SqlDateTime(CType(s, DateTime))
|
|
Case "npGeburtsort"
|
|
etparn.sBEGEB00 = New SqlString(CType(s, String))
|
|
Case "npBuergerort"
|
|
etparn.sBEBGO00 = New SqlString(CType(s, String))
|
|
Case "npTodesjahr"
|
|
If s = "" Then s = "0"
|
|
etparn.siDMTODJJ = New SqlInt16(CType(s, Int16))
|
|
Case "npGeschlechtNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRSEX00 = New SqlInt16(CType(s, Int16))
|
|
Case "npZivilstandNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRZVS00 = New SqlInt16(CType(s, Int16))
|
|
Case "npGueterstandNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRGST00 = New SqlInt16(CType(s, Int16))
|
|
Case "npAusbildungsstufeNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRABD00 = New SqlInt16(CType(s, Int16))
|
|
Case "npBerufNr"
|
|
If s = "" Then s = "0"
|
|
etparn.iNRBER01 = New SqlInt32(CType(s, Int32))
|
|
Case "npSonstigerBerufNr"
|
|
If s = "" Then s = "0"
|
|
etparn.iNRBER02 = New SqlInt32(CType(s, Int32))
|
|
Case "npErwerbsstatusNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRERW00 = New SqlInt16(CType(s, Int16))
|
|
Case "npAhvNr"
|
|
etparn.sCDAHV00 = New SqlString(CType(s, String))
|
|
Case "npBvgVersicherungNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRBVG00 = New SqlInt16(CType(s, Int16))
|
|
Case "npAuslaenderbewilligungNr"
|
|
If s = "" Then s = "0"
|
|
etparn.siNRABE00 = New SqlInt16(CType(s, Int16))
|
|
Case "upGruendungsjahr"
|
|
If s = "" Then s = "0"
|
|
etparu.siDMGRDJJ = New SqlInt16(CType(s, Int16))
|
|
Case "upGruendungsdatum"
|
|
If s <> "" Then
|
|
etparu.daDMGRD00 = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "upAufloesungsdatum"
|
|
If s <> "" Then
|
|
etparu.daDMAFL00 = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "upAufloesungsjahr"
|
|
If s = "" Then s = "0"
|
|
etparu.siDMAFLJJ = New SqlInt16(CType(s, Int16))
|
|
Case "upAnzahlBeschaeftigte"
|
|
If s = "" Then s = "0"
|
|
etparu.dcAZBSC00 = New SqlDecimal(CType(s, Decimal))
|
|
Case "upHandelsregistereintragDatum"
|
|
If s <> "" Then
|
|
etparu.daDMHDR00 = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "upSwiftId"
|
|
etparu.sCDSWI00 = New SqlString(CType(s, String))
|
|
Case "upSicNr"
|
|
If s = "" Then s = "0"
|
|
etparu.dcNRSIC00 = New SqlDecimal(CType(s, Decimal))
|
|
Case "upBrancheNoga"
|
|
etparu.sCDNOG01 = New SqlString(CType(s, String))
|
|
Case "upSonstigeBrancheNoga"
|
|
etparu.sCDNOG02 = New SqlString(CType(s, String))
|
|
Case "abwicklungsformCode"
|
|
etpar0.sCDPAW00 = New SqlString(CType(s, String))
|
|
Case "kundeSeit"
|
|
If s <> "" Then
|
|
etpar0.daDMPARVN = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "aufhebungsdatum"
|
|
If s <> "" Then
|
|
etpar0.daDMPARBI = New SqlDateTime(CType(s, DateTime))
|
|
End If
|
|
Case "rechtlicherStatusNr"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRRST00 = New SqlInt16(CType(s, Int16))
|
|
Case "korrespondenzspracheNr"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRSPA00 = New SqlInt16(CType(s, Int16))
|
|
Case "geldstromNr"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRGSR00 = New SqlInt16(CType(s, Int16))
|
|
Case "bonitaetNr"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRBON00 = New SqlInt16(CType(s, Int16))
|
|
Case "domizilGemeinde"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRDOMGE = New SqlInt16(CType(s, Int16))
|
|
Case "domizilLand"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRDOM00 = New SqlInt16(CType(s, Int16))
|
|
Case "risikoDomizilLand"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRDOMRI = New SqlInt16(CType(s, Int16))
|
|
Case "nationalitaetLand"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRNAT01 = New SqlInt16(CType(s, Int16))
|
|
Case "weitereNationalitaet"
|
|
If s = "" Then s = "0"
|
|
etpar0.siNRNAT02 = New SqlInt16(CType(s, Int16))
|
|
Case "beDatenverantwortlich"
|
|
If s = "" Then s = "0"
|
|
etpar0.iNRBEE00 = New SqlInt32(CType(s, Int32))
|
|
Case "integer"
|
|
etpar0.sSAINT00 = New SqlString(CType(s, String))
|
|
Case "stvBetreuer"
|
|
If s = "" Then s = "0"
|
|
etpar0.iNRBEU02 = New SqlInt32(CType(s, Int32))
|
|
Case "sortiername"
|
|
etpar0.sBKPARSQ = New SqlString(CType(s, String))
|
|
Case "technischerSortierbegriff"
|
|
etpar0.sCDPARSQ = New SqlString(CType(s, String))
|
|
Case "nachkontrollStatus"
|
|
etpar0.sSAKTRNA = New SqlString(CType(s, String))
|
|
End Select
|
|
Next
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "VV"
|
|
|
|
Private Sub Parse_VV()
|
|
Dim i As Integer
|
|
Dim o As Integer
|
|
Dim k As Integer
|
|
Dim vvnr As Integer
|
|
xmlNodes = xmldoc.GetElementsByTagName("result-object")
|
|
For i = 0 To xmlNodes.Count - 1
|
|
vvnr = 0
|
|
For o = 0 To xmlNodes(i).ChildNodes.Count - 1
|
|
If vvnr <= 1 Then vvnr = Get_Value("vvNr", xmlNodes(i).ChildNodes(o))
|
|
Next o
|
|
|
|
vv.cpMainConnectionProvider = Globals.conn
|
|
vv.iNRVVG00 = New SqlInt32(CType(vvnr, Int32))
|
|
da = vv.SelectOne()
|
|
If da.Rows.Count = 0 Then DoInsert = True Else DoInsert = False
|
|
For k = 0 To xmlNodes(0).ChildNodes.Count - 1
|
|
vv_values(xmlNodes(i).ChildNodes(k))
|
|
Next
|
|
Globals.conn.OpenConnection()
|
|
If DoInsert Then
|
|
'BUD - 19.07.2006 - sBEPRDLG auf leer String setzten
|
|
vv.sBEPRDLG = New SqlString(CType("", String))
|
|
vv.Insert()
|
|
vvz = vvz + 1
|
|
Else
|
|
'vv.Update()
|
|
End If
|
|
Globals.conn.CloseConnection(True)
|
|
Next
|
|
End Sub
|
|
|
|
Sub vv_values(ByVal xmlelement As Xml.XmlElement)
|
|
Dim i As Integer
|
|
For i = 0 To xmlelement.Attributes.Count - 1
|
|
Select Case xmlelement.Attributes(i).Value
|
|
Case "vvNr"
|
|
vv.iNRPRD00 = New SqlInt32(CType(xmlelement.Attributes(i + 1).Value, Int32))
|
|
Case "produktNr"
|
|
vv.iNRPRD00 = New SqlInt32(CType(xmlelement.Attributes(i + 1).Value, Int32))
|
|
Case "vvNrExtern"
|
|
vv.sNEVVG00 = New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "status"
|
|
vv.sSAREC00 = New SqlString(CType("2", String))
|
|
Case "partnerNr"
|
|
vv.iNRPAR00 = New SqlInt32(CType(xmlelement.Attributes(i + 1).Value, Int32))
|
|
Case "vvNrExternAufbereitet"
|
|
vv.sNAVVG00 = New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "vereinbarungsSubtypNr"
|
|
vv.iNRVBS00 = New SqlInt32(CType(xmlelement.Attributes(i + 1).Value, Int32))
|
|
Case "rubrik"
|
|
If xmlelement.Attributes(i + 1).Value <> "noData" Then
|
|
vv.sTXRBK00 = New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Else
|
|
vv.sTXRBK00 = New SqlString(CType("", String))
|
|
End If
|
|
End Select
|
|
Next
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Adresse"
|
|
|
|
Private Sub Parse_Adresse()
|
|
Dim i As Integer
|
|
Dim o As Integer
|
|
Dim k As Integer
|
|
Dim nrpar00 As Integer
|
|
xmlNodes = xmldoc.GetElementsByTagName("result-object")
|
|
For i = 0 To xmlNodes.Count - 1
|
|
nrpar00 = 0
|
|
nrpar00 = Me.Nrpar00
|
|
partner.cpMainConnectionProvider = Globals.conn
|
|
partner.iNRPAR00 = New SqlInt32(CType(nrpar00, Int32))
|
|
da = partner.SelectOne()
|
|
If da.Rows.Count = 0 Then DoInsert = True Else DoInsert = False
|
|
ha.cpMainConnectionProvider = Globals.conn
|
|
ha.iNRPAR00() = New SqlInt32(CType(nrpar00, Int32))
|
|
da = ha.SelectOne
|
|
If da.Rows.Count = 0 Then doinsert1 = True Else doinsert1 = False
|
|
|
|
For k = 0 To xmlNodes(0).ChildNodes.Count - 1
|
|
Adresse_values(xmlNodes(i).ChildNodes(k))
|
|
Next
|
|
Globals.conn.OpenConnection()
|
|
If DoInsert Then
|
|
partner.sCDBAL00 = New SqlString(CType("N", String))
|
|
partner.bCDVSA00 = New SqlBoolean(CType(False, Boolean))
|
|
partner.sCDBAL00 = New SqlString(CType("N", String))
|
|
partner.bCDVSA00 = New SqlBoolean(CType(False, Boolean))
|
|
partner.iAZEPL00 = New SqlInt32(CType(1, Integer))
|
|
partner.sBKPAR00 = New SqlString(CType(Me.BKPAR00, String))
|
|
partner.iNRPAR00 = New SqlInt32(CType(Me.Nrpar00, Integer))
|
|
partner.sNRPARAD = New SqlString(CType(Me.Nrpar00, String))
|
|
partner.Insert()
|
|
Else
|
|
partner.Update()
|
|
End If
|
|
If doinsert1 Then
|
|
ha.Insert()
|
|
Else
|
|
ha.Update()
|
|
End If
|
|
Globals.conn.CloseConnection(True)
|
|
Next
|
|
End Sub
|
|
|
|
Sub Adresse_values(ByVal xmlelement As Xml.XmlElement)
|
|
Dim i As Integer
|
|
Dim s As String
|
|
Dim w As Integer
|
|
Try
|
|
For i = 0 To xmlelement.Attributes.Count - 2
|
|
s = xmlelement.Attributes(i + 1).Value
|
|
If s = "noData" Or s = "null" Then s = ""
|
|
Select Case xmlelement.Attributes(i).Value
|
|
Case "vorname4"
|
|
ha.sBEVNM01 = New SqlString(CType(s, String))
|
|
Case "partnerNrVorAgi"
|
|
Case "agiVersandadresseZeile1"
|
|
partner.sTXADZ011 = New SqlString(CType(s, String))
|
|
Case "titelZwischengestelltNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRTTZ00 = New SqlInt16(CType(s, Int16))
|
|
Case "strasse"
|
|
ha.sBESTR00 = New SqlString(CType(s, String))
|
|
Case "stockwerk"
|
|
ha.sNRSTC00 = New SqlString(CType(s, String))
|
|
Case "hausNr"
|
|
ha.sNRHAU00 = New SqlString(CType(s, String))
|
|
Case "partnerNrAufbereitet"
|
|
Case "vorname3"
|
|
ha.sBEVNM01 = New SqlString(CType(s, String))
|
|
Case "nagiVersandadresseZeile6"
|
|
partner.sTXADZ062 = New SqlString(CType(s, String))
|
|
Case "distrikt"
|
|
ha.sBEDIS00 = New SqlString(CType(s, String))
|
|
Case "anredeNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRARD00 = New SqlInt16(CType(s, Int16))
|
|
Case "postleitzahl"
|
|
ha.sCDPLZ00 = New SqlString(CType(s, String))
|
|
Case "zuHdVorname"
|
|
ha.sBEVNMZH = New SqlString(CType(s, String))
|
|
Case "nachname2"
|
|
ha.sBENNMZ2 = New SqlString(CType(s, String))
|
|
Case "coText1"
|
|
ha.sBECOT01 = New SqlString(CType(s, String))
|
|
Case "zuHdKonstanteNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRZHK00 = New SqlInt16(CType(s, Int16))
|
|
Case "zuHdNamenszusatzNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRNZUZH = New SqlInt16(CType(s, Int16))
|
|
Case "coText2"
|
|
ha.sBECOT02 = New SqlString(CType(s, String))
|
|
Case "agiVersandadresseZeile7"
|
|
partner.sTXADZ071 = New SqlString(CType(s, String))
|
|
Case "vorname1"
|
|
ha.sBEVNM01 = New SqlString(CType(s, String))
|
|
Case "zuHdNachname1"
|
|
ha.sBENNM01 = New SqlString(CType(s, String))
|
|
Case "zuHdAnredeNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRARDZH = New SqlInt16(CType(s, Int16))
|
|
Case "briefanrede1"
|
|
ha.sBEBAN01 = New SqlString(CType(s, String))
|
|
partner.sBEBAN011 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "zuHdTitelZwischengestelltNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRTTZZH = New SqlInt16(CType(s, Int16))
|
|
Case "ortsNrPtt"
|
|
If s = "" Then s = "0"
|
|
ha.iCDORTPT = New SqlInt32(CType(s, Int32))
|
|
Case "nagiVersandadresseZeile4"
|
|
partner.sTXADZ042 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "zuHdNachnameTrennzeichen"
|
|
ha.sBETRZZH = New SqlString(CType(s, String))
|
|
Case "agiVersandadresseZeile6"
|
|
partner.sTXADZ061 = New SqlString(CType(s, String))
|
|
Case "nagiVersandadresseZeile1"
|
|
partner.sTXADZ012 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "vorname2"
|
|
ha.sBEVNM01 = New SqlString(CType(s, String))
|
|
Case "land"
|
|
If s = "" Then s = "0"
|
|
ha.siNRLND00 = New SqlInt16(CType(s, Int16))
|
|
Case "name3"
|
|
ha.sBENAM03 = New SqlString(CType(s, String))
|
|
Case "nachname1"
|
|
ha.sBENNMZ1 = New SqlString(CType(s, String))
|
|
Case "weiler"
|
|
ha.sBEWEI00 = New SqlString(CType(s, String))
|
|
Case "nagiVersandadresseZeile3"
|
|
partner.sTXADZ032 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "namenaenderungsgrundNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRNGR00 = New SqlInt16(CType(s, Int16))
|
|
Case "agiVersandadresseZeile4"
|
|
partner.sTXADZ041 = New SqlString(CType(s, String))
|
|
Case "briefanrede2GrammForm"
|
|
If s = "" Then s = "0"
|
|
ha.siNRFOG02 = New SqlInt16(CType(s, Int16))
|
|
Case "nagiVersandadresseZeile2"
|
|
partner.sTXADZ022 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "nagiVersandadresseZeile7"
|
|
partner.sTXADZ072 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "versandfaehigkeit"
|
|
ha.sSAVRS00 = New SqlString(CType(s, String))
|
|
partner.sSAVRS00 = New SqlString(CType(s, String))
|
|
partner.sCDVIG00 = New SqlString(CType(s, String))
|
|
Case "banklagerndeZustellungVorh"
|
|
If s = "" Then s = "0"
|
|
ha.siNRVAZ00 = New SqlInt16(CType(s, Int16))
|
|
Case "nr"
|
|
Case "postfach"
|
|
ha.sBEFCHPT = New SqlString(CType(s, String))
|
|
Case "nagiVersandadresseZeile5"
|
|
partner.sTXADZ052 = New SqlString(CType(s, String)) 'New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "viAdressZusatz"
|
|
Case "postfachNr"
|
|
ha.sNRFCHPT = New SqlString(CType(s, String))
|
|
Case "strassenNrPtt"
|
|
Case "nachnameTrennzeichen"
|
|
ha.sBETRZNN = New SqlString(CType(s, String))
|
|
Case "briefanrede1GrammForm"
|
|
If s = "" Then s = "0"
|
|
ha.siNRFOG01 = New SqlInt16(CType(s, Int16))
|
|
Case "zuHdNachname2"
|
|
ha.sBENNM02 = New SqlString(CType(s, String))
|
|
Case "unzustellbarkeitsgrundPttNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRUZG00 = New SqlInt16(CType(s, Int16))
|
|
Case "namenszusatzNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRNZU00 = New SqlInt16(CType(s, Int16))
|
|
If s = "" Then s = "0"
|
|
Case "status"
|
|
ha.sSAREC00 = New SqlString(CType(s, String))
|
|
Case "name1"
|
|
ha.sBENAM01 = New SqlString(CType(s, String))
|
|
Case "agiVersandadresseZeile5"
|
|
partner.sTXADZ051 = New SqlString(CType(s, String))
|
|
Case "zuHdTitelVorgestelltNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRTTV00 = New SqlInt16(CType(s, Int16))
|
|
Case "agiVersandadresseZeile3"
|
|
partner.sTXADZ031 = New SqlString(CType(s, String))
|
|
Case "ortszusatz"
|
|
ha.sBEORTZS = New SqlString(CType(s, String))
|
|
Case "name2"
|
|
ha.sBENAM02 = New SqlString(CType(s, String))
|
|
Case "agiVersandadresseZeile2"
|
|
partner.sTXADZ021 = New SqlString(CType(s, String))
|
|
Case "versionsNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRVRN00 = New SqlInt16(CType(s, Int16))
|
|
Case "briefanrede2"
|
|
ha.sBEBAN02 = New SqlString(CType(s, String))
|
|
partner.sBEBAN012 = New SqlString(CType(xmlelement.Attributes(i + 1).Value, String))
|
|
Case "partnerStatus"
|
|
ha.sSAREC01 = New SqlString(CType(s, String))
|
|
Case "artNr"
|
|
Case "titelVorgestelltNr"
|
|
If s = "" Then s = "0"
|
|
ha.siNRTTV00 = New SqlInt16(CType(s, Int16))
|
|
Case "titelNachgestellt"
|
|
ha.sBETTN00 = New SqlString(CType(s, String))
|
|
Case "postort"
|
|
ha.sBEORTPT = New SqlString(CType(s, String))
|
|
End Select
|
|
Next
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Write XML"
|
|
|
|
Public Sub Create_Partner_Anfrage()
|
|
Get_DBValues(1)
|
|
Dim writer As New XmlTextWriter(filename, System.Text.Encoding.GetEncoding("ISO-8859-1"))
|
|
Write_Header(writer, 2)
|
|
Write_Field(writer, "nrAufbereitet", Me.Nrpar00_aufbereitet)
|
|
Write_Field(writer, "partnerdatenLesen", "Y")
|
|
Write_Field(writer, "adresseLesen", "Y")
|
|
Write_Field(writer, "segmentdatenLesen", "Y")
|
|
Write_Field(writer, "betreuerdatenLesen", "N")
|
|
Write_Field(writer, "linkMeldungenPruefen", "N")
|
|
Write_Field(writer, "linkPartnerPartnerBeziehungPruefen", "N")
|
|
Write_Field(writer, "linkWirtschaftlicheEinheitPruefen", "N")
|
|
Write_Field(writer, "linkIdNachweisPruefen", "N")
|
|
Write_Field(writer, "linkVersandinstruktionPruefen", "Y")
|
|
writer.WriteEndElement()
|
|
writer.WriteEndElement()
|
|
writer.Flush()
|
|
writer.Close()
|
|
End Sub
|
|
|
|
Public Sub Create_VV_Abfrage()
|
|
Get_DBValues(2)
|
|
Dim writer As New XmlTextWriter(filename, System.Text.Encoding.GetEncoding("ISO-8859-1"))
|
|
Write_Header(writer, 3)
|
|
|
|
Write_Field(writer, "status", "2")
|
|
Write_Field(writer, "partnerNrAufbereitet", Me.Nrpar00_aufbereitet)
|
|
|
|
' Write_State(writer, "vereinbarungsSubtypNr", "null")
|
|
' Write_State(writer, "vereinbarungsArtNr", "null")
|
|
Write_Field(writer, "vereinbarungsSubtypNr", "0")
|
|
Write_Field(writer, "vereinbarungsArtNr", "0")
|
|
Write_Field(writer, "vvNr", "null")
|
|
writer.WriteEndElement()
|
|
writer.WriteEndElement()
|
|
writer.Flush()
|
|
writer.Close()
|
|
End Sub
|
|
|
|
Public Sub Create_Adress_Abfrage()
|
|
Get_DBValues(3)
|
|
Dim writer As New XmlTextWriter(filename, System.Text.Encoding.GetEncoding("ISO-8859-1"))
|
|
Write_Header(writer, 4)
|
|
Write_Field(writer, "partnerNr", Me.Nrpar00)
|
|
Write_Field(writer, "nr", "1")
|
|
Write_Field(writer, "adressform", "A")
|
|
writer.WriteEndElement()
|
|
writer.WriteEndElement()
|
|
writer.Flush()
|
|
writer.Close()
|
|
|
|
End Sub
|
|
|
|
Private Sub Write_Header(ByVal xmldoc As Xml.XmlTextWriter, ByVal Type As Integer)
|
|
'Type 2 = Partner
|
|
'Type 3 = VV des Partner
|
|
'Type 4 = Aufbereitete Adresse"
|
|
Select Case Type
|
|
Case 2
|
|
xmldoc.WriteStartDocument()
|
|
xmldoc.WriteStartElement("content-request")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.RequestName)
|
|
xmldoc.WriteStartElement("request-header")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "personalNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, Globals.TGNummer)
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "bankNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "TG")
|
|
'xmldoc.WriteAttributeString("", "value", Nothing, "AK")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sessionId")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "standard-sessionId")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sprache")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "1")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("request-params")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "maxAnswers")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "1")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("resultset-content")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.ResutlSetContent)
|
|
xmldoc.WriteStartElement("result-object")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.Resultobject)
|
|
xmldoc.WriteAttributeString("", "recordNumber", Nothing, "0")
|
|
Case 3
|
|
xmldoc.WriteStartDocument()
|
|
xmldoc.WriteStartElement("content-request")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.RequestName)
|
|
xmldoc.WriteStartElement("request-header")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "personalNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, Globals.TGNummer)
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "bankNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "TG")
|
|
'xmldoc.WriteAttributeString("", "value", Nothing, "AK")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sessionId")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "standard-sessionId")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sprache")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "1")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("request-params")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "maxAnswers")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "15")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("resultset-content")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.ResutlSetContent)
|
|
xmldoc.WriteStartElement("result-object")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.Resultobject)
|
|
xmldoc.WriteAttributeString("", "recordNumber", Nothing, "-1")
|
|
Case 4
|
|
xmldoc.WriteStartDocument()
|
|
xmldoc.WriteStartElement("content-request")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.RequestName)
|
|
xmldoc.WriteStartElement("request-header")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "personalNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, Globals.TGNummer)
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "bankNr")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "TG")
|
|
'xmldoc.WriteAttributeString("", "value", Nothing, "AK")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sessionId")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "standard-sessionId")
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "sprache")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "1")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("request-params")
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, "maxAnswers")
|
|
xmldoc.WriteAttributeString("", "value", Nothing, "2")
|
|
xmldoc.WriteEndElement()
|
|
xmldoc.WriteEndElement()
|
|
|
|
xmldoc.WriteStartElement("resultset-content")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.ResutlSetContent)
|
|
xmldoc.WriteStartElement("result-object")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Me.Resultobject)
|
|
xmldoc.WriteAttributeString("", "recordNumber", Nothing, "1")
|
|
End Select
|
|
|
|
End Sub
|
|
|
|
Private Sub Write_Field(ByVal xmldoc As Xml.XmlTextWriter, ByVal Feldname As String, ByVal Feldvalue As String)
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, Feldname)
|
|
xmldoc.WriteAttributeString("", "value", Nothing, Feldvalue)
|
|
xmldoc.WriteEndElement()
|
|
End Sub
|
|
|
|
Private Sub Write_State(ByVal xmldoc As Xml.XmlTextWriter, ByVal feldname As String, ByVal feldvalue As String)
|
|
xmldoc.WriteStartElement("field")
|
|
xmldoc.WriteAttributeString("", "name", Nothing, feldname)
|
|
xmldoc.WriteAttributeString("", "state", Nothing, feldvalue)
|
|
xmldoc.WriteEndElement()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub frmHostTransfer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
'Rel 3.6 BUD
|
|
'TGNummer setzten wenn in Testumgebung
|
|
If Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("showlogin") = True Then
|
|
Globals.TGNummer = "TG3896"
|
|
'MsgBox("TG Nummer gesetzt. Muss noch auf Show Login abgefragt werden.")
|
|
End If
|
|
|
|
If Me.Partner_Exists Then
|
|
label1.Text = MyTxt.gettext(101)
|
|
Else
|
|
label1.Text = MyTxt.gettext(102)
|
|
Button1.Visible = True
|
|
Button2.Visible = True
|
|
End If
|
|
Me.ProgressBar1.Value = 0
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
|
|
Me.DialogResult = DialogResult.Abort
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
|
Dim fehler As Boolean
|
|
Dim s As String
|
|
s = ""
|
|
Try
|
|
If Partner_Exists() Then
|
|
If Me.Get_Data(2) = False Then
|
|
If s.Length > 0 Then s = s + vbCrLf + vbCrLf
|
|
s = s + "Fehler beim Übermitteln der VV-Daten"
|
|
Me.label1.Text = s
|
|
Exit Sub
|
|
End If
|
|
Else
|
|
If Me.Get_Data(1) = False Then
|
|
If s.Length > 0 Then s = s + vbCrLf + vbCrLf
|
|
s = s + "Fehler beim Übermitteln der Partner-Daten"
|
|
Me.label1.Text = s
|
|
Exit Sub
|
|
End If
|
|
If Me.Get_Data(3) = False Then
|
|
If s.Length > 0 Then s = s + vbCrLf + vbCrLf
|
|
s = s + "Fehler beim Übermitteln der Adressdaten"
|
|
Me.label1.Text = s
|
|
Exit Sub
|
|
End If
|
|
If Me.Get_Data(2) = False Then
|
|
If s.Length > 0 Then s = s + vbCrLf + vbCrLf
|
|
s = s + "Fehler beim Übermitteln der VV-Daten bzw. keine VV-Daten im HOST vorhanden."
|
|
Me.label1.Text = s
|
|
Me.Button1.Visible = False
|
|
Me.Button2.Visible = False
|
|
Me.Button3.Visible = True
|
|
Exit Sub
|
|
End If
|
|
End If
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message)
|
|
End Try
|
|
statustext = statustext + "Allfällig vom HOST übernommenen Angaben werden im nächsten halben Tag vervollständigt."
|
|
Me.Button1.Visible = False
|
|
Me.Button2.Visible = False
|
|
Me.Button3.Visible = True
|
|
Me.Update_Progress(statustext, 100)
|
|
End Sub
|
|
|
|
Private Sub Update_Progress(ByVal message As String, ByVal value As Integer)
|
|
Me.ProgressBar1.Value = value
|
|
Me.label1.Text = message
|
|
Application.DoEvents()
|
|
End Sub
|
|
|
|
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
|
|
Me.DialogResult = DialogResult.OK
|
|
End Sub
|
|
|
|
End Class
|