From 96380df56a8fce568172e250c26134774997bdc2 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Fri, 21 Feb 2025 08:51:05 +0100 Subject: [PATCH] UK ENS --- SDL/kunden/usrCntlCBAM.vb | 1 + .../Schnittstellen/HMRC/CHMRC.vb | 70 +- .../HMRC/ENS/CC315A-v11-2.Designer.vb | 2010 +++++++++++-- .../HMRC/ENS/CC328A/CC304A-v10-0.Designer.vb | 2486 +++++++++++++++++ .../HMRC/ENS/CC328A/CC304A-v10-0.xsd | 604 ++++ .../HMRC/ENS/CC328A/CC305A-v10-0.Designer.vb | 1625 +++++++++++ .../HMRC/ENS/CC328A/CC305A-v10-0.xsd | 391 +++ .../HMRC/ENS/CC328A/CC316A-v10-0.Designer.vb | 884 ++++++ .../HMRC/ENS/CC328A/CC316A-v10-0.xsd | 198 ++ .../HMRC/ENS/CC328A/CC328A-v10-0.Designer.vb | 2414 ++++++++++++++++ .../HMRC/ENS/CC328A/CC328A-v10-0.xsd | 550 ++++ .../ENS/CC328A/complex_types_ics-v10-0.xsd | 1754 ++++++++++++ .../HMRC/ENS/CC328A/doc-v10-0.xsd | 24 + .../HMRC/ENS/CC328A/simple_types-v10-0.xsd | 662 +++++ .../ENS/CC328A/simple_types_ics-v10-0.xsd | 2 + .../HMRC/ENS/CC328A/tcl-v10-0.xsd | 769 +++++ .../HMRC/ENS/CC328A/tcl_ics-v10-0.xsd | 2 + .../Response/SuccessResponse-v2-0.Designer.vb | 430 +++ .../HMRC/Response/SuccessResponse-v2-0.xsd | 56 + .../Response/errorresponse-v2.0.Designer.vb | 667 +++++ .../HMRC/Response/errorresponse-v2.0.xsd | 46 + .../Schnittstellen/HMRC/Response/xml.xsd | 286 ++ .../HMRC/Response/xmldsig-core-schema.xsd | 318 +++ .../Schnittstellen/HMRC/cHMRC_ENS.vb | 908 +++++- .../VERAG_PROG_ALLGEMEIN.vbproj | 48 + 25 files changed, 16824 insertions(+), 381 deletions(-) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/complex_types_ics-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/doc-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types_ics-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl_ics-v10-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xml.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xmldsig-core-schema.xsd diff --git a/SDL/kunden/usrCntlCBAM.vb b/SDL/kunden/usrCntlCBAM.vb index 933ddb4b..9523e036 100644 --- a/SDL/kunden/usrCntlCBAM.vb +++ b/SDL/kunden/usrCntlCBAM.vb @@ -414,6 +414,7 @@ Public Class usrCntlCBAM Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600) + MsgBox(SQLSTR) If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, EORI & "_Detailbericht_" & txtVon._value & "-" & txtBis._value) btnCBAM_DS_DAKOSY_Deteil.Tag = path diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb index 0ae6ff74..6df07154 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/CHMRC.vb @@ -1509,42 +1509,48 @@ Public Class cHMRC Shared Function getTOKEN(APPLICATION, Optional forceNewToken = False) As cHMRCToken + Dim TOKEN = New cHMRCToken(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA, APPLICATION) - Dim appl = "" - Dim HMRC_APPLICATION = "AVISO" - Select Case APPLICATION - Case "HELLOWORLD" '"EORI_CHECK" - 'appl = "write:import-control-system+read:import-control-system" - appl = "applicationRestricted" - HMRC_APPLICATION = "AVISO" - Case "GVMS" - appl = "write:goods-movement-system+read:pull-notifications" - HMRC_APPLICATION = "AVISO" - Case "VAT_CHECK" '"EORI_CHECK" - appl = "read:vat write:vat" - HMRC_APPLICATION = "AVISO" - Case "ENS" '"EORI_CHECK" - 'appl = "write:import-control-system+read:import-control-system" - appl = "write:import-control-system" - HMRC_APPLICATION = "AVISO_ENS" - Case "ENS_HELLOWORLD" '"EORI_CHECK" - 'appl = "write:import-control-system+read:import-control-system" - appl = "hello" - HMRC_APPLICATION = "AVISO_ENS" - End Select + Try + Dim appl = "" + Dim HMRC_APPLICATION = "AVISO" + Select Case APPLICATION + Case "HELLOWORLD" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "applicationRestricted" + HMRC_APPLICATION = "AVISO" + Case "GVMS" + appl = "write:goods-movement-system+read:pull-notifications" + HMRC_APPLICATION = "AVISO" + Case "VAT_CHECK" '"EORI_CHECK" + appl = "read:vat write:vat" + HMRC_APPLICATION = "AVISO" + Case "ENS" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "write:import-control-system" + HMRC_APPLICATION = "AVISO_ENS" + Case "ENS_HELLOWORLD" '"EORI_CHECK" + 'appl = "write:import-control-system+read:import-control-system" + appl = "hello" + HMRC_APPLICATION = "AVISO_ENS" + End Select - If forceNewToken OrElse TOKEN.hasEntry = False OrElse TOKEN.token_BEARER_TOKEN Is Nothing OrElse TOKEN.token_BEARER_TOKEN = "" Then - Dim AccessToken = "" - grantAccess(AccessToken, appl, HMRC_APPLICATION) - TOKEN.token_Application = APPLICATION - TOKEN.token_BEARER_TOKEN = AccessToken - TOKEN.token_refresh_datetime = Now - TOKEN.SAVE() - Else - HMRC_RefreshToken(TOKEN, HMRC_APPLICATION) - End If + If forceNewToken OrElse TOKEN.hasEntry = False OrElse TOKEN.token_BEARER_TOKEN Is Nothing OrElse TOKEN.token_BEARER_TOKEN = "" Then + Dim AccessToken = "" + grantAccess(AccessToken, appl, HMRC_APPLICATION) + TOKEN.token_Application = APPLICATION + TOKEN.token_BEARER_TOKEN = AccessToken + TOKEN.token_refresh_datetime = Now + TOKEN.SAVE() + Else + HMRC_RefreshToken(TOKEN, HMRC_APPLICATION) + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try Return TOKEN End Function diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb index d55ca5f5..28e0dc83 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC315A-v11-2.Designer.vb @@ -1,7 +1,7 @@ '' ------------------------------------------------------------------------------ '' '' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com -'' {"TargetFramework":"Net48","NameSpace":"ENS_CC315A","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' {"TargetFramework":"Net48","NameSpace":"ENS_CC315A","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{"IgnoreEmptyNullable":true,"IgnoreEmptyString":true,"IgnoreEmptyCollection":true,"IgnoreEmptyComplexType":true,"IgnoreEmptySimpleType":true,"IgnoreEmptyEnumType":true},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true,"NewLineOnAttributes":true,"OmitXmlDeclaration":true},"JsonOutput":{},"Enabled":true,"EnableEncoding":true},"Miscellaneous":{},"InitializeFields":"AllExceptOptional"} '' '' ------------------------------------------------------------------------------ #Disable Warning @@ -28,6 +28,8 @@ Namespace ENS_CC315A Partial Public Class CC315AType #Region "Private fields" + Private _shouldSerializeMesTypMES20 As Boolean + Private _mesSenMES3 As String Private _mesRecMES6 As String @@ -75,18 +77,9 @@ Namespace ENS_CC315A Public Sub New() MyBase.New - Me._tRACARENT601 = New TRACARENT601Type() - Me._cUSOFFSENT740 = New List(Of CUSOFFSENT740Type)() Me._cUSOFFFENT730 = New CUSOFFFENT730Type() - Me._sEAID529 = New List(Of SEAID529Type)() Me._pERLODSUMDEC = New PERLODSUMDECType() - Me._tRAREP = New TRAREPType() - Me._cUSOFFLON = New CUSOFFLONType() - Me._iTI = New List(Of ITIType)() Me._gOOITEGDS = New List(Of GOOITEGDSType)() - Me._nOTPAR670 = New NOTPAR670Type() - Me._tRACONCE1 = New TRACONCE1Type() - Me._tRACONCO1 = New TRACONCO1Type() Me._hEAHEA = New HEAHEAType() End Sub @@ -157,6 +150,7 @@ Namespace ENS_CC315A End Get Set Me._mesTypMES20 = Value + _shouldSerializeMesTypMES20 = True End Set End Property @@ -309,23 +303,176 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether GOOITEGDS should be serialized + ''' + Public Overridable Function ShouldSerializeGOOITEGDS() As Boolean + Return GOOITEGDS IsNot Nothing And GOOITEGDS.Count > 0 + End Function + + ''' + ''' Test whether ITI should be serialized + ''' + Public Overridable Function ShouldSerializeITI() As Boolean + Return ITI IsNot Nothing And ITI.Count > 0 + End Function + + ''' + ''' Test whether SEAID529 should be serialized + ''' + Public Overridable Function ShouldSerializeSEAID529() As Boolean + Return SEAID529 IsNot Nothing And SEAID529.Count > 0 + End Function + + ''' + ''' Test whether CUSOFFSENT740 should be serialized + ''' + Public Overridable Function ShouldSerializeCUSOFFSENT740() As Boolean + Return CUSOFFSENT740 IsNot Nothing And CUSOFFSENT740.Count > 0 + End Function + + ''' + ''' Test whether MesTypMES20 should be serialized + ''' + Public Overridable Function ShouldSerializeMesTypMES20() As Boolean + If _shouldSerializeMesTypMES20 Then + Return True + End If + Return (_mesTypMES20 <> CType(Nothing, MessageTypes)) + End Function + + ''' + ''' Test whether HEAHEA should be serialized + ''' + Public Overridable Function ShouldSerializeHEAHEA() As Boolean + Return (Equals(_hEAHEA, Nothing) <> True) + End Function + + ''' + ''' Test whether TRACONCO1 should be serialized + ''' + Public Overridable Function ShouldSerializeTRACONCO1() As Boolean + Return (Equals(_tRACONCO1, Nothing) <> True) + End Function + + ''' + ''' Test whether TRACONCE1 should be serialized + ''' + Public Overridable Function ShouldSerializeTRACONCE1() As Boolean + Return (Equals(_tRACONCE1, Nothing) <> True) + End Function + + ''' + ''' Test whether NOTPAR670 should be serialized + ''' + Public Overridable Function ShouldSerializeNOTPAR670() As Boolean + Return (Equals(_nOTPAR670, Nothing) <> True) + End Function + + ''' + ''' Test whether CUSOFFLON should be serialized + ''' + Public Overridable Function ShouldSerializeCUSOFFLON() As Boolean + Return (Equals(_cUSOFFLON, Nothing) <> True) + End Function + + ''' + ''' Test whether TRAREP should be serialized + ''' + Public Overridable Function ShouldSerializeTRAREP() As Boolean + Return (Equals(_tRAREP, Nothing) <> True) + End Function + + ''' + ''' Test whether PERLODSUMDEC should be serialized + ''' + Public Overridable Function ShouldSerializePERLODSUMDEC() As Boolean + Return (Equals(_pERLODSUMDEC, Nothing) <> True) + End Function + + ''' + ''' Test whether CUSOFFFENT730 should be serialized + ''' + Public Overridable Function ShouldSerializeCUSOFFFENT730() As Boolean + Return (Equals(_cUSOFFFENT730, Nothing) <> True) + End Function + + ''' + ''' Test whether TRACARENT601 should be serialized + ''' + Public Overridable Function ShouldSerializeTRACARENT601() As Boolean + Return (Equals(_tRACARENT601, Nothing) <> True) + End Function + + ''' + ''' Test whether MesSenMES3 should be serialized + ''' + Public Overridable Function ShouldSerializeMesSenMES3() As Boolean + Return Not String.IsNullOrEmpty(MesSenMES3) + End Function + + ''' + ''' Test whether MesRecMES6 should be serialized + ''' + Public Overridable Function ShouldSerializeMesRecMES6() As Boolean + Return Not String.IsNullOrEmpty(MesRecMES6) + End Function + + ''' + ''' Test whether DatOfPreMES9 should be serialized + ''' + Public Overridable Function ShouldSerializeDatOfPreMES9() As Boolean + Return Not String.IsNullOrEmpty(DatOfPreMES9) + End Function + + ''' + ''' Test whether TimOfPreMES10 should be serialized + ''' + Public Overridable Function ShouldSerializeTimOfPreMES10() As Boolean + Return Not String.IsNullOrEmpty(TimOfPreMES10) + End Function + + ''' + ''' Test whether PriMES15 should be serialized + ''' + Public Overridable Function ShouldSerializePriMES15() As Boolean + Return Not String.IsNullOrEmpty(PriMES15) + End Function + + ''' + ''' Test whether MesIdeMES19 should be serialized + ''' + Public Overridable Function ShouldSerializeMesIdeMES19() As Boolean + Return Not String.IsNullOrEmpty(MesIdeMES19) + End Function + + ''' + ''' Test whether CorIdeMES25 should be serialized + ''' + Public Overridable Function ShouldSerializeCorIdeMES25() As Boolean + Return Not String.IsNullOrEmpty(CorIdeMES25) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize CC315AType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -337,6 +484,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes CC315AType object ''' @@ -384,10 +535,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -395,12 +546,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -417,11 +575,11 @@ Namespace ENS_CC315A ''' Output CC315AType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CC315AType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -429,17 +587,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC315AType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CC315AType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -529,6 +695,8 @@ Namespace ENS_CC315A Partial Public Class HEAHEAType #Region "Private fields" + Private _shouldSerializeTotGroMasHEA307 As Boolean + Private _refNumHEA4 As String Private _traModAtBorHEA76 As String @@ -647,6 +815,7 @@ Namespace ENS_CC315A End Get Set Me._totGroMasHEA307 = Value + _shouldSerializeTotGroMasHEA307 = True End Set End Property @@ -769,23 +938,159 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether TotGroMasHEA307 should be serialized + ''' + Public Overridable Function ShouldSerializeTotGroMasHEA307() As Boolean + Return (Equals(_totGroMasHEA307, Nothing) <> True) + End Function + + ''' + ''' Test whether RefNumHEA4 should be serialized + ''' + Public Overridable Function ShouldSerializeRefNumHEA4() As Boolean + Return Not String.IsNullOrEmpty(RefNumHEA4) + End Function + + ''' + ''' Test whether TraModAtBorHEA76 should be serialized + ''' + Public Overridable Function ShouldSerializeTraModAtBorHEA76() As Boolean + Return Not String.IsNullOrEmpty(TraModAtBorHEA76) + End Function + + ''' + ''' Test whether IdeOfMeaOfTraCroHEA85 should be serialized + ''' + Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85() As Boolean + Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85) + End Function + + ''' + ''' Test whether IdeOfMeaOfTraCroHEA85LNG should be serialized + ''' + Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85LNG() As Boolean + Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85LNG) + End Function + + ''' + ''' Test whether NatOfMeaOfTraCroHEA87 should be serialized + ''' + Public Overridable Function ShouldSerializeNatOfMeaOfTraCroHEA87() As Boolean + Return Not String.IsNullOrEmpty(NatOfMeaOfTraCroHEA87) + End Function + + ''' + ''' Test whether TotNumOfIteHEA305 should be serialized + ''' + Public Overridable Function ShouldSerializeTotNumOfIteHEA305() As Boolean + Return Not String.IsNullOrEmpty(TotNumOfIteHEA305) + End Function + + ''' + ''' Test whether TotNumOfPacHEA306 should be serialized + ''' + Public Overridable Function ShouldSerializeTotNumOfPacHEA306() As Boolean + Return Not String.IsNullOrEmpty(TotNumOfPacHEA306) + End Function + + ''' + ''' Test whether DecPlaHEA394 should be serialized + ''' + Public Overridable Function ShouldSerializeDecPlaHEA394() As Boolean + Return Not String.IsNullOrEmpty(DecPlaHEA394) + End Function + + ''' + ''' Test whether DecPlaHEA394LNG should be serialized + ''' + Public Overridable Function ShouldSerializeDecPlaHEA394LNG() As Boolean + Return Not String.IsNullOrEmpty(DecPlaHEA394LNG) + End Function + + ''' + ''' Test whether SpeCirIndHEA1 should be serialized + ''' + Public Overridable Function ShouldSerializeSpeCirIndHEA1() As Boolean + Return Not String.IsNullOrEmpty(SpeCirIndHEA1) + End Function + + ''' + ''' Test whether TraChaMetOfPayHEA1 should be serialized + ''' + Public Overridable Function ShouldSerializeTraChaMetOfPayHEA1() As Boolean + Return Not String.IsNullOrEmpty(TraChaMetOfPayHEA1) + End Function + + ''' + ''' Test whether ComRefNumHEA should be serialized + ''' + Public Overridable Function ShouldSerializeComRefNumHEA() As Boolean + Return Not String.IsNullOrEmpty(ComRefNumHEA) + End Function + + ''' + ''' Test whether ConRefNumHEA should be serialized + ''' + Public Overridable Function ShouldSerializeConRefNumHEA() As Boolean + Return Not String.IsNullOrEmpty(ConRefNumHEA) + End Function + + ''' + ''' Test whether PlaLoaGOOITE334 should be serialized + ''' + Public Overridable Function ShouldSerializePlaLoaGOOITE334() As Boolean + Return Not String.IsNullOrEmpty(PlaLoaGOOITE334) + End Function + + ''' + ''' Test whether PlaLoaGOOITE334LNG should be serialized + ''' + Public Overridable Function ShouldSerializePlaLoaGOOITE334LNG() As Boolean + Return Not String.IsNullOrEmpty(PlaLoaGOOITE334LNG) + End Function + + ''' + ''' Test whether PlaUnlGOOITE334 should be serialized + ''' + Public Overridable Function ShouldSerializePlaUnlGOOITE334() As Boolean + Return Not String.IsNullOrEmpty(PlaUnlGOOITE334) + End Function + + ''' + ''' Test whether CodPlUnHEA357LNG should be serialized + ''' + Public Overridable Function ShouldSerializeCodPlUnHEA357LNG() As Boolean + Return Not String.IsNullOrEmpty(CodPlUnHEA357LNG) + End Function + + ''' + ''' Test whether DecDatTimHEA114 should be serialized + ''' + Public Overridable Function ShouldSerializeDecDatTimHEA114() As Boolean + Return Not String.IsNullOrEmpty(DecDatTimHEA114) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize HEAHEAType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -797,6 +1102,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes HEAHEAType object ''' @@ -844,10 +1153,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -855,12 +1164,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -877,11 +1193,11 @@ Namespace ENS_CC315A ''' Output HEAHEAType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, HEAHEAType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -889,17 +1205,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As HEAHEAType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -1019,23 +1343,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamTRACARENT604 should be serialized + ''' + Public Overridable Function ShouldSerializeNamTRACARENT604() As Boolean + Return Not String.IsNullOrEmpty(NamTRACARENT604) + End Function + + ''' + ''' Test whether StrNumTRACARENT607 should be serialized + ''' + Public Overridable Function ShouldSerializeStrNumTRACARENT607() As Boolean + Return Not String.IsNullOrEmpty(StrNumTRACARENT607) + End Function + + ''' + ''' Test whether PstCodTRACARENT606 should be serialized + ''' + Public Overridable Function ShouldSerializePstCodTRACARENT606() As Boolean + Return Not String.IsNullOrEmpty(PstCodTRACARENT606) + End Function + + ''' + ''' Test whether CtyTRACARENT603 should be serialized + ''' + Public Overridable Function ShouldSerializeCtyTRACARENT603() As Boolean + Return Not String.IsNullOrEmpty(CtyTRACARENT603) + End Function + + ''' + ''' Test whether CouCodTRACARENT605 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCodTRACARENT605() As Boolean + Return Not String.IsNullOrEmpty(CouCodTRACARENT605) + End Function + + ''' + ''' Test whether TRACARENT601LNG should be serialized + ''' + Public Overridable Function ShouldSerializeTRACARENT601LNG() As Boolean + Return Not String.IsNullOrEmpty(TRACARENT601LNG) + End Function + + ''' + ''' Test whether TINTRACARENT602 should be serialized + ''' + Public Overridable Function ShouldSerializeTINTRACARENT602() As Boolean + Return Not String.IsNullOrEmpty(TINTRACARENT602) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRACARENT601Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -1047,6 +1423,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRACARENT601Type object ''' @@ -1094,10 +1474,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -1105,12 +1485,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -1127,11 +1514,11 @@ Namespace ENS_CC315A ''' Output TRACARENT601Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACARENT601Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -1139,17 +1526,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACARENT601Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACARENT601Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -1197,23 +1592,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether RefNumSUBENR909 should be serialized + ''' + Public Overridable Function ShouldSerializeRefNumSUBENR909() As Boolean + Return Not String.IsNullOrEmpty(RefNumSUBENR909) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFSENT740Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -1225,6 +1630,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes CUSOFFSENT740Type object ''' @@ -1272,10 +1681,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -1283,12 +1692,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -1305,11 +1721,11 @@ Namespace ENS_CC315A ''' Output CUSOFFSENT740Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFSENT740Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -1317,17 +1733,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFSENT740Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFSENT740Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -1387,23 +1811,40 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether RefNumCUSOFFFENT731 should be serialized + ''' + Public Overridable Function ShouldSerializeRefNumCUSOFFFENT731() As Boolean + Return Not String.IsNullOrEmpty(RefNumCUSOFFFENT731) + End Function + + ''' + ''' Test whether ExpDatOfArrFIRENT733 should be serialized + ''' + Public Overridable Function ShouldSerializeExpDatOfArrFIRENT733() As Boolean + Return Not String.IsNullOrEmpty(ExpDatOfArrFIRENT733) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFFENT730Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -1415,6 +1856,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes CUSOFFFENT730Type object ''' @@ -1462,10 +1907,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -1473,12 +1918,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -1495,11 +1947,11 @@ Namespace ENS_CC315A ''' Output CUSOFFFENT730Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFFENT730Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -1507,17 +1959,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFFENT730Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -1577,23 +2037,40 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether SeaIdSEAID530 should be serialized + ''' + Public Overridable Function ShouldSerializeSeaIdSEAID530() As Boolean + Return Not String.IsNullOrEmpty(SeaIdSEAID530) + End Function + + ''' + ''' Test whether SeaIdSEAID530LNG should be serialized + ''' + Public Overridable Function ShouldSerializeSeaIdSEAID530LNG() As Boolean + Return Not String.IsNullOrEmpty(SeaIdSEAID530LNG) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize SEAID529Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -1605,6 +2082,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes SEAID529Type object ''' @@ -1652,10 +2133,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -1663,12 +2144,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -1685,11 +2173,11 @@ Namespace ENS_CC315A ''' Output SEAID529Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SEAID529Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -1697,17 +2185,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SEAID529Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SEAID529Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -1827,23 +2323,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializeNamPLD1() As Boolean + Return Not String.IsNullOrEmpty(NamPLD1) + End Function + + ''' + ''' Test whether StrAndNumPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumPLD1() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumPLD1) + End Function + + ''' + ''' Test whether PosCodPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodPLD1() As Boolean + Return Not String.IsNullOrEmpty(PosCodPLD1) + End Function + + ''' + ''' Test whether CitPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializeCitPLD1() As Boolean + Return Not String.IsNullOrEmpty(CitPLD1) + End Function + + ''' + ''' Test whether CouCodPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCodPLD1() As Boolean + Return Not String.IsNullOrEmpty(CouCodPLD1) + End Function + + ''' + ''' Test whether PERLODSUMDECLNG should be serialized + ''' + Public Overridable Function ShouldSerializePERLODSUMDECLNG() As Boolean + Return Not String.IsNullOrEmpty(PERLODSUMDECLNG) + End Function + + ''' + ''' Test whether TINPLD1 should be serialized + ''' + Public Overridable Function ShouldSerializeTINPLD1() As Boolean + Return Not String.IsNullOrEmpty(TINPLD1) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize PERLODSUMDECType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -1855,6 +2403,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes PERLODSUMDECType object ''' @@ -1902,10 +2454,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -1913,12 +2465,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -1935,11 +2494,11 @@ Namespace ENS_CC315A ''' Output PERLODSUMDECType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PERLODSUMDECType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -1947,17 +2506,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PERLODSUMDECType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -2077,23 +2644,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializeNamTRE1() As Boolean + Return Not String.IsNullOrEmpty(NamTRE1) + End Function + + ''' + ''' Test whether StrAndNumTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumTRE1() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumTRE1) + End Function + + ''' + ''' Test whether PosCodTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodTRE1() As Boolean + Return Not String.IsNullOrEmpty(PosCodTRE1) + End Function + + ''' + ''' Test whether CitTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializeCitTRE1() As Boolean + Return Not String.IsNullOrEmpty(CitTRE1) + End Function + + ''' + ''' Test whether CouCodTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCodTRE1() As Boolean + Return Not String.IsNullOrEmpty(CouCodTRE1) + End Function + + ''' + ''' Test whether TRAREPLNG should be serialized + ''' + Public Overridable Function ShouldSerializeTRAREPLNG() As Boolean + Return Not String.IsNullOrEmpty(TRAREPLNG) + End Function + + ''' + ''' Test whether TINTRE1 should be serialized + ''' + Public Overridable Function ShouldSerializeTINTRE1() As Boolean + Return Not String.IsNullOrEmpty(TINTRE1) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRAREPType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -2105,6 +2724,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRAREPType object ''' @@ -2152,10 +2775,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -2163,12 +2786,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -2185,11 +2815,11 @@ Namespace ENS_CC315A ''' Output TRAREPType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRAREPType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -2197,17 +2827,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRAREPType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRAREPType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -2255,23 +2893,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether RefNumCOL1 should be serialized + ''' + Public Overridable Function ShouldSerializeRefNumCOL1() As Boolean + Return Not String.IsNullOrEmpty(RefNumCOL1) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize CUSOFFLONType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -2283,6 +2931,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes CUSOFFLONType object ''' @@ -2330,10 +2982,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -2341,12 +2993,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -2363,11 +3022,11 @@ Namespace ENS_CC315A ''' Output CUSOFFLONType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CUSOFFLONType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -2375,17 +3034,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFLONType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFLONType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -2433,23 +3100,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether CouOfRouCodITI1 should be serialized + ''' + Public Overridable Function ShouldSerializeCouOfRouCodITI1() As Boolean + Return Not String.IsNullOrEmpty(CouOfRouCodITI1) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize ITIType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -2461,6 +3138,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes ITIType object ''' @@ -2508,10 +3189,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -2519,12 +3200,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -2541,11 +3229,11 @@ Namespace ENS_CC315A ''' Output ITIType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, ITIType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -2553,17 +3241,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ITIType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As ITIType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -2683,23 +3379,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamPRTNOT642 should be serialized + ''' + Public Overridable Function ShouldSerializeNamPRTNOT642() As Boolean + Return Not String.IsNullOrEmpty(NamPRTNOT642) + End Function + + ''' + ''' Test whether StrNumPRTNOT646 should be serialized + ''' + Public Overridable Function ShouldSerializeStrNumPRTNOT646() As Boolean + Return Not String.IsNullOrEmpty(StrNumPRTNOT646) + End Function + + ''' + ''' Test whether PstCodPRTNOT644 should be serialized + ''' + Public Overridable Function ShouldSerializePstCodPRTNOT644() As Boolean + Return Not String.IsNullOrEmpty(PstCodPRTNOT644) + End Function + + ''' + ''' Test whether CtyPRTNOT643 should be serialized + ''' + Public Overridable Function ShouldSerializeCtyPRTNOT643() As Boolean + Return Not String.IsNullOrEmpty(CtyPRTNOT643) + End Function + + ''' + ''' Test whether CouCodGINOT647 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCodGINOT647() As Boolean + Return Not String.IsNullOrEmpty(CouCodGINOT647) + End Function + + ''' + ''' Test whether PRTNOT640LNG should be serialized + ''' + Public Overridable Function ShouldSerializePRTNOT640LNG() As Boolean + Return Not String.IsNullOrEmpty(PRTNOT640LNG) + End Function + + ''' + ''' Test whether TINPRTNOT641 should be serialized + ''' + Public Overridable Function ShouldSerializeTINPRTNOT641() As Boolean + Return Not String.IsNullOrEmpty(TINPRTNOT641) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize PRTNOT640Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -2711,6 +3459,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes PRTNOT640Type object ''' @@ -2758,10 +3510,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -2769,12 +3521,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -2791,11 +3550,11 @@ Namespace ENS_CC315A ''' Output PRTNOT640Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRTNOT640Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -2803,17 +3562,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRTNOT640Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRTNOT640Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -2909,23 +3676,61 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether KinOfPacGS23 should be serialized + ''' + Public Overridable Function ShouldSerializeKinOfPacGS23() As Boolean + Return Not String.IsNullOrEmpty(KinOfPacGS23) + End Function + + ''' + ''' Test whether NumOfPacGS24 should be serialized + ''' + Public Overridable Function ShouldSerializeNumOfPacGS24() As Boolean + Return Not String.IsNullOrEmpty(NumOfPacGS24) + End Function + + ''' + ''' Test whether NumOfPieGS25 should be serialized + ''' + Public Overridable Function ShouldSerializeNumOfPieGS25() As Boolean + Return Not String.IsNullOrEmpty(NumOfPieGS25) + End Function + + ''' + ''' Test whether MarNumOfPacGSL21 should be serialized + ''' + Public Overridable Function ShouldSerializeMarNumOfPacGSL21() As Boolean + Return Not String.IsNullOrEmpty(MarNumOfPacGSL21) + End Function + + ''' + ''' Test whether MarNumOfPacGSL21LNG should be serialized + ''' + Public Overridable Function ShouldSerializeMarNumOfPacGSL21LNG() As Boolean + Return Not String.IsNullOrEmpty(MarNumOfPacGSL21LNG) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize PACGS2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -2937,6 +3742,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes PACGS2Type object ''' @@ -2984,10 +3793,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -2995,12 +3804,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -3017,11 +3833,11 @@ Namespace ENS_CC315A ''' Output PACGS2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PACGS2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -3029,17 +3845,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PACGS2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PACGS2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -3111,23 +3935,47 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NatIDEMEATRAGI973 should be serialized + ''' + Public Overridable Function ShouldSerializeNatIDEMEATRAGI973() As Boolean + Return Not String.IsNullOrEmpty(NatIDEMEATRAGI973) + End Function + + ''' + ''' Test whether IdeMeaTraGIMEATRA971 should be serialized + ''' + Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA971() As Boolean + Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA971) + End Function + + ''' + ''' Test whether IdeMeaTraGIMEATRA972LNG should be serialized + ''' + Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA972LNG() As Boolean + Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA972LNG) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize IDEMEATRAGI970Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -3139,6 +3987,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes IDEMEATRAGI970Type object ''' @@ -3186,10 +4038,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -3197,12 +4049,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -3219,11 +4078,11 @@ Namespace ENS_CC315A ''' Output IDEMEATRAGI970Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, IDEMEATRAGI970Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -3231,17 +4090,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IDEMEATRAGI970Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As IDEMEATRAGI970Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -3289,23 +4156,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether ConNumNR21 should be serialized + ''' + Public Overridable Function ShouldSerializeConNumNR21() As Boolean + Return Not String.IsNullOrEmpty(ConNumNR21) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize CONNR2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -3317,6 +4194,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes CONNR2Type object ''' @@ -3364,10 +4245,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -3375,12 +4256,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -3397,11 +4285,11 @@ Namespace ENS_CC315A ''' Output CONNR2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, CONNR2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -3409,17 +4297,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CONNR2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CONNR2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -3539,23 +4435,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamCE27 should be serialized + ''' + Public Overridable Function ShouldSerializeNamCE27() As Boolean + Return Not String.IsNullOrEmpty(NamCE27) + End Function + + ''' + ''' Test whether StrAndNumCE222 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumCE222() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumCE222) + End Function + + ''' + ''' Test whether PosCodCE223 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodCE223() As Boolean + Return Not String.IsNullOrEmpty(PosCodCE223) + End Function + + ''' + ''' Test whether CitCE224 should be serialized + ''' + Public Overridable Function ShouldSerializeCitCE224() As Boolean + Return Not String.IsNullOrEmpty(CitCE224) + End Function + + ''' + ''' Test whether CouCE225 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCE225() As Boolean + Return Not String.IsNullOrEmpty(CouCE225) + End Function + + ''' + ''' Test whether NADLNGGICE should be serialized + ''' + Public Overridable Function ShouldSerializeNADLNGGICE() As Boolean + Return Not String.IsNullOrEmpty(NADLNGGICE) + End Function + + ''' + ''' Test whether TINCE259 should be serialized + ''' + Public Overridable Function ShouldSerializeTINCE259() As Boolean + Return Not String.IsNullOrEmpty(TINCE259) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCE2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -3567,6 +4515,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRACONCE2Type object ''' @@ -3614,10 +4566,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -3625,12 +4577,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -3647,11 +4606,11 @@ Namespace ENS_CC315A ''' Output TRACONCE2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -3659,17 +4618,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -3717,23 +4684,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether ComNomCMD1 should be serialized + ''' + Public Overridable Function ShouldSerializeComNomCMD1() As Boolean + Return Not String.IsNullOrEmpty(ComNomCMD1) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize COMCODGODITMType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -3745,6 +4722,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes COMCODGODITMType object ''' @@ -3792,10 +4773,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -3803,12 +4784,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -3825,11 +4813,11 @@ Namespace ENS_CC315A ''' Output COMCODGODITMType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, COMCODGODITMType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -3837,17 +4825,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As COMCODGODITMType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As COMCODGODITMType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -3967,23 +4963,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamCO27 should be serialized + ''' + Public Overridable Function ShouldSerializeNamCO27() As Boolean + Return Not String.IsNullOrEmpty(NamCO27) + End Function + + ''' + ''' Test whether StrAndNumCO222 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumCO222() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumCO222) + End Function + + ''' + ''' Test whether PosCodCO223 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodCO223() As Boolean + Return Not String.IsNullOrEmpty(PosCodCO223) + End Function + + ''' + ''' Test whether CitCO224 should be serialized + ''' + Public Overridable Function ShouldSerializeCitCO224() As Boolean + Return Not String.IsNullOrEmpty(CitCO224) + End Function + + ''' + ''' Test whether CouCO225 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCO225() As Boolean + Return Not String.IsNullOrEmpty(CouCO225) + End Function + + ''' + ''' Test whether NADLNGGTCO should be serialized + ''' + Public Overridable Function ShouldSerializeNADLNGGTCO() As Boolean + Return Not String.IsNullOrEmpty(NADLNGGTCO) + End Function + + ''' + ''' Test whether TINCO259 should be serialized + ''' + Public Overridable Function ShouldSerializeTINCO259() As Boolean + Return Not String.IsNullOrEmpty(TINCO259) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCO2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -3995,6 +5043,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRACONCO2Type object ''' @@ -4042,10 +5094,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -4053,12 +5105,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -4075,11 +5134,11 @@ Namespace ENS_CC315A ''' Output TRACONCO2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -4087,17 +5146,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -4145,23 +5212,33 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether AddInfCodMT23 should be serialized + ''' + Public Overridable Function ShouldSerializeAddInfCodMT23() As Boolean + Return Not String.IsNullOrEmpty(AddInfCodMT23) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize SPEMENMT2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -4173,6 +5250,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes SPEMENMT2Type object ''' @@ -4220,10 +5301,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -4231,12 +5312,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -4253,11 +5341,11 @@ Namespace ENS_CC315A ''' Output SPEMENMT2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, SPEMENMT2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -4265,17 +5353,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SPEMENMT2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SPEMENMT2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -4347,23 +5443,47 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether DocTypDC21 should be serialized + ''' + Public Overridable Function ShouldSerializeDocTypDC21() As Boolean + Return Not String.IsNullOrEmpty(DocTypDC21) + End Function + + ''' + ''' Test whether DocRefDC23 should be serialized + ''' + Public Overridable Function ShouldSerializeDocRefDC23() As Boolean + Return Not String.IsNullOrEmpty(DocRefDC23) + End Function + + ''' + ''' Test whether DocRefDCLNG should be serialized + ''' + Public Overridable Function ShouldSerializeDocRefDCLNG() As Boolean + Return Not String.IsNullOrEmpty(DocRefDCLNG) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize PRODOCDC2Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -4375,6 +5495,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes PRODOCDC2Type object ''' @@ -4422,10 +5546,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -4433,12 +5557,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -4455,11 +5586,11 @@ Namespace ENS_CC315A ''' Output PRODOCDC2Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, PRODOCDC2Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -4467,17 +5598,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRODOCDC2Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRODOCDC2Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -4501,6 +5640,8 @@ Namespace ENS_CC315A Partial Public Class GOOITEGDSType #Region "Private fields" + Private _shouldSerializeGroMasGDS46 As Boolean + Private _iteNumGDS7 As String Private _gooDesGDS23 As String @@ -4544,19 +5685,6 @@ Namespace ENS_CC315A Private Shared _serializerXml As XmlSerializer #End Region - Public Sub New() - MyBase.New - Me._pRTNOT640 = New PRTNOT640Type() - Me._pACGS2 = New List(Of PACGS2Type)() - Me._iDEMEATRAGI970 = New List(Of IDEMEATRAGI970Type)() - Me._cONNR2 = New List(Of CONNR2Type)() - Me._tRACONCE2 = New TRACONCE2Type() - Me._cOMCODGODITM = New COMCODGODITMType() - Me._tRACONCO2 = New TRACONCO2Type() - Me._sPEMENMT2 = New List(Of SPEMENMT2Type)() - Me._pRODOCDC2 = New List(Of PRODOCDC2Type)() - End Sub - Public Property IteNumGDS7() As String Get @@ -4594,6 +5722,7 @@ Namespace ENS_CC315A End Get Set Me._groMasGDS46 = Value + _shouldSerializeGroMasGDS46 = True End Set End Property @@ -4766,23 +5895,166 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether PRODOCDC2 should be serialized + ''' + Public Overridable Function ShouldSerializePRODOCDC2() As Boolean + Return PRODOCDC2 IsNot Nothing And PRODOCDC2.Count > 0 + End Function + + ''' + ''' Test whether SPEMENMT2 should be serialized + ''' + Public Overridable Function ShouldSerializeSPEMENMT2() As Boolean + Return SPEMENMT2 IsNot Nothing And SPEMENMT2.Count > 0 + End Function + + ''' + ''' Test whether CONNR2 should be serialized + ''' + Public Overridable Function ShouldSerializeCONNR2() As Boolean + Return CONNR2 IsNot Nothing And CONNR2.Count > 0 + End Function + + ''' + ''' Test whether IDEMEATRAGI970 should be serialized + ''' + Public Overridable Function ShouldSerializeIDEMEATRAGI970() As Boolean + Return IDEMEATRAGI970 IsNot Nothing And IDEMEATRAGI970.Count > 0 + End Function + + ''' + ''' Test whether PACGS2 should be serialized + ''' + Public Overridable Function ShouldSerializePACGS2() As Boolean + Return PACGS2 IsNot Nothing And PACGS2.Count > 0 + End Function + + ''' + ''' Test whether GroMasGDS46 should be serialized + ''' + Public Overridable Function ShouldSerializeGroMasGDS46() As Boolean + Return (Equals(_groMasGDS46, Nothing) <> True) + End Function + + ''' + ''' Test whether TRACONCO2 should be serialized + ''' + Public Overridable Function ShouldSerializeTRACONCO2() As Boolean + Return (Equals(_tRACONCO2, Nothing) <> True) + End Function + + ''' + ''' Test whether COMCODGODITM should be serialized + ''' + Public Overridable Function ShouldSerializeCOMCODGODITM() As Boolean + Return (Equals(_cOMCODGODITM, Nothing) <> True) + End Function + + ''' + ''' Test whether TRACONCE2 should be serialized + ''' + Public Overridable Function ShouldSerializeTRACONCE2() As Boolean + Return (Equals(_tRACONCE2, Nothing) <> True) + End Function + + ''' + ''' Test whether PRTNOT640 should be serialized + ''' + Public Overridable Function ShouldSerializePRTNOT640() As Boolean + Return (Equals(_pRTNOT640, Nothing) <> True) + End Function + + ''' + ''' Test whether IteNumGDS7 should be serialized + ''' + Public Overridable Function ShouldSerializeIteNumGDS7() As Boolean + Return Not String.IsNullOrEmpty(IteNumGDS7) + End Function + + ''' + ''' Test whether GooDesGDS23 should be serialized + ''' + Public Overridable Function ShouldSerializeGooDesGDS23() As Boolean + Return Not String.IsNullOrEmpty(GooDesGDS23) + End Function + + ''' + ''' Test whether GooDesGDS23LNG should be serialized + ''' + Public Overridable Function ShouldSerializeGooDesGDS23LNG() As Boolean + Return Not String.IsNullOrEmpty(GooDesGDS23LNG) + End Function + + ''' + ''' Test whether MetOfPayGDI12 should be serialized + ''' + Public Overridable Function ShouldSerializeMetOfPayGDI12() As Boolean + Return Not String.IsNullOrEmpty(MetOfPayGDI12) + End Function + + ''' + ''' Test whether ComRefNumGIM1 should be serialized + ''' + Public Overridable Function ShouldSerializeComRefNumGIM1() As Boolean + Return Not String.IsNullOrEmpty(ComRefNumGIM1) + End Function + + ''' + ''' Test whether UNDanGooCodGDI1 should be serialized + ''' + Public Overridable Function ShouldSerializeUNDanGooCodGDI1() As Boolean + Return Not String.IsNullOrEmpty(UNDanGooCodGDI1) + End Function + + ''' + ''' Test whether PlaLoaGOOITE333 should be serialized + ''' + Public Overridable Function ShouldSerializePlaLoaGOOITE333() As Boolean + Return Not String.IsNullOrEmpty(PlaLoaGOOITE333) + End Function + + ''' + ''' Test whether PlaLoaGOOITE333LNG should be serialized + ''' + Public Overridable Function ShouldSerializePlaLoaGOOITE333LNG() As Boolean + Return Not String.IsNullOrEmpty(PlaLoaGOOITE333LNG) + End Function + + ''' + ''' Test whether PlaUnlGOOITE333 should be serialized + ''' + Public Overridable Function ShouldSerializePlaUnlGOOITE333() As Boolean + Return Not String.IsNullOrEmpty(PlaUnlGOOITE333) + End Function + + ''' + ''' Test whether PlaUnlGOOITE333LNG should be serialized + ''' + Public Overridable Function ShouldSerializePlaUnlGOOITE333LNG() As Boolean + Return Not String.IsNullOrEmpty(PlaUnlGOOITE333LNG) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize GOOITEGDSType object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -4794,6 +6066,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes GOOITEGDSType object ''' @@ -4841,10 +6117,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -4852,12 +6128,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -4874,11 +6157,11 @@ Namespace ENS_CC315A ''' Output GOOITEGDSType object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, GOOITEGDSType) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -4886,17 +6169,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As GOOITEGDSType + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As GOOITEGDSType Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -5016,23 +6307,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamNOTPAR672 should be serialized + ''' + Public Overridable Function ShouldSerializeNamNOTPAR672() As Boolean + Return Not String.IsNullOrEmpty(NamNOTPAR672) + End Function + + ''' + ''' Test whether StrNumNOTPAR673 should be serialized + ''' + Public Overridable Function ShouldSerializeStrNumNOTPAR673() As Boolean + Return Not String.IsNullOrEmpty(StrNumNOTPAR673) + End Function + + ''' + ''' Test whether PosCodNOTPAR676 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodNOTPAR676() As Boolean + Return Not String.IsNullOrEmpty(PosCodNOTPAR676) + End Function + + ''' + ''' Test whether CitNOTPAR674 should be serialized + ''' + Public Overridable Function ShouldSerializeCitNOTPAR674() As Boolean + Return Not String.IsNullOrEmpty(CitNOTPAR674) + End Function + + ''' + ''' Test whether CouCodNOTPAR675 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCodNOTPAR675() As Boolean + Return Not String.IsNullOrEmpty(CouCodNOTPAR675) + End Function + + ''' + ''' Test whether NOTPAR670LNG should be serialized + ''' + Public Overridable Function ShouldSerializeNOTPAR670LNG() As Boolean + Return Not String.IsNullOrEmpty(NOTPAR670LNG) + End Function + + ''' + ''' Test whether TINNOTPAR671 should be serialized + ''' + Public Overridable Function ShouldSerializeTINNOTPAR671() As Boolean + Return Not String.IsNullOrEmpty(TINNOTPAR671) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize NOTPAR670Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -5044,6 +6387,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes NOTPAR670Type object ''' @@ -5091,10 +6438,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -5102,12 +6449,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -5124,11 +6478,11 @@ Namespace ENS_CC315A ''' Output NOTPAR670Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, NOTPAR670Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -5136,17 +6490,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As NOTPAR670Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As NOTPAR670Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -5266,23 +6628,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamCE17 should be serialized + ''' + Public Overridable Function ShouldSerializeNamCE17() As Boolean + Return Not String.IsNullOrEmpty(NamCE17) + End Function + + ''' + ''' Test whether StrAndNumCE122 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumCE122() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumCE122) + End Function + + ''' + ''' Test whether PosCodCE123 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodCE123() As Boolean + Return Not String.IsNullOrEmpty(PosCodCE123) + End Function + + ''' + ''' Test whether CitCE124 should be serialized + ''' + Public Overridable Function ShouldSerializeCitCE124() As Boolean + Return Not String.IsNullOrEmpty(CitCE124) + End Function + + ''' + ''' Test whether CouCE125 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCE125() As Boolean + Return Not String.IsNullOrEmpty(CouCE125) + End Function + + ''' + ''' Test whether NADLNGCE should be serialized + ''' + Public Overridable Function ShouldSerializeNADLNGCE() As Boolean + Return Not String.IsNullOrEmpty(NADLNGCE) + End Function + + ''' + ''' Test whether TINCE159 should be serialized + ''' + Public Overridable Function ShouldSerializeTINCE159() As Boolean + Return Not String.IsNullOrEmpty(TINCE159) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCE1Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -5294,6 +6708,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRACONCE1Type object ''' @@ -5341,10 +6759,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -5352,12 +6770,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -5374,11 +6799,11 @@ Namespace ENS_CC315A ''' Output TRACONCE1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCE1Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -5386,17 +6811,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE1Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE1Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() @@ -5516,23 +6949,75 @@ Namespace ENS_CC315A End Get End Property + ''' + ''' Test whether NamCO17 should be serialized + ''' + Public Overridable Function ShouldSerializeNamCO17() As Boolean + Return Not String.IsNullOrEmpty(NamCO17) + End Function + + ''' + ''' Test whether StrAndNumCO122 should be serialized + ''' + Public Overridable Function ShouldSerializeStrAndNumCO122() As Boolean + Return Not String.IsNullOrEmpty(StrAndNumCO122) + End Function + + ''' + ''' Test whether PosCodCO123 should be serialized + ''' + Public Overridable Function ShouldSerializePosCodCO123() As Boolean + Return Not String.IsNullOrEmpty(PosCodCO123) + End Function + + ''' + ''' Test whether CitCO124 should be serialized + ''' + Public Overridable Function ShouldSerializeCitCO124() As Boolean + Return Not String.IsNullOrEmpty(CitCO124) + End Function + + ''' + ''' Test whether CouCO125 should be serialized + ''' + Public Overridable Function ShouldSerializeCouCO125() As Boolean + Return Not String.IsNullOrEmpty(CouCO125) + End Function + + ''' + ''' Test whether NADLNGCO should be serialized + ''' + Public Overridable Function ShouldSerializeNADLNGCO() As Boolean + Return Not String.IsNullOrEmpty(NADLNGCO) + End Function + + ''' + ''' Test whether TINCO159 should be serialized + ''' + Public Overridable Function ShouldSerializeTINCO159() As Boolean + Return Not String.IsNullOrEmpty(TINCO159) + End Function + #Region "Serialize/Deserialize" ''' ''' Serialize TRACONCO1Type object ''' ''' XML value - Public Overridable Function Serialize() As String + Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String Dim streamReader As StreamReader = Nothing Dim memoryStream As MemoryStream = Nothing Try memoryStream = New MemoryStream() Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Encoding = encoding xmlWriterSettings.Indent = True xmlWriterSettings.IndentChars = " " + xmlWriterSettings.NewLineOnAttributes = True + xmlWriterSettings.OmitXmlDeclaration = True Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) SerializerXml.Serialize(xmlWriter, Me) memoryStream.Seek(0, SeekOrigin.Begin) - streamReader = New StreamReader(memoryStream) + streamReader = New StreamReader(memoryStream, encoding) Return streamReader.ReadToEnd Finally If (Not (streamReader) Is Nothing) Then @@ -5544,6 +7029,10 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function Serialize() As String + Return Serialize(System.Text.Encoding.UTF8) + End Function + ''' ''' Deserializes TRACONCO1Type object ''' @@ -5591,10 +7080,10 @@ Namespace ENS_CC315A ''' full path of outupt xml file ''' output Exception value if failed ''' true if can serialize and save into file; otherwise, false - Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean exception = Nothing Try - SaveToFile(fileName) + SaveToFile(fileName, encoding) Return True Catch e As System.Exception exception = e @@ -5602,12 +7091,19 @@ Namespace ENS_CC315A End Try End Function + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception) + End Function + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + SaveToFile(fileName, System.Text.Encoding.UTF8) + End Sub + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) Dim streamWriter As StreamWriter = Nothing Try - Dim dataString As String = Serialize() - Dim outputFile As FileInfo = New FileInfo(fileName) - streamWriter = outputFile.CreateText + Dim dataString As String = Serialize(encoding) + streamWriter = New StreamWriter(fileName, False, encoding) streamWriter.WriteLine(dataString) streamWriter.Close() Finally @@ -5624,11 +7120,11 @@ Namespace ENS_CC315A ''' Output TRACONCO1Type object ''' output Exception value if deserialize failed ''' true if this Serializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean exception = Nothing obj = CType(Nothing, TRACONCO1Type) Try - obj = LoadFromFile(fileName) + obj = LoadFromFile(fileName, encoding) Return True Catch ex As System.Exception exception = ex @@ -5636,17 +7132,25 @@ Namespace ENS_CC315A End Try End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean + Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception) + End Function + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type) As Boolean Dim exception As System.Exception = Nothing Return LoadFromFile(fileName, obj, exception) End Function Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO1Type + Return LoadFromFile(fileName, System.Text.Encoding.UTF8) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO1Type Dim file As FileStream = Nothing Dim sr As StreamReader = Nothing Try file = New FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New StreamReader(file) + sr = New StreamReader(file, encoding) Dim dataString As String = sr.ReadToEnd sr.Close() file.Close() diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.Designer.vb new file mode 100644 index 00000000..47ab198f --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.Designer.vb @@ -0,0 +1,2486 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"CC304A_v10_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace CC304A_v10_0 + + + Partial Public Class CC304AType + +#Region "Private fields" + Private _mesSenMES3 As String + + Private _mesRecMES6 As String + + Private _datOfPreMES9 As String + + Private _timOfPreMES10 As String + + Private _priMES15 As String + + Private _tesIndMES18 As Flag + + Private _mesIdeMES19 As String + + Private _mesTypMES20 As MessageTypes + + Private _corIdeMES25 As String + + Private _hEAHEA As HEAHEAType + + Private _gOOITEGDS As List(Of GOOITEGDSType) + + Private _tRAREP As TRAREPType + + Private _pERLODSUMDEC As PERLODSUMDECType + + Private _cUSOFFFENT730 As CUSOFFFENT730Type + + Private _tRACARENT601 As TRACARENT601Type + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._tRACARENT601 = New TRACARENT601Type() + Me._cUSOFFFENT730 = New CUSOFFFENT730Type() + Me._pERLODSUMDEC = New PERLODSUMDECType() + Me._tRAREP = New TRAREPType() + Me._gOOITEGDS = New List(Of GOOITEGDSType)() + Me._hEAHEA = New HEAHEAType() + End Sub + + + Public Property MesSenMES3() As String + Get + Return Me._mesSenMES3 + End Get + Set + Me._mesSenMES3 = Value + End Set + End Property + + + Public Property MesRecMES6() As String + Get + Return Me._mesRecMES6 + End Get + Set + Me._mesRecMES6 = Value + End Set + End Property + + + Public Property DatOfPreMES9() As String + Get + Return Me._datOfPreMES9 + End Get + Set + Me._datOfPreMES9 = Value + End Set + End Property + + + Public Property TimOfPreMES10() As String + Get + Return Me._timOfPreMES10 + End Get + Set + Me._timOfPreMES10 = Value + End Set + End Property + + + Public Property PriMES15() As String + Get + Return Me._priMES15 + End Get + Set + Me._priMES15 = Value + End Set + End Property + + + Public Property TesIndMES18() As Flag + Get + Return Me._tesIndMES18 + End Get + Set + Me._tesIndMES18 = Value + End Set + End Property + + + Public Property MesIdeMES19() As String + Get + Return Me._mesIdeMES19 + End Get + Set + Me._mesIdeMES19 = Value + End Set + End Property + + + Public Property MesTypMES20() As MessageTypes + Get + Return Me._mesTypMES20 + End Get + Set + Me._mesTypMES20 = Value + End Set + End Property + + + Public Property CorIdeMES25() As String + Get + Return Me._corIdeMES25 + End Get + Set + Me._corIdeMES25 = Value + End Set + End Property + + + Public Property HEAHEA() As HEAHEAType + Get + Return Me._hEAHEA + End Get + Set + Me._hEAHEA = Value + End Set + End Property + + + Public Property GOOITEGDS() As List(Of GOOITEGDSType) + Get + Return Me._gOOITEGDS + End Get + Set + Me._gOOITEGDS = Value + End Set + End Property + + + Public Property TRAREP() As TRAREPType + Get + Return Me._tRAREP + End Get + Set + Me._tRAREP = Value + End Set + End Property + + + Public Property PERLODSUMDEC() As PERLODSUMDECType + Get + Return Me._pERLODSUMDEC + End Get + Set + Me._pERLODSUMDEC = Value + End Set + End Property + + + Public Property CUSOFFFENT730() As CUSOFFFENT730Type + Get + Return Me._cUSOFFFENT730 + End Get + Set + Me._cUSOFFFENT730 = Value + End Set + End Property + + + Public Property TRACARENT601() As TRACARENT601Type + Get + Return Me._tRACARENT601 + End Get + Set + Me._tRACARENT601 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC304AType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CC304AType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CC304AType object + ''' + ''' string to deserialize + ''' Output CC304AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC304AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC304AType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC304AType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CC304AType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC304AType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC304AType + Return CType(SerializerXml.Deserialize(s), CC304AType) + End Function +#End Region + + ''' + ''' Serializes current CC304AType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CC304AType object + ''' + ''' File to load and deserialize + ''' Output CC304AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC304AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC304AType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC304AType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC304AType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum Flag + + + Item0 + + + Item1 + End Enum + + + Public Enum MessageTypes + + CC304A + + CC305A + + CC313A + + CC315A + + CC316A + + CC323A + + CC324A + + CC325A + + CC328A + + CC351A + + CD030C + + CD031C + + CD032C + + CD070B + + CD071B + + CD301A + + CD302A + + CD303A + + CD319A + + CD411C + + CD412C + + CD906B + + CD912B + + CD913B + + CD914B + + CD916B + + CD917B + + CD931C + + CD932C + + CD971B + End Enum + + + Partial Public Class HEAHEAType + +#Region "Private fields" + Private _docNumHEA5 As String + + Private _traModAtBorHEA76 As String + + Private _ideOfMeaOfTraCroHEA85 As String + + Private _ideOfMeaOfTraCroHEA85LNG As String + + Private _natOfMeaOfTraCroHEA87 As String + + Private _comRefNumHEA As String + + Private _conRefNumHEA As String + + Private _ameAccDatTimHEA111 As String + + Private _datTimAmeHEA113 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property DocNumHEA5() As String + Get + Return Me._docNumHEA5 + End Get + Set + Me._docNumHEA5 = Value + End Set + End Property + + + Public Property TraModAtBorHEA76() As String + Get + Return Me._traModAtBorHEA76 + End Get + Set + Me._traModAtBorHEA76 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85() As String + Get + Return Me._ideOfMeaOfTraCroHEA85 + End Get + Set + Me._ideOfMeaOfTraCroHEA85 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85LNG() As String + Get + Return Me._ideOfMeaOfTraCroHEA85LNG + End Get + Set + Me._ideOfMeaOfTraCroHEA85LNG = Value + End Set + End Property + + + Public Property NatOfMeaOfTraCroHEA87() As String + Get + Return Me._natOfMeaOfTraCroHEA87 + End Get + Set + Me._natOfMeaOfTraCroHEA87 = Value + End Set + End Property + + + Public Property ComRefNumHEA() As String + Get + Return Me._comRefNumHEA + End Get + Set + Me._comRefNumHEA = Value + End Set + End Property + + + Public Property ConRefNumHEA() As String + Get + Return Me._conRefNumHEA + End Get + Set + Me._conRefNumHEA = Value + End Set + End Property + + + Public Property AmeAccDatTimHEA111() As String + Get + Return Me._ameAccDatTimHEA111 + End Get + Set + Me._ameAccDatTimHEA111 = Value + End Set + End Property + + + Public Property DatTimAmeHEA113() As String + Get + Return Me._datTimAmeHEA113 + End Get + Set + Me._datTimAmeHEA113 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HEAHEAType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes HEAHEAType object + ''' + ''' string to deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType + Return CType(SerializerXml.Deserialize(s), HEAHEAType) + End Function +#End Region + + ''' + ''' Serializes current HEAHEAType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an HEAHEAType object + ''' + ''' File to load and deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACARENT601Type + +#Region "Private fields" + Private _namTRACARENT604 As String + + Private _strNumTRACARENT607 As String + + Private _pstCodTRACARENT606 As String + + Private _ctyTRACARENT603 As String + + Private _couCodTRACARENT605 As String + + Private _tRACARENT601LNG As String + + Private _tINTRACARENT602 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRACARENT604() As String + Get + Return Me._namTRACARENT604 + End Get + Set + Me._namTRACARENT604 = Value + End Set + End Property + + + Public Property StrNumTRACARENT607() As String + Get + Return Me._strNumTRACARENT607 + End Get + Set + Me._strNumTRACARENT607 = Value + End Set + End Property + + + Public Property PstCodTRACARENT606() As String + Get + Return Me._pstCodTRACARENT606 + End Get + Set + Me._pstCodTRACARENT606 = Value + End Set + End Property + + + Public Property CtyTRACARENT603() As String + Get + Return Me._ctyTRACARENT603 + End Get + Set + Me._ctyTRACARENT603 = Value + End Set + End Property + + + Public Property CouCodTRACARENT605() As String + Get + Return Me._couCodTRACARENT605 + End Get + Set + Me._couCodTRACARENT605 = Value + End Set + End Property + + + Public Property TRACARENT601LNG() As String + Get + Return Me._tRACARENT601LNG + End Get + Set + Me._tRACARENT601LNG = Value + End Set + End Property + + + Public Property TINTRACARENT602() As String + Get + Return Me._tINTRACARENT602 + End Get + Set + Me._tINTRACARENT602 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACARENT601Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACARENT601Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACARENT601Type object + ''' + ''' string to deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACARENT601Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACARENT601Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACARENT601Type + Return CType(SerializerXml.Deserialize(s), TRACARENT601Type) + End Function +#End Region + + ''' + ''' Serializes current TRACARENT601Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACARENT601Type object + ''' + ''' File to load and deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACARENT601Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFFENT730Type + +#Region "Private fields" + Private _refNumCUSOFFFENT731 As String + + Private _expDatOfArrFIRENT733 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCUSOFFFENT731() As String + Get + Return Me._refNumCUSOFFFENT731 + End Get + Set + Me._refNumCUSOFFFENT731 = Value + End Set + End Property + + + Public Property ExpDatOfArrFIRENT733() As String + Get + Return Me._expDatOfArrFIRENT733 + End Get + Set + Me._expDatOfArrFIRENT733 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFFENT730Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFFENT730Type object + ''' + ''' string to deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type + Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFFENT730Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFFENT730Type object + ''' + ''' File to load and deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PERLODSUMDECType + +#Region "Private fields" + Private _namPLD1 As String + + Private _strAndNumPLD1 As String + + Private _posCodPLD1 As String + + Private _citPLD1 As String + + Private _couCodPLD1 As String + + Private _pERLODSUMDECLNG As String + + Private _tINPLD1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamPLD1() As String + Get + Return Me._namPLD1 + End Get + Set + Me._namPLD1 = Value + End Set + End Property + + + Public Property StrAndNumPLD1() As String + Get + Return Me._strAndNumPLD1 + End Get + Set + Me._strAndNumPLD1 = Value + End Set + End Property + + + Public Property PosCodPLD1() As String + Get + Return Me._posCodPLD1 + End Get + Set + Me._posCodPLD1 = Value + End Set + End Property + + + Public Property CitPLD1() As String + Get + Return Me._citPLD1 + End Get + Set + Me._citPLD1 = Value + End Set + End Property + + + Public Property CouCodPLD1() As String + Get + Return Me._couCodPLD1 + End Get + Set + Me._couCodPLD1 = Value + End Set + End Property + + + Public Property PERLODSUMDECLNG() As String + Get + Return Me._pERLODSUMDECLNG + End Get + Set + Me._pERLODSUMDECLNG = Value + End Set + End Property + + + Public Property TINPLD1() As String + Get + Return Me._tINPLD1 + End Get + Set + Me._tINPLD1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PERLODSUMDECType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PERLODSUMDECType object + ''' + ''' string to deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType + Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType) + End Function +#End Region + + ''' + ''' Serializes current PERLODSUMDECType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PERLODSUMDECType object + ''' + ''' File to load and deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRAREPType + +#Region "Private fields" + Private _namTRE1 As String + + Private _strAndNumTRE1 As String + + Private _posCodTRE1 As String + + Private _citTRE1 As String + + Private _couCodTRE1 As String + + Private _tRAREPLNG As String + + Private _tINTRE1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRE1() As String + Get + Return Me._namTRE1 + End Get + Set + Me._namTRE1 = Value + End Set + End Property + + + Public Property StrAndNumTRE1() As String + Get + Return Me._strAndNumTRE1 + End Get + Set + Me._strAndNumTRE1 = Value + End Set + End Property + + + Public Property PosCodTRE1() As String + Get + Return Me._posCodTRE1 + End Get + Set + Me._posCodTRE1 = Value + End Set + End Property + + + Public Property CitTRE1() As String + Get + Return Me._citTRE1 + End Get + Set + Me._citTRE1 = Value + End Set + End Property + + + Public Property CouCodTRE1() As String + Get + Return Me._couCodTRE1 + End Get + Set + Me._couCodTRE1 = Value + End Set + End Property + + + Public Property TRAREPLNG() As String + Get + Return Me._tRAREPLNG + End Get + Set + Me._tRAREPLNG = Value + End Set + End Property + + + Public Property TINTRE1() As String + Get + Return Me._tINTRE1 + End Get + Set + Me._tINTRE1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRAREPType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRAREPType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRAREPType object + ''' + ''' string to deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRAREPType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRAREPType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRAREPType + Return CType(SerializerXml.Deserialize(s), TRAREPType) + End Function +#End Region + + ''' + ''' Serializes current TRAREPType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRAREPType object + ''' + ''' File to load and deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRAREPType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class IDEMEATRAGI970Type + +#Region "Private fields" + Private _natIDEMEATRAGI973 As String + + Private _ideMeaTraGIMEATRA971 As String + + Private _ideMeaTraGIMEATRA972LNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NatIDEMEATRAGI973() As String + Get + Return Me._natIDEMEATRAGI973 + End Get + Set + Me._natIDEMEATRAGI973 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA971() As String + Get + Return Me._ideMeaTraGIMEATRA971 + End Get + Set + Me._ideMeaTraGIMEATRA971 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA972LNG() As String + Get + Return Me._ideMeaTraGIMEATRA972LNG + End Get + Set + Me._ideMeaTraGIMEATRA972LNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDEMEATRAGI970Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IDEMEATRAGI970Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes IDEMEATRAGI970Type object + ''' + ''' string to deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As IDEMEATRAGI970Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDEMEATRAGI970Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As IDEMEATRAGI970Type + Return CType(SerializerXml.Deserialize(s), IDEMEATRAGI970Type) + End Function +#End Region + + ''' + ''' Serializes current IDEMEATRAGI970Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an IDEMEATRAGI970Type object + ''' + ''' File to load and deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IDEMEATRAGI970Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CONNR2Type + +#Region "Private fields" + Private _conNumNR21 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ConNumNR21() As String + Get + Return Me._conNumNR21 + End Get + Set + Me._conNumNR21 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CONNR2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CONNR2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CONNR2Type object + ''' + ''' string to deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CONNR2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CONNR2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CONNR2Type + Return CType(SerializerXml.Deserialize(s), CONNR2Type) + End Function +#End Region + + ''' + ''' Serializes current CONNR2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CONNR2Type object + ''' + ''' File to load and deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CONNR2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PRODOCDC2Type + +#Region "Private fields" + Private _docTypDC21 As String + + Private _docRefDC23 As String + + Private _docRefDCLNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property DocTypDC21() As String + Get + Return Me._docTypDC21 + End Get + Set + Me._docTypDC21 = Value + End Set + End Property + + + Public Property DocRefDC23() As String + Get + Return Me._docRefDC23 + End Get + Set + Me._docRefDC23 = Value + End Set + End Property + + + Public Property DocRefDCLNG() As String + Get + Return Me._docRefDCLNG + End Get + Set + Me._docRefDCLNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRODOCDC2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PRODOCDC2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PRODOCDC2Type object + ''' + ''' string to deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PRODOCDC2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRODOCDC2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRODOCDC2Type + Return CType(SerializerXml.Deserialize(s), PRODOCDC2Type) + End Function +#End Region + + ''' + ''' Serializes current PRODOCDC2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PRODOCDC2Type object + ''' + ''' File to load and deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRODOCDC2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class GOOITEGDSType + +#Region "Private fields" + Private _iteNumGDS7 As String + + Private _comRefNumGIM1 As String + + Private _pRODOCDC2 As List(Of PRODOCDC2Type) + + Private _cONNR2 As List(Of CONNR2Type) + + Private _iDEMEATRAGI970 As List(Of IDEMEATRAGI970Type) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._iDEMEATRAGI970 = New List(Of IDEMEATRAGI970Type)() + Me._cONNR2 = New List(Of CONNR2Type)() + Me._pRODOCDC2 = New List(Of PRODOCDC2Type)() + End Sub + + + Public Property IteNumGDS7() As String + Get + Return Me._iteNumGDS7 + End Get + Set + Me._iteNumGDS7 = Value + End Set + End Property + + + Public Property ComRefNumGIM1() As String + Get + Return Me._comRefNumGIM1 + End Get + Set + Me._comRefNumGIM1 = Value + End Set + End Property + + + Public Property PRODOCDC2() As List(Of PRODOCDC2Type) + Get + Return Me._pRODOCDC2 + End Get + Set + Me._pRODOCDC2 = Value + End Set + End Property + + + Public Property CONNR2() As List(Of CONNR2Type) + Get + Return Me._cONNR2 + End Get + Set + Me._cONNR2 = Value + End Set + End Property + + + Public Property IDEMEATRAGI970() As List(Of IDEMEATRAGI970Type) + Get + Return Me._iDEMEATRAGI970 + End Get + Set + Me._iDEMEATRAGI970 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GOOITEGDSType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize GOOITEGDSType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes GOOITEGDSType object + ''' + ''' string to deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As GOOITEGDSType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GOOITEGDSType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As GOOITEGDSType + Return CType(SerializerXml.Deserialize(s), GOOITEGDSType) + End Function +#End Region + + ''' + ''' Serializes current GOOITEGDSType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an GOOITEGDSType object + ''' + ''' File to load and deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As GOOITEGDSType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.xsd new file mode 100644 index 00000000..c5144fe9 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC304A-v10-0.xsd @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.Designer.vb new file mode 100644 index 00000000..78620446 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.Designer.vb @@ -0,0 +1,1625 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"CC305A_v10_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace CC305A_v10_0 + + + Partial Public Class CC305AType + +#Region "Private fields" + Private _mesSenMES3 As String + + Private _mesRecMES6 As String + + Private _datOfPreMES9 As String + + Private _timOfPreMES10 As String + + Private _priMES15 As String + + Private _tesIndMES18 As Flag + + Private _mesIdeMES19 As String + + Private _mesTypMES20 As MessageTypes + + Private _corIdeMES25 As String + + Private _hEAHEA As HEAHEAType + + Private _fUNERRER1 As List(Of FUNERRER1Type) + + Private _tRAREP As TRAREPType + + Private _pERLODSUMDEC As PERLODSUMDECType + + Private _cUSOFFFENT730 As CUSOFFFENT730Type + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._cUSOFFFENT730 = New CUSOFFFENT730Type() + Me._pERLODSUMDEC = New PERLODSUMDECType() + Me._tRAREP = New TRAREPType() + Me._fUNERRER1 = New List(Of FUNERRER1Type)() + Me._hEAHEA = New HEAHEAType() + End Sub + + + Public Property MesSenMES3() As String + Get + Return Me._mesSenMES3 + End Get + Set + Me._mesSenMES3 = Value + End Set + End Property + + + Public Property MesRecMES6() As String + Get + Return Me._mesRecMES6 + End Get + Set + Me._mesRecMES6 = Value + End Set + End Property + + + Public Property DatOfPreMES9() As String + Get + Return Me._datOfPreMES9 + End Get + Set + Me._datOfPreMES9 = Value + End Set + End Property + + + Public Property TimOfPreMES10() As String + Get + Return Me._timOfPreMES10 + End Get + Set + Me._timOfPreMES10 = Value + End Set + End Property + + + Public Property PriMES15() As String + Get + Return Me._priMES15 + End Get + Set + Me._priMES15 = Value + End Set + End Property + + + Public Property TesIndMES18() As Flag + Get + Return Me._tesIndMES18 + End Get + Set + Me._tesIndMES18 = Value + End Set + End Property + + + Public Property MesIdeMES19() As String + Get + Return Me._mesIdeMES19 + End Get + Set + Me._mesIdeMES19 = Value + End Set + End Property + + + Public Property MesTypMES20() As MessageTypes + Get + Return Me._mesTypMES20 + End Get + Set + Me._mesTypMES20 = Value + End Set + End Property + + + Public Property CorIdeMES25() As String + Get + Return Me._corIdeMES25 + End Get + Set + Me._corIdeMES25 = Value + End Set + End Property + + + Public Property HEAHEA() As HEAHEAType + Get + Return Me._hEAHEA + End Get + Set + Me._hEAHEA = Value + End Set + End Property + + + Public Property FUNERRER1() As List(Of FUNERRER1Type) + Get + Return Me._fUNERRER1 + End Get + Set + Me._fUNERRER1 = Value + End Set + End Property + + + Public Property TRAREP() As TRAREPType + Get + Return Me._tRAREP + End Get + Set + Me._tRAREP = Value + End Set + End Property + + + Public Property PERLODSUMDEC() As PERLODSUMDECType + Get + Return Me._pERLODSUMDEC + End Get + Set + Me._pERLODSUMDEC = Value + End Set + End Property + + + Public Property CUSOFFFENT730() As CUSOFFFENT730Type + Get + Return Me._cUSOFFFENT730 + End Get + Set + Me._cUSOFFFENT730 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC305AType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CC305AType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CC305AType object + ''' + ''' string to deserialize + ''' Output CC305AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC305AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC305AType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC305AType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CC305AType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC305AType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC305AType + Return CType(SerializerXml.Deserialize(s), CC305AType) + End Function +#End Region + + ''' + ''' Serializes current CC305AType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CC305AType object + ''' + ''' File to load and deserialize + ''' Output CC305AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC305AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC305AType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC305AType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC305AType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum Flag + + + Item0 + + + Item1 + End Enum + + + Public Enum MessageTypes + + CC304A + + CC305A + + CC313A + + CC315A + + CC316A + + CC323A + + CC324A + + CC325A + + CC328A + + CC351A + + CD030C + + CD031C + + CD032C + + CD070B + + CD071B + + CD301A + + CD302A + + CD303A + + CD319A + + CD411C + + CD412C + + CD906B + + CD912B + + CD913B + + CD914B + + CD916B + + CD917B + + CD931C + + CD932C + + CD971B + End Enum + + + Partial Public Class HEAHEAType + +#Region "Private fields" + Private _docNumHEA5 As String + + Private _ameRejMotCodHEA604 As String + + Private _ameRejMotTexHEA605 As String + + Private _ameRejMotTexHEA605LNG As String + + Private _datTimAmeHEA113 As String + + Private _ameRejDatTimHEA112 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property DocNumHEA5() As String + Get + Return Me._docNumHEA5 + End Get + Set + Me._docNumHEA5 = Value + End Set + End Property + + + Public Property AmeRejMotCodHEA604() As String + Get + Return Me._ameRejMotCodHEA604 + End Get + Set + Me._ameRejMotCodHEA604 = Value + End Set + End Property + + + Public Property AmeRejMotTexHEA605() As String + Get + Return Me._ameRejMotTexHEA605 + End Get + Set + Me._ameRejMotTexHEA605 = Value + End Set + End Property + + + Public Property AmeRejMotTexHEA605LNG() As String + Get + Return Me._ameRejMotTexHEA605LNG + End Get + Set + Me._ameRejMotTexHEA605LNG = Value + End Set + End Property + + + Public Property DatTimAmeHEA113() As String + Get + Return Me._datTimAmeHEA113 + End Get + Set + Me._datTimAmeHEA113 = Value + End Set + End Property + + + Public Property AmeRejDatTimHEA112() As String + Get + Return Me._ameRejDatTimHEA112 + End Get + Set + Me._ameRejDatTimHEA112 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HEAHEAType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes HEAHEAType object + ''' + ''' string to deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType + Return CType(SerializerXml.Deserialize(s), HEAHEAType) + End Function +#End Region + + ''' + ''' Serializes current HEAHEAType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an HEAHEAType object + ''' + ''' File to load and deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFFENT730Type + +#Region "Private fields" + Private _refNumCUSOFFFENT731 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCUSOFFFENT731() As String + Get + Return Me._refNumCUSOFFFENT731 + End Get + Set + Me._refNumCUSOFFFENT731 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFFENT730Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFFENT730Type object + ''' + ''' string to deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type + Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFFENT730Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFFENT730Type object + ''' + ''' File to load and deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PERLODSUMDECType + +#Region "Private fields" + Private _namPLD1 As String + + Private _strAndNumPLD1 As String + + Private _posCodPLD1 As String + + Private _citPLD1 As String + + Private _couCodPLD1 As String + + Private _pERLODSUMDECLNG As String + + Private _tINPLD1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamPLD1() As String + Get + Return Me._namPLD1 + End Get + Set + Me._namPLD1 = Value + End Set + End Property + + + Public Property StrAndNumPLD1() As String + Get + Return Me._strAndNumPLD1 + End Get + Set + Me._strAndNumPLD1 = Value + End Set + End Property + + + Public Property PosCodPLD1() As String + Get + Return Me._posCodPLD1 + End Get + Set + Me._posCodPLD1 = Value + End Set + End Property + + + Public Property CitPLD1() As String + Get + Return Me._citPLD1 + End Get + Set + Me._citPLD1 = Value + End Set + End Property + + + Public Property CouCodPLD1() As String + Get + Return Me._couCodPLD1 + End Get + Set + Me._couCodPLD1 = Value + End Set + End Property + + + Public Property PERLODSUMDECLNG() As String + Get + Return Me._pERLODSUMDECLNG + End Get + Set + Me._pERLODSUMDECLNG = Value + End Set + End Property + + + Public Property TINPLD1() As String + Get + Return Me._tINPLD1 + End Get + Set + Me._tINPLD1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PERLODSUMDECType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PERLODSUMDECType object + ''' + ''' string to deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType + Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType) + End Function +#End Region + + ''' + ''' Serializes current PERLODSUMDECType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PERLODSUMDECType object + ''' + ''' File to load and deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRAREPType + +#Region "Private fields" + Private _namTRE1 As String + + Private _strAndNumTRE1 As String + + Private _posCodTRE1 As String + + Private _citTRE1 As String + + Private _couCodTRE1 As String + + Private _tRAREPLNG As String + + Private _tINTRE1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRE1() As String + Get + Return Me._namTRE1 + End Get + Set + Me._namTRE1 = Value + End Set + End Property + + + Public Property StrAndNumTRE1() As String + Get + Return Me._strAndNumTRE1 + End Get + Set + Me._strAndNumTRE1 = Value + End Set + End Property + + + Public Property PosCodTRE1() As String + Get + Return Me._posCodTRE1 + End Get + Set + Me._posCodTRE1 = Value + End Set + End Property + + + Public Property CitTRE1() As String + Get + Return Me._citTRE1 + End Get + Set + Me._citTRE1 = Value + End Set + End Property + + + Public Property CouCodTRE1() As String + Get + Return Me._couCodTRE1 + End Get + Set + Me._couCodTRE1 = Value + End Set + End Property + + + Public Property TRAREPLNG() As String + Get + Return Me._tRAREPLNG + End Get + Set + Me._tRAREPLNG = Value + End Set + End Property + + + Public Property TINTRE1() As String + Get + Return Me._tINTRE1 + End Get + Set + Me._tINTRE1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRAREPType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRAREPType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRAREPType object + ''' + ''' string to deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRAREPType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRAREPType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRAREPType + Return CType(SerializerXml.Deserialize(s), TRAREPType) + End Function +#End Region + + ''' + ''' Serializes current TRAREPType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRAREPType object + ''' + ''' File to load and deserialize + ''' Output TRAREPType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRAREPType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRAREPType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class FUNERRER1Type + +#Region "Private fields" + Private _errTypER11 As FunctionalErrorCodes + + Private _errPoiER12 As String + + Private _errReaER13 As String + + Private _oriAttValER14 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ErrTypER11() As FunctionalErrorCodes + Get + Return Me._errTypER11 + End Get + Set + Me._errTypER11 = Value + End Set + End Property + + + Public Property ErrPoiER12() As String + Get + Return Me._errPoiER12 + End Get + Set + Me._errPoiER12 = Value + End Set + End Property + + + Public Property ErrReaER13() As String + Get + Return Me._errReaER13 + End Get + Set + Me._errReaER13 = Value + End Set + End Property + + + Public Property OriAttValER14() As String + Get + Return Me._oriAttValER14 + End Get + Set + Me._oriAttValER14 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FUNERRER1Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize FUNERRER1Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes FUNERRER1Type object + ''' + ''' string to deserialize + ''' Output FUNERRER1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As FUNERRER1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, FUNERRER1Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As FUNERRER1Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As FUNERRER1Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), FUNERRER1Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As FUNERRER1Type + Return CType(SerializerXml.Deserialize(s), FUNERRER1Type) + End Function +#End Region + + ''' + ''' Serializes current FUNERRER1Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an FUNERRER1Type object + ''' + ''' File to load and deserialize + ''' Output FUNERRER1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FUNERRER1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, FUNERRER1Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FUNERRER1Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As FUNERRER1Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum FunctionalErrorCodes + + + Item12 + + + Item13 + + + Item14 + + + Item15 + + + Item19 + + + Item26 + + + Item35 + + + Item37 + + + Item38 + + + Item39 + + + Item40 + + + Item90 + + + Item91 + + + Item92 + + + Item93 + End Enum +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.xsd new file mode 100644 index 00000000..2411c188 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC305A-v10-0.xsd @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.Designer.vb new file mode 100644 index 00000000..75405886 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.Designer.vb @@ -0,0 +1,884 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"CC316A_v10_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace CC316A_v10_0 + + + Partial Public Class CC316AType + +#Region "Private fields" + Private _mesSenMES3 As String + + Private _mesRecMES6 As String + + Private _datOfPreMES9 As String + + Private _timOfPreMES10 As String + + Private _priMES15 As String + + Private _tesIndMES18 As Flag + + Private _mesIdeMES19 As String + + Private _mesTypMES20 As MessageTypes + + Private _corIdeMES25 As String + + Private _hEAHEA As HEAHEAType + + Private _fUNERRER1 As List(Of FUNERRER1Type) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._fUNERRER1 = New List(Of FUNERRER1Type)() + Me._hEAHEA = New HEAHEAType() + End Sub + + + Public Property MesSenMES3() As String + Get + Return Me._mesSenMES3 + End Get + Set + Me._mesSenMES3 = Value + End Set + End Property + + + Public Property MesRecMES6() As String + Get + Return Me._mesRecMES6 + End Get + Set + Me._mesRecMES6 = Value + End Set + End Property + + + Public Property DatOfPreMES9() As String + Get + Return Me._datOfPreMES9 + End Get + Set + Me._datOfPreMES9 = Value + End Set + End Property + + + Public Property TimOfPreMES10() As String + Get + Return Me._timOfPreMES10 + End Get + Set + Me._timOfPreMES10 = Value + End Set + End Property + + + Public Property PriMES15() As String + Get + Return Me._priMES15 + End Get + Set + Me._priMES15 = Value + End Set + End Property + + + Public Property TesIndMES18() As Flag + Get + Return Me._tesIndMES18 + End Get + Set + Me._tesIndMES18 = Value + End Set + End Property + + + Public Property MesIdeMES19() As String + Get + Return Me._mesIdeMES19 + End Get + Set + Me._mesIdeMES19 = Value + End Set + End Property + + + Public Property MesTypMES20() As MessageTypes + Get + Return Me._mesTypMES20 + End Get + Set + Me._mesTypMES20 = Value + End Set + End Property + + + Public Property CorIdeMES25() As String + Get + Return Me._corIdeMES25 + End Get + Set + Me._corIdeMES25 = Value + End Set + End Property + + + Public Property HEAHEA() As HEAHEAType + Get + Return Me._hEAHEA + End Get + Set + Me._hEAHEA = Value + End Set + End Property + + + Public Property FUNERRER1() As List(Of FUNERRER1Type) + Get + Return Me._fUNERRER1 + End Get + Set + Me._fUNERRER1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC316AType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CC316AType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CC316AType object + ''' + ''' string to deserialize + ''' Output CC316AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC316AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC316AType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC316AType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CC316AType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC316AType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC316AType + Return CType(SerializerXml.Deserialize(s), CC316AType) + End Function +#End Region + + ''' + ''' Serializes current CC316AType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CC316AType object + ''' + ''' File to load and deserialize + ''' Output CC316AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC316AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC316AType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC316AType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC316AType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum Flag + + + Item0 + + + Item1 + End Enum + + + Public Enum MessageTypes + + CC304A + + CC305A + + CC313A + + CC315A + + CC316A + + CC323A + + CC324A + + CC325A + + CC328A + + CC351A + + CD030C + + CD031C + + CD032C + + CD070B + + CD071B + + CD301A + + CD302A + + CD303A + + CD319A + + CD411C + + CD412C + + CD906B + + CD912B + + CD913B + + CD914B + + CD916B + + CD917B + + CD931C + + CD932C + + CD971B + End Enum + + + Partial Public Class HEAHEAType + +#Region "Private fields" + Private _refNumHEA4 As String + + Private _decRejReaHEA252 As String + + Private _decRejReaHEA252LNG As String + + Private _decRejDatTimHEA116 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumHEA4() As String + Get + Return Me._refNumHEA4 + End Get + Set + Me._refNumHEA4 = Value + End Set + End Property + + + Public Property DecRejReaHEA252() As String + Get + Return Me._decRejReaHEA252 + End Get + Set + Me._decRejReaHEA252 = Value + End Set + End Property + + + Public Property DecRejReaHEA252LNG() As String + Get + Return Me._decRejReaHEA252LNG + End Get + Set + Me._decRejReaHEA252LNG = Value + End Set + End Property + + + Public Property DecRejDatTimHEA116() As String + Get + Return Me._decRejDatTimHEA116 + End Get + Set + Me._decRejDatTimHEA116 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HEAHEAType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes HEAHEAType object + ''' + ''' string to deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType + Return CType(SerializerXml.Deserialize(s), HEAHEAType) + End Function +#End Region + + ''' + ''' Serializes current HEAHEAType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an HEAHEAType object + ''' + ''' File to load and deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class FUNERRER1Type + +#Region "Private fields" + Private _errTypER11 As FunctionalErrorCodes + + Private _errPoiER12 As String + + Private _errReaER13 As String + + Private _oriAttValER14 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ErrTypER11() As FunctionalErrorCodes + Get + Return Me._errTypER11 + End Get + Set + Me._errTypER11 = Value + End Set + End Property + + + Public Property ErrPoiER12() As String + Get + Return Me._errPoiER12 + End Get + Set + Me._errPoiER12 = Value + End Set + End Property + + + Public Property ErrReaER13() As String + Get + Return Me._errReaER13 + End Get + Set + Me._errReaER13 = Value + End Set + End Property + + + Public Property OriAttValER14() As String + Get + Return Me._oriAttValER14 + End Get + Set + Me._oriAttValER14 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(FUNERRER1Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize FUNERRER1Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes FUNERRER1Type object + ''' + ''' string to deserialize + ''' Output FUNERRER1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As FUNERRER1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, FUNERRER1Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As FUNERRER1Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As FUNERRER1Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), FUNERRER1Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As FUNERRER1Type + Return CType(SerializerXml.Deserialize(s), FUNERRER1Type) + End Function +#End Region + + ''' + ''' Serializes current FUNERRER1Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an FUNERRER1Type object + ''' + ''' File to load and deserialize + ''' Output FUNERRER1Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FUNERRER1Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, FUNERRER1Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As FUNERRER1Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As FUNERRER1Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum FunctionalErrorCodes + + + Item12 + + + Item13 + + + Item14 + + + Item15 + + + Item19 + + + Item26 + + + Item35 + + + Item37 + + + Item38 + + + Item39 + + + Item40 + + + Item90 + + + Item91 + + + Item92 + + + Item93 + End Enum +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.xsd new file mode 100644 index 00000000..6c8de49b --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC316A-v10-0.xsd @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.Designer.vb new file mode 100644 index 00000000..a15e638c --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.Designer.vb @@ -0,0 +1,2414 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"CC328A_v10_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace CC328A_v10_0 + + + Partial Public Class CC328AType + +#Region "Private fields" + Private _mesSenMES3 As String + + Private _mesRecMES6 As String + + Private _datOfPreMES9 As String + + Private _timOfPreMES10 As String + + Private _priMES15 As String + + Private _tesIndMES18 As Flag + + Private _mesIdeMES19 As String + + Private _mesTypMES20 As MessageTypes + + Private _corIdeMES25 As String + + Private _hEAHEA As HEAHEAType + + Private _gOOITEGDS As List(Of GOOITEGDSType) + + Private _cUSOFFLON As CUSOFFLONType + + Private _pERLODSUMDEC As PERLODSUMDECType + + Private _cUSOFFFENT730 As CUSOFFFENT730Type + + Private _tRACARENT601 As TRACARENT601Type + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._tRACARENT601 = New TRACARENT601Type() + Me._cUSOFFFENT730 = New CUSOFFFENT730Type() + Me._pERLODSUMDEC = New PERLODSUMDECType() + Me._cUSOFFLON = New CUSOFFLONType() + Me._gOOITEGDS = New List(Of GOOITEGDSType)() + Me._hEAHEA = New HEAHEAType() + End Sub + + + Public Property MesSenMES3() As String + Get + Return Me._mesSenMES3 + End Get + Set + Me._mesSenMES3 = Value + End Set + End Property + + + Public Property MesRecMES6() As String + Get + Return Me._mesRecMES6 + End Get + Set + Me._mesRecMES6 = Value + End Set + End Property + + + Public Property DatOfPreMES9() As String + Get + Return Me._datOfPreMES9 + End Get + Set + Me._datOfPreMES9 = Value + End Set + End Property + + + Public Property TimOfPreMES10() As String + Get + Return Me._timOfPreMES10 + End Get + Set + Me._timOfPreMES10 = Value + End Set + End Property + + + Public Property PriMES15() As String + Get + Return Me._priMES15 + End Get + Set + Me._priMES15 = Value + End Set + End Property + + + Public Property TesIndMES18() As Flag + Get + Return Me._tesIndMES18 + End Get + Set + Me._tesIndMES18 = Value + End Set + End Property + + + Public Property MesIdeMES19() As String + Get + Return Me._mesIdeMES19 + End Get + Set + Me._mesIdeMES19 = Value + End Set + End Property + + + Public Property MesTypMES20() As MessageTypes + Get + Return Me._mesTypMES20 + End Get + Set + Me._mesTypMES20 = Value + End Set + End Property + + + Public Property CorIdeMES25() As String + Get + Return Me._corIdeMES25 + End Get + Set + Me._corIdeMES25 = Value + End Set + End Property + + + Public Property HEAHEA() As HEAHEAType + Get + Return Me._hEAHEA + End Get + Set + Me._hEAHEA = Value + End Set + End Property + + + Public Property GOOITEGDS() As List(Of GOOITEGDSType) + Get + Return Me._gOOITEGDS + End Get + Set + Me._gOOITEGDS = Value + End Set + End Property + + + Public Property CUSOFFLON() As CUSOFFLONType + Get + Return Me._cUSOFFLON + End Get + Set + Me._cUSOFFLON = Value + End Set + End Property + + + Public Property PERLODSUMDEC() As PERLODSUMDECType + Get + Return Me._pERLODSUMDEC + End Get + Set + Me._pERLODSUMDEC = Value + End Set + End Property + + + Public Property CUSOFFFENT730() As CUSOFFFENT730Type + Get + Return Me._cUSOFFFENT730 + End Get + Set + Me._cUSOFFFENT730 = Value + End Set + End Property + + + Public Property TRACARENT601() As TRACARENT601Type + Get + Return Me._tRACARENT601 + End Get + Set + Me._tRACARENT601 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC328AType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CC328AType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CC328AType object + ''' + ''' string to deserialize + ''' Output CC328AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC328AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC328AType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC328AType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CC328AType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC328AType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC328AType + Return CType(SerializerXml.Deserialize(s), CC328AType) + End Function +#End Region + + ''' + ''' Serializes current CC328AType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CC328AType object + ''' + ''' File to load and deserialize + ''' Output CC328AType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC328AType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CC328AType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC328AType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC328AType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Public Enum Flag + + + Item0 + + + Item1 + End Enum + + + Public Enum MessageTypes + + CC304A + + CC305A + + CC313A + + CC315A + + CC316A + + CC323A + + CC324A + + CC325A + + CC328A + + CC351A + + CD030C + + CD031C + + CD032C + + CD070B + + CD071B + + CD301A + + CD302A + + CD303A + + CD319A + + CD411C + + CD412C + + CD906B + + CD912B + + CD913B + + CD914B + + CD916B + + CD917B + + CD931C + + CD932C + + CD971B + End Enum + + + Partial Public Class HEAHEAType + +#Region "Private fields" + Private _refNumHEA4 As String + + Private _docNumHEA5 As String + + Private _traModAtBorHEA76 As String + + Private _natHEA001 As String + + Private _ideOfMeaOfTraCroHEA85 As String + + Private _ideOfMeaOfTraCroHEA85LNG As String + + Private _comRefNumHEA As String + + Private _conRefNumHEA As String + + Private _decRegDatTimHEA115 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumHEA4() As String + Get + Return Me._refNumHEA4 + End Get + Set + Me._refNumHEA4 = Value + End Set + End Property + + + Public Property DocNumHEA5() As String + Get + Return Me._docNumHEA5 + End Get + Set + Me._docNumHEA5 = Value + End Set + End Property + + + Public Property TraModAtBorHEA76() As String + Get + Return Me._traModAtBorHEA76 + End Get + Set + Me._traModAtBorHEA76 = Value + End Set + End Property + + + Public Property NatHEA001() As String + Get + Return Me._natHEA001 + End Get + Set + Me._natHEA001 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85() As String + Get + Return Me._ideOfMeaOfTraCroHEA85 + End Get + Set + Me._ideOfMeaOfTraCroHEA85 = Value + End Set + End Property + + + Public Property IdeOfMeaOfTraCroHEA85LNG() As String + Get + Return Me._ideOfMeaOfTraCroHEA85LNG + End Get + Set + Me._ideOfMeaOfTraCroHEA85LNG = Value + End Set + End Property + + + Public Property ComRefNumHEA() As String + Get + Return Me._comRefNumHEA + End Get + Set + Me._comRefNumHEA = Value + End Set + End Property + + + Public Property ConRefNumHEA() As String + Get + Return Me._conRefNumHEA + End Get + Set + Me._conRefNumHEA = Value + End Set + End Property + + + Public Property DecRegDatTimHEA115() As String + Get + Return Me._decRegDatTimHEA115 + End Get + Set + Me._decRegDatTimHEA115 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HEAHEAType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes HEAHEAType object + ''' + ''' string to deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType + Return CType(SerializerXml.Deserialize(s), HEAHEAType) + End Function +#End Region + + ''' + ''' Serializes current HEAHEAType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an HEAHEAType object + ''' + ''' File to load and deserialize + ''' Output HEAHEAType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HEAHEAType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class TRACARENT601Type + +#Region "Private fields" + Private _namTRACARENT604 As String + + Private _strNumTRACARENT607 As String + + Private _pstCodTRACARENT606 As String + + Private _ctyTRACARENT603 As String + + Private _couCodTRACARENT605 As String + + Private _tRACARENT601LNG As String + + Private _tINTRACARENT602 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamTRACARENT604() As String + Get + Return Me._namTRACARENT604 + End Get + Set + Me._namTRACARENT604 = Value + End Set + End Property + + + Public Property StrNumTRACARENT607() As String + Get + Return Me._strNumTRACARENT607 + End Get + Set + Me._strNumTRACARENT607 = Value + End Set + End Property + + + Public Property PstCodTRACARENT606() As String + Get + Return Me._pstCodTRACARENT606 + End Get + Set + Me._pstCodTRACARENT606 = Value + End Set + End Property + + + Public Property CtyTRACARENT603() As String + Get + Return Me._ctyTRACARENT603 + End Get + Set + Me._ctyTRACARENT603 = Value + End Set + End Property + + + Public Property CouCodTRACARENT605() As String + Get + Return Me._couCodTRACARENT605 + End Get + Set + Me._couCodTRACARENT605 = Value + End Set + End Property + + + Public Property TRACARENT601LNG() As String + Get + Return Me._tRACARENT601LNG + End Get + Set + Me._tRACARENT601LNG = Value + End Set + End Property + + + Public Property TINTRACARENT602() As String + Get + Return Me._tINTRACARENT602 + End Get + Set + Me._tINTRACARENT602 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACARENT601Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TRACARENT601Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes TRACARENT601Type object + ''' + ''' string to deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As TRACARENT601Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACARENT601Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACARENT601Type + Return CType(SerializerXml.Deserialize(s), TRACARENT601Type) + End Function +#End Region + + ''' + ''' Serializes current TRACARENT601Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an TRACARENT601Type object + ''' + ''' File to load and deserialize + ''' Output TRACARENT601Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TRACARENT601Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACARENT601Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFFENT730Type + +#Region "Private fields" + Private _refNumCUSOFFFENT731 As String + + Private _expDatOfArrFIRENT733 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCUSOFFFENT731() As String + Get + Return Me._refNumCUSOFFFENT731 + End Get + Set + Me._refNumCUSOFFFENT731 = Value + End Set + End Property + + + Public Property ExpDatOfArrFIRENT733() As String + Get + Return Me._expDatOfArrFIRENT733 + End Get + Set + Me._expDatOfArrFIRENT733 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFFENT730Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFFENT730Type object + ''' + ''' string to deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type + Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFFENT730Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFFENT730Type object + ''' + ''' File to load and deserialize + ''' Output CUSOFFFENT730Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFFENT730Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PERLODSUMDECType + +#Region "Private fields" + Private _namPLD1 As String + + Private _strAndNumPLD1 As String + + Private _posCodPLD1 As String + + Private _citPLD1 As String + + Private _couCodPLD1 As String + + Private _pERLODSUMDECLNG As String + + Private _tINPLD1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NamPLD1() As String + Get + Return Me._namPLD1 + End Get + Set + Me._namPLD1 = Value + End Set + End Property + + + Public Property StrAndNumPLD1() As String + Get + Return Me._strAndNumPLD1 + End Get + Set + Me._strAndNumPLD1 = Value + End Set + End Property + + + Public Property PosCodPLD1() As String + Get + Return Me._posCodPLD1 + End Get + Set + Me._posCodPLD1 = Value + End Set + End Property + + + Public Property CitPLD1() As String + Get + Return Me._citPLD1 + End Get + Set + Me._citPLD1 = Value + End Set + End Property + + + Public Property CouCodPLD1() As String + Get + Return Me._couCodPLD1 + End Get + Set + Me._couCodPLD1 = Value + End Set + End Property + + + Public Property PERLODSUMDECLNG() As String + Get + Return Me._pERLODSUMDECLNG + End Get + Set + Me._pERLODSUMDECLNG = Value + End Set + End Property + + + Public Property TINPLD1() As String + Get + Return Me._tINPLD1 + End Get + Set + Me._tINPLD1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PERLODSUMDECType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PERLODSUMDECType object + ''' + ''' string to deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType + Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType) + End Function +#End Region + + ''' + ''' Serializes current PERLODSUMDECType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PERLODSUMDECType object + ''' + ''' File to load and deserialize + ''' Output PERLODSUMDECType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PERLODSUMDECType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CUSOFFLONType + +#Region "Private fields" + Private _refNumCOL1 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property RefNumCOL1() As String + Get + Return Me._refNumCOL1 + End Get + Set + Me._refNumCOL1 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFLONType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CUSOFFLONType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CUSOFFLONType object + ''' + ''' string to deserialize + ''' Output CUSOFFLONType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFLONType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFLONType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFLONType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFLONType + Return CType(SerializerXml.Deserialize(s), CUSOFFLONType) + End Function +#End Region + + ''' + ''' Serializes current CUSOFFLONType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CUSOFFLONType object + ''' + ''' File to load and deserialize + ''' Output CUSOFFLONType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CUSOFFLONType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFLONType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class IDEMEATRAGI970Type + +#Region "Private fields" + Private _natIDEMEATRAGI973 As String + + Private _ideMeaTraGIMEATRA971 As String + + Private _ideMeaTraGIMEATRA972LNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property NatIDEMEATRAGI973() As String + Get + Return Me._natIDEMEATRAGI973 + End Get + Set + Me._natIDEMEATRAGI973 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA971() As String + Get + Return Me._ideMeaTraGIMEATRA971 + End Get + Set + Me._ideMeaTraGIMEATRA971 = Value + End Set + End Property + + + Public Property IdeMeaTraGIMEATRA972LNG() As String + Get + Return Me._ideMeaTraGIMEATRA972LNG + End Get + Set + Me._ideMeaTraGIMEATRA972LNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDEMEATRAGI970Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IDEMEATRAGI970Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes IDEMEATRAGI970Type object + ''' + ''' string to deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As IDEMEATRAGI970Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDEMEATRAGI970Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As IDEMEATRAGI970Type + Return CType(SerializerXml.Deserialize(s), IDEMEATRAGI970Type) + End Function +#End Region + + ''' + ''' Serializes current IDEMEATRAGI970Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an IDEMEATRAGI970Type object + ''' + ''' File to load and deserialize + ''' Output IDEMEATRAGI970Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IDEMEATRAGI970Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IDEMEATRAGI970Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class CONNR2Type + +#Region "Private fields" + Private _conNumNR21 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property ConNumNR21() As String + Get + Return Me._conNumNR21 + End Get + Set + Me._conNumNR21 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CONNR2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CONNR2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes CONNR2Type object + ''' + ''' string to deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As CONNR2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CONNR2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As CONNR2Type + Return CType(SerializerXml.Deserialize(s), CONNR2Type) + End Function +#End Region + + ''' + ''' Serializes current CONNR2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an CONNR2Type object + ''' + ''' File to load and deserialize + ''' Output CONNR2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CONNR2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CONNR2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class PRODOCDC2Type + +#Region "Private fields" + Private _docTypDC21 As String + + Private _docRefDC23 As String + + Private _docRefDCLNG As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property DocTypDC21() As String + Get + Return Me._docTypDC21 + End Get + Set + Me._docTypDC21 = Value + End Set + End Property + + + Public Property DocRefDC23() As String + Get + Return Me._docRefDC23 + End Get + Set + Me._docRefDC23 = Value + End Set + End Property + + + Public Property DocRefDCLNG() As String + Get + Return Me._docRefDCLNG + End Get + Set + Me._docRefDCLNG = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRODOCDC2Type)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PRODOCDC2Type object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes PRODOCDC2Type object + ''' + ''' string to deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As PRODOCDC2Type + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRODOCDC2Type) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRODOCDC2Type + Return CType(SerializerXml.Deserialize(s), PRODOCDC2Type) + End Function +#End Region + + ''' + ''' Serializes current PRODOCDC2Type object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an PRODOCDC2Type object + ''' + ''' File to load and deserialize + ''' Output PRODOCDC2Type object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PRODOCDC2Type) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRODOCDC2Type + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class GOOITEGDSType + +#Region "Private fields" + Private _iteNumGDS7 As String + + Private _comRefNumGIM1 As String + + Private _pRODOCDC2 As List(Of PRODOCDC2Type) + + Private _cONNR2 As List(Of CONNR2Type) + + Private _iDEMEATRAGI970 As List(Of IDEMEATRAGI970Type) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._iDEMEATRAGI970 = New List(Of IDEMEATRAGI970Type)() + Me._cONNR2 = New List(Of CONNR2Type)() + Me._pRODOCDC2 = New List(Of PRODOCDC2Type)() + End Sub + + + Public Property IteNumGDS7() As String + Get + Return Me._iteNumGDS7 + End Get + Set + Me._iteNumGDS7 = Value + End Set + End Property + + + Public Property ComRefNumGIM1() As String + Get + Return Me._comRefNumGIM1 + End Get + Set + Me._comRefNumGIM1 = Value + End Set + End Property + + + Public Property PRODOCDC2() As List(Of PRODOCDC2Type) + Get + Return Me._pRODOCDC2 + End Get + Set + Me._pRODOCDC2 = Value + End Set + End Property + + + Public Property CONNR2() As List(Of CONNR2Type) + Get + Return Me._cONNR2 + End Get + Set + Me._cONNR2 = Value + End Set + End Property + + + Public Property IDEMEATRAGI970() As List(Of IDEMEATRAGI970Type) + Get + Return Me._iDEMEATRAGI970 + End Get + Set + Me._iDEMEATRAGI970 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GOOITEGDSType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize GOOITEGDSType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes GOOITEGDSType object + ''' + ''' string to deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As GOOITEGDSType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GOOITEGDSType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As GOOITEGDSType + Return CType(SerializerXml.Deserialize(s), GOOITEGDSType) + End Function +#End Region + + ''' + ''' Serializes current GOOITEGDSType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an GOOITEGDSType object + ''' + ''' File to load and deserialize + ''' Output GOOITEGDSType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GOOITEGDSType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As GOOITEGDSType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.xsd new file mode 100644 index 00000000..575591d8 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/CC328A-v10-0.xsd @@ -0,0 +1,550 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/complex_types_ics-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/complex_types_ics-v10-0.xsd new file mode 100644 index 00000000..e192d093 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/complex_types_ics-v10-0.xsd @@ -0,0 +1,1754 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/doc-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/doc-v10-0.xsd new file mode 100644 index 00000000..d8ec7f00 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/doc-v10-0.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types-v10-0.xsd new file mode 100644 index 00000000..e3b78a00 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types-v10-0.xsd @@ -0,0 +1,662 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for all anN and an..N types + + + + + + Base class for all aN and a..N + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Customs Office Reference Number + (format:an8) + + + + + + + + + Trader City (format: + an..35) + + + + + + + + + + + + + + Country Code (format:a2) + + + + + + + + + Date type (format + YYMMDD) + + + + + + + + + Date and Time with precision of minute + (format + YYYYMMDDHHMM) + + + + + + + + + Date type (format + YYYYMMDD) + + + + + + + + + Date type (format + YYYYMMDDHHMNSS) + + + + + + + + + Day in the Month (format: + DD) + + + + + + + + + Base class for all n..N,M + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Declaration request number (format: + an..22) + + + + + + + + + GRN (format: an..24), (alias:GuaRefNumGRNREF21) + + + + + + + + Language Code (format: a2) + + + + + + + + + MRN (format: an..21), (alias: DocNumHEA5Type) + + + + + + + + Base class for all nN and n..N + types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Trader Postal Code (format: + n..9) + + + + + + + + + Trader Street and Number (format: + an..35) + + + + + + + + + + + + + + Trader Identification Number (format: + an..17) + + + + + + + + + + Taric Code (format: + an..6) + + + + + + + + Time with precision of minute (format + HHMM) + + + + + + + + + Trader Name (format: + an..35) + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types_ics-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types_ics-v10-0.xsd new file mode 100644 index 00000000..bc38d0d8 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/simple_types_ics-v10-0.xsd @@ -0,0 +1,2 @@ + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl-v10-0.xsd new file mode 100644 index 00000000..4bdded94 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl-v10-0.xsd @@ -0,0 +1,769 @@ + + + + + [Format: a1] + + + + + Reference Data + + + + + Entry Processing + + + + + Lodgement + + + + + ALL FUNCTIONALITY + + + + + + + All the countries included in code list 9 excluding AX, GF, GP, LI, MC, MQ, RE, SJ and YT. The same codelist values are used for all Domains (ECS/NCTS/ICS) in order to support the COL. Values are shown for illustration only. [Format: a2] + + + + + Andorra + + + + + Austria + + + + + Belgium + + + + + Bulgaria + + + + + Switzerland + + + + + Cyprus + + + + + Czech Republic + + + + + Germany + + + + + Denmark + + + + + Estonia + + + + + Spain + + + + + Finland + + + + + France + + + + + United Kingdom + + + + + Greece + + + + + Croatia + + + + + Hungary + + + + + Ireland + + + + + Iceland + + + + + Italy + + + + + Lithuania + + + + + Luxembourg + + + + + Latvia + + + + + Malta + + + + + Netherlands + + + + + Norway + + + + + Poland + + + + + Portugal + + + + + Romania + + + + + Sweden + + + + + Slovenia + + + + + Slovakia + + + + + San Marino + + + + + Turkey + + + + + + + [Format: n1] + + + + + Monday + + + + + Tuesday + + + + + Wednesday + + + + + Thursday + + + + + Friday + + + + + Saturday + + + + + Sunday + + + + + + + It is an alphanumerical up to 50 characters string (i.e. an..50) that is used to define in an acknowledgement notification message the error code(s). [Format: an..50] + + + + + Non XML message received + + + + + Invalid byte sequence: a byte sequence does not represent a valid character in the character encoding scheme (UTF-8). + + + + + Envelope Id and/or Originator Reference are missing + + + + + + + - Subset of the UN/EDIFACT generic error table. - For remarks on the codes : see DDNTA Sec. VII. [Format: n2] + + + + + Incorrect (code) value + + + + + Missing + + + + + Value not supported in this position (code value constraint) + + + + + Not supported in this position + + + + + Invalid decimal notation + + + + + Duplicate detected + + + + + Too many repetitions + + + + + Invalid type characters + + + + + Missing digit in front of decimal sign + + + + + Element too long (length constraint) + + + + + Element too short (length constraint) + + + + + Unknown MRN + + + + + Duplicate MRN + + + + + Message out of sequence + + + + + Invalid MRN + + + + + + + Defines the codes to be used for reporting errors on XML messages. [Format: n2] + + + + + Incorrect enumeration + + + + + Missing + + + + + Not supported in this position + + + + + Unspecified Error / Other + + + + + Invalid decimal notation + + + + + Too many repetitions + + + + + Element too long (length constraint) + + + + + Element too short (length constraint) + + + + + Invalid Value for the specific type + + + + + Invalid value according to the pattern + + + + + Invalid XML format + + + + + Invalid character(s) + + + + + Value is lower than the allowed lowest limit (Minimum Inclusive) + + + + + Value is greater than the allowed upper limit (Maximum Inclusive) + + + + + Value is lower than or equal to the allowed lowest limit (Minimum Exlcusive) + + + + + Value is greater than or equal to the allowed upper limit (Maximum Exclusive) + + + + + + + Used for CUSTOMS OFFICE LSD. [Format: an1] + + + + + Simple office (see box A in Customs Office List) + + + + + Higher authority (see box E in Customs Office List) + + + + + + + Used for the attribute SYSTEM UNAVAILABILITY.System Unavailability Type. [Format: a1] + + + + + Business service not implemented + + + + + Scheduled Unavailability + + + + + Unscheduled Unavailability + + + + + + + Used for attributes that can have a positive or a negative value. [Format: n1] + + + + + NO + + + + + YES + + + + + + + [Format: an2] + + + + + January + + + + + February + + + + + March + + + + + April + + + + + May + + + + + June + + + + + July + + + + + August + + + + + September + + + + + October + + + + + November + + + + + December + + + + + + + Used for attribute MESSAGE ERRORS.Association assigned code and MESSAGE.Message Type. The usage of each code in one of the UNSM templates is defined in the Remarks column. CC should in all cases be instantiated to the value of the particular domain in which the message is created. [Format: an..6] [Format: an..6] + + + + + Entry Summary Declaration Amendment Accepted + + + + + Entry Summary Declaration Amendment Rejection + + + + + Entry Summary Declaration Amendment + + + + + Entry Summary Declaration + + + + + Entry Summary Declaration Rejected + + + + + Diversion Request Import + + + + + Diversion Request Rejected + + + + + Diversion Request Acknowledgement + + + + + Entry Summary Request Acknowledgement + + + + + Advanced Intervention Notification + + + + + Notification of customs offices modification to common domain + + + + + Notification of customs offices modification to national domain + + + + + Notification of common reference data modification to ND + + + + + Notification of System Unavailability to CD + + + + + Notification of System Unavailability to ND + + + + + ENS + + + + + Declaration Request Import + + + + + Entry Summary Declaration Response + + + + + Transmission to subsequent Office of Entry + + + + + Sending of statistics data + + + + + Statistics generated sent to national domain + + + + + Functional NACK + + + + + Availability Matrix + + + + + Upload parsing response + + + + + COL request + + + + + Common RD Request + + + + + XML NACK + + + + + COL DATA + + + + + Common RD Data + + + + + Full Unavailability Schedule + + + + + + + Used for (multiple) attribute Operation. [Format: a1] + + + + + Create + + + + + Delete + + + + + Update + + + + + + + Custom System applicable domain [Format: n..2] + + + + + NCTS + + + + + ECS + + + + + ICS + + + + + EOS + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl_ics-v10-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl_ics-v10-0.xsd new file mode 100644 index 00000000..0a156661 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/ENS/CC328A/tcl_ics-v10-0.xsd @@ -0,0 +1,2 @@ + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.Designer.vb new file mode 100644 index 00000000..8c4ce299 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.Designer.vb @@ -0,0 +1,430 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"SuccessResponse_v2_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace SuccessResponse_v2_0 + + + Partial Public Class SuccessResponse + +#Region "Private fields" + Private _message As List(Of MessageType) + + Private _acceptedTime As Date + + Private _responseData As System.Xml.XmlElement + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._message = New List(Of MessageType)() + End Sub + + + Public Property Message() As List(Of MessageType) + Get + Return Me._message + End Get + Set + Me._message = Value + End Set + End Property + + Public Property AcceptedTime() As Date + Get + Return Me._acceptedTime + End Get + Set + Me._acceptedTime = Value + End Set + End Property + + Public Property ResponseData() As System.Xml.XmlElement + Get + Return Me._responseData + End Get + Set + Me._responseData = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SuccessResponse)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize SuccessResponse object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes SuccessResponse object + ''' + ''' string to deserialize + ''' Output SuccessResponse object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SuccessResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SuccessResponse) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SuccessResponse) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As SuccessResponse + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SuccessResponse) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As SuccessResponse + Return CType(SerializerXml.Deserialize(s), SuccessResponse) + End Function +#End Region + + ''' + ''' Serializes current SuccessResponse object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an SuccessResponse object + ''' + ''' File to load and deserialize + ''' Output SuccessResponse object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SuccessResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SuccessResponse) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SuccessResponse) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SuccessResponse + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class MessageType + +#Region "Private fields" + Private _code As String + + Private _lang As String + + Private _value As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property code() As String + Get + Return Me._code + End Get + Set + Me._code = Value + End Set + End Property + + + Public Property lang() As String + Get + Return Me._lang + End Get + Set + Me._lang = Value + End Set + End Property + + + Public Property Value() As String + Get + Return Me._value + End Get + Set + Me._value = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MessageType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize MessageType object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes MessageType object + ''' + ''' string to deserialize + ''' Output MessageType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As MessageType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MessageType) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As MessageType) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As MessageType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), MessageType) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As MessageType + Return CType(SerializerXml.Deserialize(s), MessageType) + End Function +#End Region + + ''' + ''' Serializes current MessageType object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an MessageType object + ''' + ''' File to load and deserialize + ''' Output MessageType object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As MessageType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MessageType) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As MessageType) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As MessageType + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.xsd new file mode 100644 index 00000000..6a122ba2 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/SuccessResponse-v2-0.xsd @@ -0,0 +1,56 @@ + + + + + + + + + + + Service-specific advisory text messages (if + any). It is possible for more than one + message to be returned per response. Each + message must be presented to the user. + Service-specific message codes are carried + in the "code" attribute (see + Service-specific documentation for details). + + + + + Placeholder for future use. + + + + + Container for + service-specific response data if any (e.g. + MSD returned payment reference). See + additional service-specific response data + Schema (if any) and documentation for + details. + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.Designer.vb new file mode 100644 index 00000000..ea46918c --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.Designer.vb @@ -0,0 +1,667 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"errorresponse_v2_0","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true},"JsonOutput":{},"Enabled":true},"Miscellaneous":{}} +'' +'' ------------------------------------------------------------------------------ +#Disable Warning +Imports System +Imports System.Diagnostics +Imports System.Xml.Serialization +Imports System.Runtime.Serialization +Imports System.Collections +Imports System.Xml.Schema +Imports System.ComponentModel +Imports System.Xml +Imports System.IO +Imports System.Text +Imports System.Collections.Generic + +Namespace errorresponse_v2_0 + + + Partial Public Class ErrorResponse + +#Region "Private fields" + Private _application As Application + + Private _error As List(Of ErrorResponseError) + + Private _schemaVersion As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._error = New List(Of ErrorResponseError)() + Me._application = New Application() + End Sub + + Public Property Application() As Application + Get + Return Me._application + End Get + Set + Me._application = Value + End Set + End Property + + + Public Property [Error]() As List(Of ErrorResponseError) + Get + Return Me._error + End Get + Set + Me._error = Value + End Set + End Property + + + Public Property SchemaVersion() As String + Get + Return Me._schemaVersion + End Get + Set + Me._schemaVersion = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ErrorResponse)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ErrorResponse object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes ErrorResponse object + ''' + ''' string to deserialize + ''' Output ErrorResponse object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ErrorResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ErrorResponse) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ErrorResponse) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As ErrorResponse + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ErrorResponse) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As ErrorResponse + Return CType(SerializerXml.Deserialize(s), ErrorResponse) + End Function +#End Region + + ''' + ''' Serializes current ErrorResponse object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an ErrorResponse object + ''' + ''' File to load and deserialize + ''' Output ErrorResponse object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ErrorResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ErrorResponse) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ErrorResponse) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ErrorResponse + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class Application + +#Region "Private fields" + Private _any As List(Of System.Xml.XmlElement) + + Private _anyAttr As List(Of System.Xml.XmlAttribute) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._anyAttr = New List(Of System.Xml.XmlAttribute)() + Me._any = New List(Of System.Xml.XmlElement)() + End Sub + + + Public Property Any() As List(Of System.Xml.XmlElement) + Get + Return Me._any + End Get + Set + Me._any = Value + End Set + End Property + + + Public Property AnyAttr() As List(Of System.Xml.XmlAttribute) + Get + Return Me._anyAttr + End Get + Set + Me._anyAttr = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(Application)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize Application object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes Application object + ''' + ''' string to deserialize + ''' Output Application object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As Application, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, Application) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As Application) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As Application + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), Application) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As Application + Return CType(SerializerXml.Deserialize(s), Application) + End Function +#End Region + + ''' + ''' Serializes current Application object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an Application object + ''' + ''' File to load and deserialize + ''' Output Application object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As Application, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, Application) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As Application) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As Application + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class + + + Partial Public Class ErrorResponseError + +#Region "Private fields" + Private _raisedBy As String + + Private _number As String + + Private _type As String + + Private _text As List(Of String) + + Private _location As String + + Private _application As Application + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._application = New Application() + Me._text = New List(Of String)() + End Sub + + Public Property RaisedBy() As String + Get + Return Me._raisedBy + End Get + Set + Me._raisedBy = Value + End Set + End Property + + + Public Property Number() As String + Get + Return Me._number + End Get + Set + Me._number = Value + End Set + End Property + + Public Property Type() As String + Get + Return Me._type + End Get + Set + Me._type = Value + End Set + End Property + + + Public Property Text() As List(Of String) + Get + Return Me._text + End Get + Set + Me._text = Value + End Set + End Property + + Public Property Location() As String + Get + Return Me._location + End Get + Set + Me._location = Value + End Set + End Property + + Public Property Application() As Application + Get + Return Me._application + End Get + Set + Me._application = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ErrorResponseError)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ErrorResponseError object + ''' + ''' XML value + Public Overridable Function Serialize() As String + Dim streamReader As StreamReader = Nothing + Dim memoryStream As MemoryStream = Nothing + Try + memoryStream = New MemoryStream() + Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings() + xmlWriterSettings.Indent = True + xmlWriterSettings.IndentChars = " " + Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings) + SerializerXml.Serialize(xmlWriter, Me) + memoryStream.Seek(0, SeekOrigin.Begin) + streamReader = New StreamReader(memoryStream) + Return streamReader.ReadToEnd + Finally + If (Not (streamReader) Is Nothing) Then + streamReader.Dispose() + End If + If (Not (memoryStream) Is Nothing) Then + memoryStream.Dispose() + End If + End Try + End Function + + ''' + ''' Deserializes ErrorResponseError object + ''' + ''' string to deserialize + ''' Output ErrorResponseError object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ErrorResponseError, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ErrorResponseError) + Try + obj = Deserialize(input) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ErrorResponseError) As Boolean + Dim exception As System.Exception = Nothing + Return Deserialize(input, obj, exception) + End Function + + Public Overloads Shared Function Deserialize(ByVal input As String) As ErrorResponseError + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ErrorResponseError) + Finally + If (Not (stringReader) Is Nothing) Then + stringReader.Dispose() + End If + End Try + End Function + + Public Overloads Shared Function Deserialize(ByVal s As Stream) As ErrorResponseError + Return CType(SerializerXml.Deserialize(s), ErrorResponseError) + End Function +#End Region + + ''' + ''' Serializes current ErrorResponseError object into file + ''' + ''' full path of outupt xml file + ''' output Exception value if failed + ''' true if can serialize and save into file; otherwise, false + Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean + exception = Nothing + Try + SaveToFile(fileName) + Return True + Catch e As System.Exception + exception = e + Return False + End Try + End Function + + Public Overridable Overloads Sub SaveToFile(ByVal fileName As String) + Dim streamWriter As StreamWriter = Nothing + Try + Dim dataString As String = Serialize() + Dim outputFile As FileInfo = New FileInfo(fileName) + streamWriter = outputFile.CreateText + streamWriter.WriteLine(dataString) + streamWriter.Close() + Finally + If (Not (streamWriter) Is Nothing) Then + streamWriter.Dispose() + End If + End Try + End Sub + + ''' + ''' Deserializes xml markup from file into an ErrorResponseError object + ''' + ''' File to load and deserialize + ''' Output ErrorResponseError object + ''' output Exception value if deserialize failed + ''' true if this Serializer can deserialize the object; otherwise, false + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ErrorResponseError, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ErrorResponseError) + Try + obj = LoadFromFile(fileName) + Return True + Catch ex As System.Exception + exception = ex + Return False + End Try + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ErrorResponseError) As Boolean + Dim exception As System.Exception = Nothing + Return LoadFromFile(fileName, obj, exception) + End Function + + Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ErrorResponseError + Dim file As FileStream = Nothing + Dim sr As StreamReader = Nothing + Try + file = New FileStream(fileName, FileMode.Open, FileAccess.Read) + sr = New StreamReader(file) + Dim dataString As String = sr.ReadToEnd + sr.Close() + file.Close() + Return Deserialize(dataString) + Finally + If (Not (file) Is Nothing) Then + file.Dispose() + End If + If (Not (sr) Is Nothing) Then + sr.Dispose() + End If + End Try + End Function + End Class +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.xsd new file mode 100644 index 00000000..9f3df87a --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/errorresponse-v2.0.xsd @@ -0,0 +1,46 @@ + + + + This schema is used for errors returned by + business systems. In these circumstances, the header + contains a single Error element of type "business" + and the Body contains further information. + + business, error, response + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xml.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xml.xsd new file mode 100644 index 00000000..6aa5d84f --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xml.xsd @@ -0,0 +1,286 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xmldsig-core-schema.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xmldsig-core-schema.xsd new file mode 100644 index 00000000..b4b853d7 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/Response/xmldsig-core-schema.xsd @@ -0,0 +1,318 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb index aa08235d..c3d642d9 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/HMRC/cHMRC_ENS.vb @@ -1,6 +1,19 @@ -Imports Org.BouncyCastle.Ocsp -Imports VERAG_PROG_ALLGEMEIN.CC015B_TR_EXT_V4_3 +Imports System.IO +Imports System.Xml.Linq +Imports com.sun.xml.internal.rngom.parse.compact +Imports Org.BouncyCastle.Ocsp +Imports Polly +Imports CC015B_TR_EXT_V4_3 +Imports CC304A_v10_0 +Imports CC305A_v10_0 +Imports CC316A_v10_0 +Imports CC328A_v10_0 +Imports ENS_CC315A Imports VERAG_PROG_ALLGEMEIN.ENS_CC315A +Imports VERAG_PROG_ALLGEMEIN.CC304A_v10_0 +Imports VERAG_PROG_ALLGEMEIN.CC316A_v10_0 +Imports VERAG_PROG_ALLGEMEIN.CC328A_v10_0 +Imports VERAG_PROG_ALLGEMEIN.CC305A_v10_0 Public Class cHMRC_ENS @@ -16,133 +29,836 @@ Public Class cHMRC_ENS Shared Function helloWorldENS(ByVal response As String) As Boolean + Try + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() - VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim TOKEN = cHMRC.getTOKEN("ENS_HELLOWORLD") + If TOKEN.hasEntry Then + ' HTTP-Client initialisieren + Dim http As New Chilkat.Http + ' Falls das Token fehlt, Hinweis ausgeben + If String.IsNullOrEmpty(TOKEN.token_BEARER_TOKEN) Then + Console.WriteLine("Fehler: Kein OAuth2-Token gefunden!") + Return False + End If - Dim TOKEN = cHMRC.getTOKEN("ENS_HELLOWORLD") + ' Setze die benötigten Header + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + http.SetRequestHeader("Content-Type", "application/xml; charset=UTF-8") + http.SetRequestHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) - If TOKEN.hasEntry Then + ' API-Endpunkt für User-Restricted Hello API + Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/application" + 'Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/user" - ' HTTP-Client initialisieren - Dim http As New Chilkat.Http + ' API-Anfrage senden + response = http.QuickGetStr(url) - ' Falls das Token fehlt, Hinweis ausgeben - If String.IsNullOrEmpty(TOKEN.token_BEARER_TOKEN) Then - Console.WriteLine("Fehler: Kein OAuth2-Token gefunden!") - Return False + ' Fehlerbehandlung + If (http.LastMethodSuccess <> True) Then + Console.WriteLine("Fehler: " & http.LastErrorText) + MsgBox("Fehler: " & http.LastErrorText) + Else + Console.WriteLine("Antwort von HMRC API: " & response) + MsgBox("Antwort von HMRC API: " & response) + End If + Return True End If - ' Setze die benötigten Header - http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") - http.SetRequestHeader("Content-Type", "application/xml; charset=UTF-8") - http.SetRequestHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) + Catch ex As Exception + cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try - ' API-Endpunkt für User-Restricted Hello API - Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/application" - 'Dim url As String = "https://test-api.service.hmrc.gov.uk/hello/user" - - ' API-Anfrage senden - response = http.QuickGetStr(url) - - ' Fehlerbehandlung - If (http.LastMethodSuccess <> True) Then - Console.WriteLine("Fehler: " & http.LastErrorText) - MsgBox("Fehler: " & http.LastErrorText) - Else - Console.WriteLine("Antwort von HMRC API: " & response) - MsgBox("Antwort von HMRC API: " & response) - End If - Return True - End If Return False End Function - Shared Function insertENS(ENS_CC315A As CC315AType, ByVal response As String) As Boolean - ' Chilkat-Objekt initialisieren - Dim http As New Chilkat.Http() + Shared Function insertENS(ENS_CC315A As CC315AType, ByVal responseStr As String) As Boolean + Try + ' Chilkat-Objekt initialisieren + ' Dim http As New Chilkat.Http() - ' EORI-Nummer für die Überprüfung - 'Dim eoriNumber As String = "GB123456789000" + ' EORI-Nummer für die Überprüfung + 'Dim eoriNumber As String = "GB123456789000" - Dim url As String = "" - If TEST Then - url = "test-api.service.hmrc.gov.uk" - Else - url = "api.service.hmrc.gov.uk" - End If - MsgBox(url) - VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk - '------------------------------------------------------- + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() - ENS_CC315A = New CC315AType - - ENS_CC315A.MesSenMES3 = "GB123" - ENS_CC315A.DatOfPreMES9 = Now.ToString("yyMMdd") - ENS_CC315A.TimOfPreMES10 = Now.ToString("HHmm") - ENS_CC315A.MesIdeMES19 = "ABCD1234" - 'ENS_CC315A.MesTypMES20 = "CC315A" - - ENS_CC315A.HEAHEA.RefNumHEA4 = "ABCD1234" - ENS_CC315A.HEAHEA.TraModAtBorHEA76 = "4" - ENS_CC315A.HEAHEA.TotNumOfIteHEA305 = "1" - - - '------------------------------------------------------- + '------------------------------------------------------- - Dim TOKEN = cHMRC.getTOKEN("ENS", True) + 'TEEST::: - If TOKEN.hasEntry Then + ENS_CC315A = CC315AType.LoadFromFile("D:\Andreas\TMP\CC315A_Example1.xml") + ENS_CC315A.DatOfPreMES9 = Now.ToString("yyMMdd") + ENS_CC315A.TimOfPreMES10 = Now.ToString("HHmm") - Dim req As New Chilkat.HttpRequest() + If False Then + If ENS_CC315A Is Nothing Then + 'Return False 'FEHLER!??!? + ENS_CC315A = New CC315AType '-> nur zum testen + End If + If ENS_CC315A.MesSenMES3 Is Nothing OrElse ENS_CC315A.MesSenMES3 = "" Then + ENS_CC315A.MesSenMES3 = "GB552556002342" 'TEST USER 790949012321 + End If - ' Setze deine HMRC API-Credentials - http.AuthToken = TOKEN.token_BEARER_TOKEN + ENS_CC315A.DatOfPreMES9 = Now.ToString("yyMMdd") + ENS_CC315A.TimOfPreMES10 = Now.ToString("HHmm") + ENS_CC315A.MesIdeMES19 = "ABCD1234" + 'ENS_CC315A.MesTypMES20 = "CC315A" - req.HttpVerb = "POST" - req.Path = "/customs/imports/declarations" - req.ContentType = "application/xml" - req.Charset = "utf-8" - req.SendCharset = True - - - - MsgBox(ENS_CC315A.Serialize) - ' Füge das XML als Body hinzu - req.LoadBodyFromString(ENS_CC315A.Serialize, "utf-8") - - ' Füge benötigte Header hinzu - req.AddHeader("Accept", "application/vnd.hmrc.1.0+xml") '"application/vnd.hmrc.1.0+xml") - req.AddHeader("Content-Type", "application/xml; charset=UTF-8") '"application/xml") - req.AddHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) - ' req.AddHeader("Gov-Client-Connection-Method", "WEB_APP_VIA_SERVER") - ' req.AddHeader("Gov-Client-Public-IP", "192.168.1.1") - ' req.AddHeader("Gov-Client-Timezone", "UTC+00:00") - - MsgBox(TOKEN.token_BEARER_TOKEN) - ' Sende die Anfrage - Dim resp As Chilkat.HttpResponse = http.SynchronousRequest(url, 443, True, req) - - If resp Is Nothing Then - Console.WriteLine("Fehler: " & http.LastErrorText) - Else - Console.WriteLine("Status Code: " & resp.StatusCode) - Console.WriteLine("Antwort: " & resp.BodyStr) + ENS_CC315A.HEAHEA.RefNumHEA4 = "ABCD1234" + ENS_CC315A.HEAHEA.TraModAtBorHEA76 = "4" + ENS_CC315A.HEAHEA.TotNumOfIteHEA305 = "1" End If - Return True - End If + + '------------------------------------------------------- + + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Setzen des Content-Type-Headers für die Anfrage + http.SetRequestHeader("Content-Type", "application/xml; charset=UTF-8") + + ' Definieren Sie die URL für die POST-Anfrage + Dim urlHTTP As String = url & "/customs/imports/declarations" + Dim xmlContent As String = ENS_CC315A.Serialize + + ' xmlContent = File.ReadAllText("D:\Andreas\TMP\CC315A_Example1.xml") + + MsgBox(xmlContent) + ' Senden Sie die POST-Anfrage mit dem XML-Inhalt + Dim response As Chilkat.HttpResponse = http.PostXml(urlHTTP, xmlContent, "utf-8") + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return False + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 202) Then + Console.WriteLine("Entry Summary Declaration erfolgreich eingereicht.") + Console.WriteLine("Antwort:") + Console.WriteLine(response.BodyStr) + + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim RESP = SuccessResponse_v2_0.SuccessResponse.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + + Return True + ElseIf (response.StatusCode = 400) Then + + Console.WriteLine("Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + + + Dim errTxt = "" + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim RESP = errorresponse_v2_0.ErrorResponse.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + For Each Erline In RESP.Error + errTxt &= String.Join(", ", Erline.Text) & vbNewLine & vbNewLine + Next + + + MsgBox(errTxt) + + Return False + + + Else + Console.WriteLine("Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + + + Return False + + End If + + + + 'Dim req As New Chilkat.HttpRequest() + + '' Setze deine HMRC API-Credentials + 'http.AuthToken = TOKEN.token_BEARER_TOKEN + + 'req.HttpVerb = "POST" + 'req.Path = "/customs/imports/declarations" + 'req.ContentType = "application/xml" + 'req.Charset = "utf-8" + 'req.SendCharset = True + + '' Füge das XML als Body hinzu + 'req.LoadBodyFromString(ENS_CC315A.Serialize, "utf-8") + + '' Füge benötigte Header hinzu + 'req.AddHeader("Accept", "application/vnd.hmrc.1.0+xml") '"application/vnd.hmrc.1.0+xml") + 'req.AddHeader("Content-Type", "application/xml; charset=UTF-8") '"application/xml") + 'req.AddHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) + + 'MsgBox(TOKEN.token_BEARER_TOKEN) + '' Sende die Anfrage + 'Dim resp As Chilkat.HttpResponse = http.SynchronousRequest(url, 443, True, req) + + 'If resp Is Nothing Then + ' Console.WriteLine("Fehler: " & http.LastErrorText) + 'Else + ' Console.WriteLine("Status Code: " & resp.StatusCode) + ' Console.WriteLine("Antwort: " & resp.BodyStr) + 'End If + + 'Return True + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try Return False End Function + Shared Function amendENS(MRN As String, ByRef CC313AResponse As CC315AType) As Boolean + + Try + + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Setzen des Content-Type-Headers (kann erforderlich sein) + http.SetRequestHeader("Content-Type", "application/xml") + + ' Definieren Sie die URL für die PUT-Anfrage + Dim urlHttp As String = url & "/customs/imports/declarations/{" & MRN & "}" + + ' Senden Sie die PUT-Anfrage ohne Body + Dim response As Chilkat.HttpResponse = http.QuickRequest("PUT", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("❌ Fehler bei der Anfrage: " & http.LastErrorText) + Return False + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 200) Then + Console.WriteLine("✅ Entry Summary Declaration erfolgreich geändert.") + Console.WriteLine("Antwort:") + Console.WriteLine(response.BodyStr) ' XML-Ausgabe der Antwort + + + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + CC313AResponse = CC315AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + + Return True + Else + Console.WriteLine("❌ Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return False + End If + + + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Shared Function getListOfENSOutcomes() As List(Of HmrcOutcomes) + + Try + + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Definieren Sie die URL für die GET-Anfrage + Dim urlHttp As String = url & "/customs/imports/outcomes/" + + ' Senden Sie die GET-Anfrage + Dim response As Chilkat.HttpResponse = http.QuickRequest("GET", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return Nothing + End If + + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 204) Then + + Console.WriteLine("Ergebnis: Kein Inhalt!") + Console.WriteLine(response.BodyStr) + Return Nothing + + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 200) Then + Console.WriteLine("Liste der Outcomes erfolgreich abgerufen:") + Console.WriteLine(response.BodyStr) ' XML-Ausgabe der Antwort + Dim HmrcOutcomesList As List(Of HmrcOutcomes) = ParseHmrcXmlResponseOutcomes(response.BodyStr) + + + Return HmrcOutcomesList + Else + Console.WriteLine("Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return Nothing + End If + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return Nothing + End Function + + + Shared Function retrieveENSOutcome(correlationId, ByRef TypeOfResonse, ByRef ResponseClass) As Boolean + + Try + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Definieren Sie die URL für die GET-Anfrage + Dim urlHttp As String = url & "/customs/imports/outcomes/{" & correlationId & "}" + + ' Senden Sie die GET-Anfrage + Dim response As Chilkat.HttpResponse = http.QuickRequest("GET", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return Nothing + End If + + + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 200) Then + Console.WriteLine("Outcome erfolgreich abgerufen:") + Console.WriteLine(response.BodyStr) ' XML-Ausgabe der Antwort + + If response.BodyStr.Contains("CC328A") Then ' ANTWORT OK New submission accepted: + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim CC328A = CC328AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + TypeOfResonse = "CC328A" + ResponseClass = CC328A + Return True + + ElseIf response.BodyStr.Contains("CC316A") Then ' ANTWORT OK New submission rejected: + + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim CC316A = CC316AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + TypeOfResonse = "CC316A" + ResponseClass = CC316A + Return True + + ElseIf response.BodyStr.Contains("CC304A") Then ' Amended submission accepted + + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim CC304A = CC304AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + TypeOfResonse = "CC304A" + ResponseClass = CC304A + Return True + + ElseIf response.BodyStr.Contains("CC305A") Then ' Amended submission rejected + + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim CC305A = CC305AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + TypeOfResonse = "CC305A" + ResponseClass = CC305A + Return True + End If + Else + Console.WriteLine("Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return Nothing + End If + + + ' The Outcome for the Correlation ID (schema here). + + 'An accepted outcome which Is successful will contain a Movement Reference Number. A rejected outcome will contain one Or more errors. Accordingly, the content of response element will be based on one of the following schemas: + + ' New submission accepted schema http //ics.dgtaxud.ec/CC328A. + ' New submission rejected: schema http: //ics.dgtaxud.ec/CC316A. + ' Amended submission accepted: schema http: //ics.dgtaxud.ec/CC304A. + ' Amended submission rejected: schema http: //ics.dgtaxud.ec/CC305A. + + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return Nothing + End Function + + + + + Shared Function acknowlageENSOutcome(correlationId) As Boolean + + Try + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Setzen des Content-Type-Headers für die Anfrage + http.SetRequestHeader("Content-Type", "application/xml") + + ' Definieren Sie die URL für die POST-Anfrage + Dim urlHttp As String = url & "/customs/imports/outcomes/{" & correlationId & "}" + ' Senden Sie die POST-Anfrage ohne Body + Dim response As Chilkat.HttpResponse = http.QuickRequest("POST", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return False + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 204) Then + Console.WriteLine("✅ Benachrichtigung erfolgreich bestätigt.") + Return True + Else + Console.WriteLine("❌ Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return False + End If + + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + Shared Function getENSNotifications() As List(Of HmrcNotification) + + Try + + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Falls eine Authentifizierung erforderlich ist, setzen Sie den API-Schlüssel oder andere Authentifizierungsheader + http.SetRequestHeader("Authorization", "Bearer " & TOKEN.token_BEARER_TOKEN) + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Definieren Sie die URL für die GET-Anfrage + Dim urlHttpReq As String = url & "/customs/imports/notifications/" + + ' Senden Sie die GET-Anfrage und erhalten Sie die Antwort + Dim response As Chilkat.HttpResponse = http.QuickRequest("GET", urlHttpReq) + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return Nothing + End If + + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 204) Then + + Console.WriteLine("Ergebnis: Kein Inhalt!") + Console.WriteLine(response.BodyStr) + Return Nothing + + End If + If (response.StatusCode <> 200) Then + Console.WriteLine("Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return Nothing + End If + + ' Verarbeiten Sie den Antworttext (XML) + Dim xmlResponse As String = response.BodyStr + Console.WriteLine("Antwort erhalten:") + Console.WriteLine(xmlResponse) + Dim NotificationList As List(Of HmrcNotification) = ParseHmrcXmlResponse(xmlResponse) + + + Return NotificationList + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return Nothing + End Function + + Public Shared Function ParseHmrcXmlResponse(xmlResponse As String) As List(Of HmrcNotification) + Dim notifications As New List(Of HmrcNotification) + + Try + ' XML in ein XElement-Objekt laden + Dim xml As XElement = XElement.Parse(xmlResponse) + + ' Alle -Elemente durchlaufen + For Each response As XElement In xml.Elements("response") + Dim notification As New HmrcNotification With { + .CorrelationId = response.Element("correlationId")?.Value, + .NotificationId = response.Element("notificationId")?.Value, + .Link = response.Element("link")?.Value + } + notifications.Add(notification) + Next + Catch ex As Exception + Console.WriteLine("Fehler beim Parsen der XML-Antwort: " & ex.Message) + End Try + + Return notifications + End Function + + + Public Shared Function ParseHmrcXmlResponseOutcomes(xmlResponse As String) As List(Of HmrcOutcomes) + Dim outcomes As New List(Of HmrcOutcomes) + + Try + ' XML in ein XElement-Objekt laden + Dim xml As XElement = XElement.Parse(xmlResponse) + + ' Alle -Elemente durchlaufen + For Each response As XElement In xml.Elements("response") + Dim notification As New HmrcOutcomes With { + .CorrelationId = response.Element("correlationId")?.Value, + .MRN = response.Element("MRN")?.Value, + .Link = response.Element("link")?.Value + } + outcomes.Add(notification) + Next + Catch ex As Exception + Console.WriteLine("Fehler beim Parsen der XML-Antwort: " & ex.Message) + End Try + + Return outcomes + End Function + + + + Shared Function acknowlageENSNotification(notificationID) As Boolean + + Try + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Setzen des Content-Type-Headers für die Anfrage + http.SetRequestHeader("Content-Type", "application/xml") + + ' Definieren Sie die URL für die POST-Anfrage + Dim urlHttp As String = url & "/customs/imports/notifications/{" & notificationID & "}/acknowledge" + ' Senden Sie die POST-Anfrage ohne Body + Dim response As Chilkat.HttpResponse = http.QuickRequest("POST", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("Fehler bei der Anfrage: " & http.LastErrorText) + Return False + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 204) Then + Console.WriteLine("✅ Benachrichtigung erfolgreich bestätigt.") + Return True + Else + Console.WriteLine("❌ Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return False + End If + + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return False + End Function + + + Shared Function readENSNotification(notificationID) As CC315AType + + Try + + Dim CREDENTIALS = cHMRC.getCredentials(ApplicationName) + Dim url As String = CREDENTIALS.API_STRING ' URL Setzenen https://api.service.hmrc.gov.uk / https://test-api.service.hmrc.gov.uk + + + VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat() + + + + Dim TOKEN = cHMRC.getTOKEN("ENS") + + If TOKEN.hasEntry Then + + + ' Erstellen Sie eine Instanz des Http-Objekts + Dim http As New Chilkat.Http() + + ' Authentifizierung: Setzen des Bearer-Tokens + http.AuthToken = TOKEN.token_BEARER_TOKEN + + ' Setzen des Accept-Headers für die erwartete Antwort im XML-Format + http.SetRequestHeader("Accept", "application/vnd.hmrc.1.0+xml") + + ' Definieren Sie die URL für die GET-Anfrage + Dim urlHttp As String = url & "/customs/imports/notifications/{" & notificationID & "}" + + ' Senden Sie die GET-Anfrage + Dim response As Chilkat.HttpResponse = http.QuickRequest("GET", urlHttp) + + If (http.LastMethodSuccess = False) Then + Console.WriteLine("❌ Fehler bei der Anfrage: " & http.LastErrorText) + Return Nothing + End If + + ' Überprüfen Sie den HTTP-Statuscode der Antwort + If (response.StatusCode = 200) Then + Console.WriteLine("✅ Benachrichtigung erfolgreich abgerufen:") + Console.WriteLine(response.BodyStr) ' XML-Ausgabe + + Dim tempFilePath As String = Path.GetTempFileName() + File.WriteAllText(tempFilePath, response.BodyStr) + + Dim ENS_CC315A = CC315AType.LoadFromFile(tempFilePath) + Try + File.Delete(tempFilePath) ' Bereinigen nach der Verwendung + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + + Return ENS_CC315A + + Else + Console.WriteLine("❌ Fehler: HTTP Statuscode " & response.StatusCode) + Console.WriteLine(response.BodyStr) + Return Nothing + End If + + End If + + Catch ex As Exception + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + Return Nothing + End Function + + + ' Klasse zur Speicherung einer einzelnen Notification + Public Class HmrcNotification + Public Property CorrelationId As String + Public Property NotificationId As String + Public Property Link As String + End Class + + + ' Klasse zur Speicherung einer einzelnen Notification + Public Class HmrcOutcomes + Public Property CorrelationId As String + Public Property MRN As String + Public Property Link As String + End Class End Class diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj index 84b9ecf8..59319a13 100644 --- a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj +++ b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj @@ -428,6 +428,12 @@ + + + + + + @@ -874,6 +880,36 @@ Designer + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + Designer @@ -886,6 +922,18 @@ Designer + + Designer + + + Designer + + + Designer + + + Designer + Designer