diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.Designer.vb
new file mode 100644
index 00000000..fb42b60c
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.Designer.vb
@@ -0,0 +1,22 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicCustExportBasicTypes","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicCustExportBasicTypes
+End Namespace
+#Enable Warning
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.xsd
similarity index 95%
rename from VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.xsd
rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.xsd
index 7cfba806..a34c99cc 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.xsd
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.xsd
@@ -94,7 +94,7 @@
TIN
-
+
@@ -328,6 +328,15 @@
+
+
+ number(13,3)
+
+
+
+
+
+
number(13,4)
@@ -337,6 +346,24 @@
+
+
+ number(16,3)
+
+
+
+
+
+
+
+
+ number(16,6)
+
+
+
+
+
+
number(13,4)
@@ -346,6 +373,15 @@
+
+
+ number(15,5)
+
+
+
+
+
+
Flag Additional costs
@@ -384,7 +420,7 @@
additional Text
-
+
@@ -472,7 +508,7 @@
errortext in local language
-
+
@@ -562,10 +598,6 @@
-
-
-
-
@@ -628,6 +660,14 @@
+
+
+ Location of goods type
+
+
+
+
+
national tin flag
@@ -692,7 +732,7 @@
special Circumstances
-
+
@@ -716,7 +756,7 @@
ContactType
-
+
@@ -936,13 +976,22 @@
- number( 16,4)
+ number(16,4)
+
+
+ number(16,9)
+
+
+
+
+
+
The statistical code of the customs procedure evkz
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.Designer.vb
new file mode 100644
index 00000000..b5dacc70
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.Designer.vb
@@ -0,0 +1,22 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicCustExportComponents","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicCustExportComponents
+End Namespace
+#Enable Warning
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.xsd
similarity index 80%
rename from VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.xsd
rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.xsd
index 696acc0d..19ad4423 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.xsd
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.xsd
@@ -115,6 +115,29 @@ Muß nicht angegeben werden, wenn die Artikelnummer im Feld <item> angegeb
+
+
+
+ CUS Code
+ CUS-Nummer
+
+
+ false
+ String9
+
+ MIC_ALL_AAVPOS
+ aapcuscode
+ MIC_AUSPOS
+ afpcuscode
+
+
+
+
+
+
+
+
+
@@ -258,7 +281,7 @@ Muß nicht angegeben werden, wenn die Artikelnummer im Feld <item> angegeb
false
- String1..10
+ String1..17
___plz
@@ -309,10 +332,6 @@ Muß nicht angegeben werden, wenn die Artikelnummer im Feld <item> angegeb
___ust
-
-
-
-
@@ -629,6 +648,29 @@ Ref: EH-Pap. Feld 25
+
+
+
+ Type of Identification
+ Art der Identifikation
+
+
+ true
+ Number(2)
+
+ MIC_AAVSDG
+ Aastypeidentmotborder
+ MIC_AUSSDG
+ Afstypeidentmotborder
+
+
+
+
+
+
+
+
+
@@ -710,7 +752,7 @@ For sea transport (mot=10), the name of the ship must be declared.Bedingung C1:
Bei Seeverkehr (mot=10) muss der Schniffsname angegeben werden.
false
- String1..30
+ String1..35
MIC_AAVSDG
Aasvkmgrk
@@ -840,6 +882,150 @@ Bei Seeverkehr (mot=10) muss der Schniffsname angegeben werden.
+
+
+
+ Absolute international freight cost amount
+ Frachtwert
+
+
+ false
+ Decimal(17,4)
+
+ MIC_AAVSDG
+ AASABSNONEUFREIGHT
+ MIC_AUSSDG
+ AFSFRAWRTNONEUABS
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Currency Freight Costs
+ Währung Frachtkosten
+
+
+ false
+ String1..3
+
+ MIC_AAVSDG
+ AASABSNONEUFREIGHTCURRENCY
+ MIC_AUSSDG
+ AFSFRAWAENONEUABS
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Absolute community freight cost amount
+ Frachtwert
+
+
+ false
+ Decimal(17,4)
+
+ MIC_AAVSDG
+ AASABSEUFREIGHT
+ MIC_AUSSDG
+ AFSFRAWRTEUABS
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Currency Freight Costs
+ Währung Frachtkosten
+
+
+ false
+ String1..3
+
+ MIC_AAVSDG
+ AASABSEUFREIGHTCURRENCY
+ MIC_AUSSDG
+ AFSFRAWAEEUABS
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Absolute national freight cost amount
+ Frachtwert
+
+
+ false
+ Decimal(17,4)
+
+ MIC_AAVSDG
+ AASABSNATFREIGHT
+ MIC_AUSSDG
+ AFSFRAWRTNATABS
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Currency Freight Costs
+ Währung Frachtkosten
+
+
+ false
+ String1..3
+
+ MIC_AAVSDG
+ AASABSNATFREIGHTCURRENCY
+ MIC_AUSSDG
+ AFSFRAWAENATABS
+
+
+
+
+
+
+
+
+
+
@@ -1071,6 +1257,29 @@ Bei Seeverkehr (mot=10) muss der Schniffsname angegeben werden.
+
+
+
+
+ Delivery term code of United Nations for destitnation of trande and transport
+ Lieferbedingung Codierung der Vereinten Nationen zu Ortsangaben für Handel und Transport
+
+
+ false
+ String0..17
+
+ MIC_ALL_AAVKOP
+ Aakaliunlocode
+ MIC_AUSKOP
+ Afkaliunlocode
+
+
+
+
+
+
+
+
@@ -1095,6 +1304,52 @@ Bei Seeverkehr (mot=10) muss der Schniffsname angegeben werden.
+
+
+
+ Country of delivery term
+ Lieferbedingung Land
+
+
+ false
+ String0..2
+
+ MIC_ALL_AAVKOP
+ aakalicountry
+ MIC_AUSKOP
+ afkalicountry
+
+
+
+
+
+
+
+
+
+
+
+
+ Description of delivery term
+ Lieferbedingung Beschreibung
+
+
+ false
+ String0..512
+
+ MIC_ALL_AAVKOP
+ aakalideliverytermstext
+ MIC_AUSKOP
+ afkalideliverytermstext
+
+
+
+
+
+
+
+
+
@@ -1314,7 +1569,7 @@ Bei Seeverkehr (mot=10) muss der Schniffsname angegeben werden.
-
+
Attributtext
@@ -1390,9 +1645,9 @@ Folgende Partner sind ganau dann anzugegeben:
String1..2
MIC_CUST_AVPARTNER
- Avpreftyp
+ AVPTYP
MIC_CUST_PARTNER
- Parreftyp
+ PARTYP
@@ -1629,7 +1884,7 @@ Postleitzahl
Zip code, if no customs number is existent.
PLZ
false
- String1..10
+ String1..17
MIC_CUST_AVPARTNER
Avpplz
@@ -1640,7 +1895,7 @@ Postleitzahl
-
+
@@ -1783,6 +2038,29 @@ else
+
+
+
+ Role
+ Funktion
+
+
+ false
+ String3
+
+ MIC_CUST_AVPARTNER
+ Avprole
+ MIC_CUST_PARTNER
+ Parrole
+
+
+
+
+
+
+
+
+
@@ -1828,6 +2106,24 @@ else
+
+
+
+ Customer Fields
+ Freie kundenspezifische Felder
+
+
+ false
+
+
+ MIC_CUST_AVPARTNER
+ avp___1..10 (X=10)
+ MIC_CUST_PARTNER
+ par___1..10 (X=10)
+
+
+
+
@@ -1862,26 +2158,13 @@ else
- Type of export procedure with use of simplifications
-
- Art des Ausfuhrverfahrens mit
-Inanspruchnahme von Vereinfachungen
- a ... Complete export declaration in the two-stage standard procedure
-b ... Incomplete export declaration in the two-stage standard procedure
-c ... Complete export declaration in the two-stage standard procedure with order for presentation beyond customs premises according to §9(2) AWV
-d ... Incomplete export declaration in the two-stage standard procedure with order for presentation beyond customs premises according to §9(2) AWV
-e ... Complete export declaration in the two-stage simplified procedure ZA
-f ... Incomplete export declaration in the two-stage simplified procedure ZA
-g ... Complete export declaration in the single-stage procedure at low value
-i ... Complete export declaration in the singe-stage procedure in reasonable stages
- a ... Vollständige Ausfuhranmeldung zum zweistufigen Normalverfahren
-b ... Unvollständige Ausfuhranmeldung zum zweistufigen Normalverfahren
-c ... Vollständige Ausfuhranmeldung zum zweistufigen Normalverfahren mit Antrag auf Gestellung außerhalb des Amtsplatzes nach §9(2) AWV
-d ... Unvollständige Ausfuhranmeldung zum zweistufigen Normalverfahren mit Antrag auf Gestellung außerhalb des Amtsplatzes nach §9(2) AWV
-e ... Vollständige Ausfuhranmeldung zum zweistufigen Vereinfachten Verfahren ZA
-f ... Unvollständige Ausfuhranmeldung zum zweistufigen Vereinfachten Verfahren ZA
-g ... Vollständige Ausfuhranmeldung zum einstufigen Verfahren bei geringem Wert
-i ... Vollständige Ausfuhranmeldung zum einstufigen Verfahren in begründeten Fällen
+ Type of export procedure with use of simplifications
+ Indicator for supplementary declaration
+ Kennzeichen Ergänzende/ersetzende Anmeldung
+ 0... Export declaration
+1... Supplementary declaration
+ 0... Ausfuhranmeldung
+1... Ergänzende/ersetzende Anmeldung
false
String..1
@@ -1901,12 +2184,22 @@ i ... Vollständige Ausfuhranmeldung zum einstufigen Verfahren in begründeten F
- Type of export procedure (category)
- Art des Ausfuhrverfahrens (kategorisch)
- Codelist A0122
- Codeliste A0122
+ Type of export declaration
+ Art der Ausfuhranmeldung
+ Codelist A0121
+ Codeliste A0121
+Zum Verständnis verschiedener Abhängigkeiten innerhalb der Nachricht wird im Folgenden die Systematik und der Inhalt der Codeliste dargestellt.
+X••••••• Zeitpunkt der Abgabe der Anmeldung: 0=vorab, 1=nachträglich, 2=gesammelt
+•X•••••• Grund: 0=ohne, 1=Korrektur, 2: Notfall-Verfahren, 3=Carnet-ATA
+••X••••• Art der Passiven Veredelung: 0=keine, 1=zollrechtliche, 2=wirtschaftliche
+•••X•••• Art der PV-Bewilligung: 0=keine, 1=OPO-PV, 2=Antrag auf vereinfachte Bewilligung
+••••X••• Art der bewilligten Vereinfachung: 0=keine, 1=SDE
+•••••X•• Ort der Gestellung: 0=keiner, 1=Ausfuhrzollstelle, 2=§12(4) AWV, 3=SDE-Bewilligung, 4=CCL-Bewilligung, 9=Ausgangszollstelle
+••••••X• Umfang der Anmeldung (Vereinfachung): 0=vollständig, 1=unvollständig
+•••••••X Sonderfall: 0=keiner, 1=geringwertig, 2=begründet
+
false
- String2
+ String8
MIC_AAVSDG
Aastypedeclproc
@@ -1917,7 +2210,7 @@ i ... Vollständige Ausfuhranmeldung zum einstufigen Verfahren in begründeten F
-
+
@@ -1928,6 +2221,75 @@ i ... Vollständige Ausfuhranmeldung zum einstufigen Verfahren in begründeten F
location of goods
+
+
+
+ Qualifier of Identification
+ Art der Ortsbestimmung
+
+
+ true
+ String1
+
+ MIC_AAVSDG
+ Aaslocationidentifierqual
+ MIC_AUSSDG
+ Afslocationidentifierqual
+
+
+
+
+
+
+
+
+
+
+
+
+ Authorisation Number
+ Bewilligungsnummer
+
+
+ false
+ String1..35
+
+ MIC_AAVSDG
+ Aaslocationauthno
+ MIC_AUSSDG
+ Afslocationauthno
+
+
+
+
+
+
+
+
+
+
+
+
+ Additional Identifier
+ Zusätzliche Kennung
+
+
+ false
+ String1..4
+
+ MIC_AAVSDG
+ Aasadditionidentifier
+ MIC_AUSSDG
+ Afsadditionidentifier
+
+
+
+
+
+
+
+
+
@@ -1961,6 +2323,25 @@ Hierzu die Tags <street>, <zip>, <loc> und <addit> befü
+
+
+
+ GNSS
+ GNSS
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
@@ -1995,7 +2376,7 @@ Hierzu die Tags <street>, <zip>, <loc> und <addit> befü
- Alternative 1: leer lassen
- Alternative 2: ausfüllen
false
- String1..10
+ String1..17
MIC_CUST_AVPARTNER(nur wenn locGoods.code nicht befüllt)
Avpplz
@@ -2027,6 +2408,89 @@ Hierzu die Tags <street>, <zip>, <loc> und <addit> befü
+
+
+
+ country
+ Land
+
+
+ false
+ String2
+
+ MIC_CUST_AVPARTNER
+ Avpld
+ MIC_CUST_PARTNER
+ Parld
+
+
+
+
+
+
+
+
+
+ Name des Ansprechpartners
+
+
+ false
+ String..70
+
+ MIC_CUST_AVPARTNER
+ Avpsachname
+ MIC_CUST_PARTNER
+ Parsachname
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Email Adresse des Ansprechpartners
+
+
+ false
+ String..256
+
+ MIC_CUST_AVPARTNER
+ Avpsachmail
+ MIC_CUST_PARTNER
+ Parsachmail
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Telefonnr. des Ansprechpartners
+
+
+ false
+ String..70
+
+ MIC_CUST_AVPARTNER
+ Avptelnr
+ MIC_CUST_PARTNER
+ Partelnr
+
+
+
+
@@ -2049,6 +2513,187 @@ Hierzu die Tags <street>, <zip>, <loc> und <addit> befü
+
+
+
+ Type of goods location
+ Typ des Warenorts
+
+
+ false
+ String1
+
+ MIC_AAVSDG
+ Aaslocationtype
+ MIC_AUSSDG
+ Afslocationtype
+
+
+
+
+
+
+
+ Goods location customs office
+ Warenort Zollstelle
+
+
+ false
+ String1..8
+
+ MIC_AAVSDG
+ Aaslocationcustomsoffice
+ MIC_AUSSDG
+ Afslocationcustomsoffice
+
+
+
+
+
+
+
+ Goods location country
+ Warenort Land
+
+
+ false
+ String1..8
+
+ MIC_AAVSDG
+ Aaslocationcountry
+ MIC_AUSSDG
+ Afslocationcountry
+
+
+
+
+
+
+
+
+
+ GNSS
+
+
+
+
+
+ Latitude
+ Breite
+
+
+ true
+ String1..17
+
+ MIC_CUST_AVPARTNER
+ avplatitude
+ MIC_CUST_PARTNER
+ parlatitude
+
+
+
+
+
+
+
+
+
+
+
+
+ Longitude
+ Länge
+
+
+ true
+ String1..17
+
+ MIC_CUST_AVPARTNER
+ avplongitude
+ MIC_CUST_PARTNER
+ parlongitude
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type
+ Art
+
+ Art der in Anspruch genommenen Bewilligung
+ true
+ String4
+
+ MIC_CUST_WB_EU_AUTH_HOLDER
+ wbatypecd
+ MIC_CUST_EU_AUTH_HOLDER
+ auhtypecd
+
+
+
+
+
+
+
+
+
+
+
+
+ Reference Number
+ Referenznummer
+
+
+ false
+ String35
+
+ MIC_CUST_WB_EU_AUTH_HOLDER
+ wbareferencenumber
+ MIC_CUST_EU_AUTH_HOLDER
+ auhreferencenumber
+
+
+
+
+
+
+
+
+
+
+
+
+ Authorisation holder Id
+ Bewilligungsinhaber Id
+
+
+ false
+ String35
+
+ MIC_CUST_WB_EU_AUTH_HOLDER
+ wbaid
+ MIC_CUST_EU_AUTH_HOLDER
+ auhid
+
+
+
+
+
+
+
+
+
@@ -2085,7 +2730,7 @@ Hierzu die Tags <street>, <zip>, <loc> und <addit> befü
false
- String..35
+ String..70
MIC_CUST_AVPARTNER
Avpsachname
@@ -2259,6 +2904,29 @@ ZL.... Beendigungsanteile für ZL
+
+
+
+ Authorisation Type
+ Bewilligungsart
+
+
+ true
+ String1..4
+
+ MIC_CUST_AVBEENDIGUNG
+ mcbbewilltype
+ MIC_CUST_BEENDIGUNG
+ ecbbewilltype
+
+
+
+
+
+
+
+
+
@@ -2282,6 +2950,29 @@ ZL.... Beendigungsanteile für ZL
+
+
+
+ MRN
+ MRN
+
+
+ false
+ String1..18
+
+ MIC_CUST_AVBEENDIGUNG
+ mcbmrn
+ MIC_CUST_BEENDIGUNG
+ ecbmrn
+
+
+
+
+
+
+
+
+
@@ -2336,7 +3027,7 @@ ZL.... Beendigungsanteile für ZL
Registrationnumber of the inward movement (BHW or IPR)
Registriernummer des Zugangs zum Quellverfahren ZL
true
- String1..35
+ String1..70
MIC_CUST_AVBEENDIGUNG
Mcbregnr
@@ -2564,6 +3255,52 @@ String1.350
+
+
+
+ Simply Granted Authorisation
+ Vereinfacht erteilte Bewilligung
+
+
+ false
+ String1
+
+ MIC_CUST_AVBEENDIGUNG
+ mcbsimpleiprapplication
+ MIC_CUST_BEENDIGUNG
+ ecbsimpleiprapplication
+
+
+
+
+
+
+
+
+
+
+
+
+ Customs Office of Supervision
+ Referenznummer der Überwachungszollstelle
+
+
+ false
+ String1..8
+
+ MIC_CUST_AVBEENDIGUNG
+ mcbsupervisingoffice
+ MIC_CUST_BEENDIGUNG
+ ecbsupervisingoffice
+
+
+
+
+
+
+
+
+
@@ -2792,6 +3529,79 @@ String1.350
+
+
+
+
+
+ Previous document type
+ Vorpapiertyp
+ If a previous document is used, the type of the previous document must be entered here.
+ Wird ein Vorpapier verwendet, muss der Typ des Vorpapiers hier eingetragen werden
+ true
+ String1..4
+
+ MIC_CUST_WB_EXPPREVDOCSHIP
+ WPSTYPE
+ MICCUSTEXPDOC
+ EPCTYP
+
+
+
+
+
+
+
+
+
+
+
+
+ Previous document qualifier
+ Vorpapier Qualifikator
+
+
+ false
+ String1..3
+
+ MIC_CUST_WB_EXPPREVDOCSHIP
+ WPSQUALIFIER
+ MICCUSTEXPDOC
+ EPCQUALIFIER
+
+
+
+
+
+
+
+
+
+
+
+
+ Previous document number
+ Vorparpiernummer
+ If a previous document is used, the number of the previous document must be entered here.
+ Wenn ein Vorpapier vorliegt, muss die Vorpapiernummer hier eingetragen werden.
+ true
+ String1..70
+
+ MIC_CUST_WB_EXPPREVDOCSHIP
+ WPSREFERENCENO
+ MICCUSTEXPDOC
+ EPCREFERENZ
+
+
+
+
+
+
+
+
+
+
+
order for arrival
@@ -3716,6 +4526,5 @@ String1.350
-
-
+
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.Designer.vb
new file mode 100644
index 00000000..8330bd2d
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.Designer.vb
@@ -0,0 +1,22 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicCustExportInvoiceTypes","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicCustExportInvoiceTypes
+End Namespace
+#Enable Warning
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.xsd
similarity index 77%
rename from VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.xsd
rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.xsd
index 13149199..643d99d9 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.xsd
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.xsd
@@ -21,6 +21,29 @@
+
+
+
+ An unique version id.
+ Versionsnummer
+
+
+ false
+ String1..50
+
+ MIC_ALL_AAVKOP
+ AAKVERSION
+ MIC_AUSKOP
+ AFKLOCKVERSION
+
+
+
+
+
+
+
+
+
@@ -93,6 +116,22 @@
+
+
+
+ Exchange Rate
+ Wechselkurs
+
+
+ false
+ Number(16,9)
+
+ MIC_AUSKOP
+ afkkurs
+
+
+
+
@@ -276,7 +315,7 @@ Referenz: EH-Pap. Feld 8
false
- String1..17
+ String1..30
MIC_ALL_AAVKOP
Aakeusertin
@@ -287,7 +326,7 @@ Referenz: EH-Pap. Feld 8
-
+
@@ -414,8 +453,6 @@ else
MIC_ALL_AAVKOP
Aakrefi
- MIC_AUSKOP
- Afkrefi
@@ -546,7 +583,7 @@ else
addText1 wird in AAKINFO gemappt, der Rest wird in AAKTEXT1..4 geladen.
false
- String0..80
+ String0..400
0..5
MIC_ALL_AAVKOP
Aakinfo, Aaktext1..4
@@ -636,6 +673,33 @@ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzl
+
+
+
+
+ Package Description
+ Packstückbezeichnung
+
+
+ false
+ VARCHAR2(30)
+
+ MIC_AAVKOP
+ AAKKOLBEZ
+ MIC_AUSKOP
+ AFKKOLBEZ
+
+
+
+
+
+
+
+
+
+
+
+
@@ -660,6 +724,88 @@ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzl
+
+
+
+ Invoice Reference Number
+ Referenz Rechnungsnummer
+
+
+ false
+ VARCHAR2(30)
+
+ MIC_AAVKOP
+ AAKFAKTREF
+ MIC_AUSKOP
+ AFKFAKTREF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NCTS Indicator
+ NCTS Indikator
+
+
+ false
+ xs:boolean
+
+ MIC_AAVKOP
+ AAKNCTSINDICATOR
+ MIC_AUSKOP
+ AFKNCTSINDICATOR
+
+
+
+
+
+
+
+ Type of Delivery
+ Versandart
+ false
+ xs:string
+ MIC_ALL_AAVKOP
+ AAKVSART
+ MIC_AUSSDG
+ AFSVSART
+
+
+
+
+
+
+
+
+
+
+
+ Crossing Border Date
+ Grenz\u00FCbertritt
+
+
+ false
+ xs:date
+
+ MIC_ALL_AAVKOP
+ AAKGRDAT
+ MIC_AUSKOP
+ AFKGRDAT
+
+
+
+
@@ -678,6 +824,65 @@ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzl
+
+
+
+ Partners
+ Beteiligte
+
+
+ true
+
+ 0..∞
+
+
+
+
+
+
+
+
+
+
+
+ Attributes Invoice
+ Rechnungsattribute
+
+
+ false
+
+ 0..∞
+
+
+
+
+
+
+
+
+
+
+
+ Nature of Transaction
+ Geschäftsart
+
+
+ false
+
+ 0..1
+ MIC_AAVKOP
+ aakgsart
+ MIC_AUSKOP
+ afkgsart
+
+
+
+
+
+
+
+
+
@@ -750,7 +955,7 @@ Keine Lücken erlaubt
-
+
Net mass
@@ -759,7 +964,7 @@ Ref: EH-Pap Feld 38
Net mass of the invoice line in [kg]
Eigenmasse der Position in [kg]
false
- Number(13,4)
+ Number(15,6)
MIC_ALL_AAVPOS
Aapeigmas
@@ -777,8 +982,8 @@ Ref: EH-Pap Feld 38
Ref: EH-Pap Feld 35
Gross mass of the invoice line in [kg]
Sofern das Datenfeld "Art der Anmeldung (Überführung)" mit einem der Werte "a", "b", "c", "d", "e", "f", "g" oder "i" angegeben wird, gilt:
-⏺ Die Angabe des Datenfeldes ist erforderlich, wenn das Datenfeld "Besondere Umstände" nicht oder mit einem anderen Wert als "E" angegeben wird.
-⏺ Die Angabe des Datenfeldes ist erforderlich, wenn nicht sowohl der Ausführer als ggf. auch seine indirekten und direkten Vertreter als zugelassene Wirtschaftsbeteiligte für den Bereich Sicherheit zertifiziert sind.
+- Die Angabe des Datenfeldes ist erforderlich, wenn das Datenfeld "Besondere Umstände" nicht oder mit einem anderen Wert als "E" angegeben wird.
+- Die Angabe des Datenfeldes ist erforderlich, wenn nicht sowohl der Ausführer als ggf. auch seine indirekten und direkten Vertreter als zugelassene Wirtschaftsbeteiligte für den Bereich Sicherheit zertifiziert sind.
false
Number(13,4)
@@ -791,7 +996,7 @@ Ref: EH-Pap Feld 35
-
+
statistical quantity
@@ -825,7 +1030,7 @@ ALTERNATIV können diese Daten auch in MIC-CUST errechnet werden. Voraussetzung
Enthält im EZT zur angegebenen Warennummer das Feld "Maßeinheit" einen der Werte "NAR", "NCL" oder "NPR", dann ist die Angabe von Nachkommastellen unzulässig
false
- Number(13,4)
+ Number(15,5)
MIC_ALL_AAVPOS
Aapbesm
@@ -1000,6 +1205,29 @@ Ref: EH-Pap Feld 24
+
+
+
+
+ Export Country
+ Ausfuhrland
+
+
+ false
+ String1..2
+
+ MIC_ALL_AAVPOS
+ aapexportcountry
+ MIC_AUSPOS
+ afpexportcountry
+
+
+
+
+
+
+
+
@@ -1094,7 +1322,7 @@ Gültige Werte: A1270
AddText1 will be mapped in Aapinfo, the rest will be mapped in Aaptext1..4
AddText1 wird in Aaoinfo geladen, die restlichen 4 in AapText1..4
false
- String0..80
+ String0..400
0..5
MIC_ALL_AAVPOS
Aapinfo(1), AapText1..4
@@ -1145,6 +1373,96 @@ Gültige Werte: A1270
+
+
+
+ TARIC Additional Code
+ TARIC-Zusatzcode
+
+
+ false
+
+ 0..99
+
+
+
+
+
+
+
+
+
+
+
+
+ Additional Code
+ Zusatzcode
+
+
+ true
+ Number(4)
+
+ MIC_CUST_TARIC_ADD_CODE_WB
+ tcwadditionalcode
+ MIC_CUST_TARIC_ADD_CODE
+ tacadditionalcode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dangerous Goods
+ Gefahrgut
+
+
+ false
+
+ 0..99
+
+
+
+
+
+
+
+
+
+
+
+
+ UN Number
+ UN-Gefahrgutnummer
+
+
+ true
+ String(4)
+
+ MIC_CUST_DANGEROUS_GOOD_WB
+ dgwunnumber
+ MIC_CUST_DANGEROUS_GOOD
+ dagunnumber
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1295,6 +1613,62 @@ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzl
+
+
+
+ Special Quantity
+ Spzial-Menge
+
+
+ false
+ Number(13,3)
+
+ MIC_ALL_AAVPOS
+ AAPSUPQUANT
+ MIC_AUSPOS
+ AFPSUPQUANT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Special Unit of measurement
+ Spezial-Mengeneinheit
+
+
+ false
+ String1..4
+
+ MIC_ALL_AAVPOS
+ AAPSUPUNIT
+ MIC_AUSPOS
+ AFPSUPUNIT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1835,7 +2209,7 @@ Referenz: EH-Pap. Feld 8
false
- String1..17
+ String1..30
MIC_ALL_AAVPOS
Aapemptin
@@ -2122,7 +2496,7 @@ else
false
- String1..17
+ String1..30
MIC_ALL_AAVPOS
Aapeusertin
@@ -2133,7 +2507,7 @@ else
-
+
@@ -2496,6 +2870,182 @@ else
+
+
+
+ Passive Veredelung
+ Outward Processing
+
+
+ false
+
+ 0..1
+
+
+
+
+
+
+
+
+
+
+
+
+ Replacement
+ Standardaustausch/Ersatzwarenverkehr
+
+
+ true
+ String1
+
+ MIC_ALL_AAVPOS
+ aapreplacement
+ MIC_AUSPOS
+ afpreplacement
+
+
+
+
+
+
+
+
+
+
+
+
+ Reimport Date
+ Datum der Wiedereinfuhr
+
+
+ true
+ Xs:date
+
+ MIC_ALL_AAVPOS
+ aapreimportdate
+ MIC_AUSPOS
+ afpreimportdate
+
+
+
+
+
+
+
+
+
+
+ Partners
+ Beteiligte
+
+
+ true
+
+ 0..∞
+
+
+
+
+
+
+
+
+
+
+
+ Authorisation holders
+ Bewillingungsinhaber
+
+
+ false
+
+ 0..9
+
+
+
+
+
+
+
+
+
+
+
+ EUDR
+ false
+ 0..1
+
+
+
+
+
+
+
+ EUDR Supplier Number
+ EUDR Lieferant
+ false
+ String1..30
+ mic_aavpos
+ aapeudrnr
+ mic_auspos
+ afpeudrnr
+
+
+
+
+
+
+ EUDR Country
+ EUDR Land
+ false
+ String1..3
+ mic_aavpos
+ aapeudrctryofprod
+ mic_auspos
+ afpeudrctryofprod
+
+
+
+
+
+
+
+
+
+ Duties - calculated by external systems (e.g. SAP GTM)
+ Abgaben - berechnet durch externe Systeme
+
+
+ false
+
+ 0-n
+ MIC_CUST_WB_EXPORT_EXTERNAL_DUTY
+
+ MIC_CUST_EXPORT_EXTERNAL_DUTY
+
+
+
+
+
+
+
+
+ Duties - calculated by MIC and customs
+ Abgaben - berechnet durch MIC und Zoll
+
+
+ false
+
+ 0-n
+ MIC_CUST_WB_EXPORT_DUTY
+
+ MIC_AUSSDGABG
+
+
+
+
+
@@ -2511,7 +3061,7 @@ else
Condition C1: Value required/allowed if required by Atlas Codelist I0134 (Column Referenz = R)
Bedingung C1: Die Angabe des Datenfeldes ist erforderlich und nur zulässig, wenn die Atlas Codeliste I0134 zu dem Unterlagentyp eine Referenz verlangt. (Spalte Referenz)
false
- String1..35
+ String1..70
MIC_EINSDGDOC
Esdnr
@@ -2522,7 +3072,7 @@ else
-
+
@@ -2746,6 +3296,29 @@ Warenwert, der auf der Ausfuhrgenehmigung bzw. Ausfuhrlizenz abgeschrieben werde
+
+
+
+ Unit of measurement incl. qualifier
+ Maßeinheit inkl. Qualifikator
+
+
+ false
+ String1..4
+
+ MIC_EINSDGDOC
+ esdmeasurementunitqualifier
+ MIC_EINSDGDOC
+ esdmeasurementunitqualifier
+
+
+
+
+
+
+
+
+
@@ -2780,7 +3353,7 @@ Warenwert, der auf der Ausfuhrgenehmigung bzw. Ausfuhrlizenz abgeschrieben werde
Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit einem der Werte "Los", "Mio", "Paar", "Satz", "St" oder "Syst" angegeben wird.
false
- Number(12,3)
+ Number(16,7)
MIC_EINSDGDOC
Esdabmenge
@@ -2791,8 +3364,8 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
-
-
+
+
@@ -2804,7 +3377,7 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
false
- String1..15
+ String1..70
MIC_EINSDGDOC
Esdausstellernr
@@ -2815,7 +3388,27 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
-
+
+
+
+
+
+
+
+
+ Supplier Name
+ Ausstellernummer name
+ false
+ String1..70
+ MIC_EINSDGDOC
+ ESDAUSSTELLERBEH
+ MIC_EINSDGDOC
+ ESDAUSSTELLERBEH
+
+
+
+
+
@@ -2844,6 +3437,81 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
+
+
+
+
+
+
+
+ false
+ String1..3
+
+ MIC_EINSDGDOC
+ esdwae
+ MIC_EINSDGDOC
+ esdwae
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Document line item number
+ Zeilen-/Positionsnummer im Dokument
+ Verweis auf einen nummerierten Eintrag in der vorlegbaren Unterlage
+
+ false
+ Number(5)
+
+ MIC_EINSDGDOC
+ ESDDOCLINEITEMNO
+ MIC_EINSDGDOC
+ ESDDOCLINEITEMNO
+
+
+
+
+
+
+
+
+
+
+
+
+ Max Quantity
+
+
+
+ false
+ Number(13,3)
+
+ MIC_EINSDGDOC
+ Esdmaxmenge
+ MIC_EINSDGDOC
+ Esdmaxmenge
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2874,6 +3542,29 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
+
+
+
+ Previous document qualifier
+ Vorpapier Qualifikator
+
+
+ false
+ String0..3
+
+ MIC_ALL_AAVEXPDOC
+ ACPQUALIFIER
+ MICCUSTEXPDOC
+ EPCQUALIFIER
+
+
+
+
+
+
+
+
+
@@ -2882,7 +3573,7 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
If a previous document is used, the number of the previous document must be entered here.
Wenn ein Vorpapier vorliegt, muss die Vorpapiernummer hier eingetragen werden.
true
- String0..35
+ String0..70
MIC_ALL_AAVEXPDOC
ACPREFERENZ
@@ -2893,7 +3584,7 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
-
+
@@ -2905,7 +3596,7 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
If a previous document is used, additional information can be entered here.
Wenn ein Vorpapier vorliegt, können hier zusätzliche Angaben gemacht werden.
false
- String0..26
+ String0..35
MIC_ALL_AAVEXPDOC
ACPZUSATZ
@@ -2916,7 +3607,7 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
-
+
@@ -2943,6 +3634,116 @@ Es sind nur ganzzahlige Werte erlaubt, wenn das Datenfeld "Maßeinheit" mit eine
+
+
+
+ Item Number
+ Positionsnummer
+
+
+ false
+ Number(5)
+
+ MIC_ALL_AAVEXPDOC
+ acpgoodsitemnumber
+ MICCUSTEXPDOC
+ epcgoodsitemnumber
+
+
+
+
+
+
+
+
+
+
+
+
+ Measurement Unit
+ Maßeinheit
+
+
+ false
+ String0..4
+
+ MIC_ALL_AAVEXPDOC
+ acpmeasurementunit
+ MICCUSTEXPDOC
+ epcmeasurementunit
+
+
+
+
+
+
+
+
+
+
+
+
+ Quantity
+ Menge
+
+
+ false
+ Number(16,6)
+
+ MIC_ALL_AAVEXPDOC
+ acpquantity
+ MICCUSTEXPDOC
+ epcquantity
+
+
+
+
+
+
+
+ Number of Package
+ Anzahl der Pakete
+ EUCDM 12 01 004 000 - Number of packages on invoice line level (optional)
+ EUCDM 12 01 004 000 - Anzahl der Pakete auf Rechnungspositionsebene (optional)
+ false
+ Number(8)
+
+ MIC_ALL_AAVEXPDOC
+ ACPNUMBEROFPACKAGE
+ MICCUSTEXPDOC
+ EPCNUMBEROFPACKAGE
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of packages
+ Art der Packstücke
+ EUCDM 12 01 003 000 - Type of packages on invoice line level (optional)
+ EUCDM 12 01 003 000 - Art der Packstücke auf Rechnungspositionsebene (optional)
+ false
+ String(20)
+
+ MIC_ALL_AAVEXPDOC
+ ACPPACKAGETYPE
+ MICCUSTEXPDOC
+ EPCPACKAGETYPE
+
+
+
+
+
+
+
+
+
@@ -3100,6 +3901,51 @@ Ref: EH-Pap Feld D
+
+
+
+ Goods Reference
+ Warenpositionsverweis
+
+
+ false
+
+ 0..999
+
+
+
+
+
+
+
+
+
+
+
+
+ Declaration Goods Item Number
+ Positionsnummer
+
+
+ true
+ Number(4)
+
+ MIC_CUST_GOODSREFERENCE_WB
+ grwitemnumber
+ MIC_CUST_GOODSREFERENCE
+ goritemnumber
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3421,7 +4267,7 @@ Achtung Aufbau der Packstückangaben am AES Ausfuhrbegleitdokument (ABD) ist vö
true
- String1..35
+ String1..512
MIC_ALL_AAVKOLLI
AALPCKNR and AALVENUM (if packageNoExt = Null)
@@ -3432,7 +4278,7 @@ Achtung Aufbau der Packstückangaben am AES Ausfuhrbegleitdokument (ABD) ist vö
-
+
@@ -3730,6 +4576,29 @@ Ref: EH-Pap Feld 31
+
+
+
+ package description
+ Packstückbeschreibung
+
+
+ false
+ String 1..40
+
+ MIC_ALL_AAVKOLLI
+ AALINHALT
+ MIC_AUSKOLLI
+ Akoinhalt
+
+
+
+
+
+
+
+
+
@@ -3755,6 +4624,29 @@ Ref: EH-Pap Feld 31
+
+
+
+ An unique version id.
+
+
+
+ false
+ String1..50
+
+ MIC_ALL_AAVKOP
+ AAKVERSION
+
+
+
+
+
+
+
+
+
+
+
@@ -3815,7 +4707,7 @@ Ref: EH-Pap Feld 31
-
+
net weight
@@ -3823,7 +4715,7 @@ Ref: EH-Pap Feld 31
false
- Number(13,4)
+ Number(11,4)
MIC_ALL_AAVINHALT
Aaintgew
@@ -3904,4 +4796,271 @@ Ref: EH-Pap Feld 31
+
+
+ Additional Information
+
+
+
+
+
+ Code
+ Code
+
+
+ true
+ String1..5
+
+ MIC_CUST_AFFAIRS_STATE_WB
+ cawaffairsstate
+ MIC_CUST_AFFAIRS_STATE
+ casaffairsstate
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Text
+ Text
+
+
+ true
+ String1..512
+
+ MIC_CUST_AFFAIRS_STATE_WB
+ cawtext
+ MIC_CUST_AFFAIRS_STATE
+ castext
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.Designer.vb
new file mode 100644
index 00000000..0b480e8d
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.Designer.vb
@@ -0,0 +1,16692 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicCustExportShipment","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicCustExportShipment
+
+
+ Partial Public Class ExportShipment
+
+#Region "Private fields"
+ Private _shipmentHead As TShipmentHead
+
+ Private _invoices As List(Of TInvoice)
+
+ Private _packages As List(Of TPackage)
+
+ Private _schemaVersion As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._packages = New List(Of TPackage)()
+ Me._invoices = New List(Of TInvoice)()
+ Me._shipmentHead = New TShipmentHead()
+ End Sub
+
+ Public Property ShipmentHead() As TShipmentHead
+ Get
+ Return Me._shipmentHead
+ End Get
+ Set
+ Me._shipmentHead = Value
+ End Set
+ End Property
+
+
+ Public Property Invoices() As List(Of TInvoice)
+ Get
+ Return Me._invoices
+ End Get
+ Set
+ Me._invoices = Value
+ End Set
+ End Property
+
+
+ Public Property Packages() As List(Of TPackage)
+ Get
+ Return Me._packages
+ End Get
+ Set
+ Me._packages = Value
+ End Set
+ End Property
+
+
+ Public Property schemaVersion() As Decimal
+ 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(ExportShipment))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize ExportShipment 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()
+ 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 ExportShipment object
+ '''
+ ''' string to deserialize
+ ''' Output ExportShipment 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 ExportShipment, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, ExportShipment)
+ 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 ExportShipment) 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 ExportShipment
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ExportShipment)
+ 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 ExportShipment
+ Return CType(SerializerXml.Deserialize(s), ExportShipment)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current ExportShipment 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 ExportShipment object
+ '''
+ ''' File to load and deserialize
+ ''' Output ExportShipment 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 ExportShipment, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, ExportShipment)
+ 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 ExportShipment) 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 ExportShipment
+ 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 TShipmentHead
+
+#Region "Private fields"
+ Private _company As String
+
+ Private _plant As String
+
+ Private _shipmentId As String
+
+ Private _shipmentVersion As String
+
+ Private _shipmentIdPart As String
+
+ Private _shipmentType As String
+
+ Private _mrn As String
+
+ Private _deliveryDate As Date
+
+ Private _cod As String
+
+ Private _exportCountry As String
+
+ Private _contCode As ContainerCode
+
+ Private _gWeight As Decimal
+
+ Private _dateStartPack As Date
+
+ Private _dateEndPack As Date
+
+ Private _partyConst As String
+
+ Private _security As String
+
+ Private _consigneeEndUserFlag As String
+
+ Private _endUserInEam As TShipmentHeadEndUserInEam
+
+ Private _estimatedArrivalDate As Date
+
+ Private _nctsIndicator As Boolean
+
+ Private _motInl As TMotInl
+
+ Private _text As List(Of String)
+
+ Private _partners As List(Of TPartner)
+
+ Private _locGoods As TLocationOfGoods
+
+ Private _officeDepart As TCustomsOffice
+
+ Private _officeBorder As TCustomsOffice
+
+ Private _officeSupervising As TCustomsOffice
+
+ Private _motBorder As TMot
+
+ Private _seals As List(Of TSeal)
+
+ Private _declType As TDeclType
+
+ Private _placeDest As String
+
+ Private _authLocation As String
+
+ Private _declPlace As String
+
+ Private _agreedLocationOfGoodsCd As String
+
+ Private _agreedLocationOfGoods As String
+
+ Private _custSubPlace As String
+
+ Private _codFirst As String
+
+ Private _broker As String
+
+ Private _waybillNumber As String
+
+ Private _waybillDate As Date
+
+ Private _houseWaybillNumber As String
+
+ Private _houseWaybillDate As Date
+
+ Private _officeDest As TCustomsOffice
+
+ Private _carrier As String
+
+ Private _containers As List(Of TContainer)
+
+ Private _freightCost As TFreight
+
+ Private _addCosts As List(Of TAddCosts)
+
+ Private _assurCost As TAssurance
+
+ Private _groupID As String
+
+ Private _documents As List(Of TDocuments)
+
+ Private _regNoExt As String
+
+ Private _customerFields As TCustomerFields
+
+ Private _attributes As List(Of TAttribute)
+
+ Private _coe As String
+
+ Private _specCircum As String
+
+ Private _carriageCosts As String
+
+ Private _shipmentIdentification As String
+
+ Private _conveyRefNr As String
+
+ Private _unloadingPlace As String
+
+ Private _route As List(Of TRoute)
+
+ Private _express As String
+
+ Private _routeName As String
+
+ Private _authorisationNo As String
+
+ Private _authorisation As TShipmentHeadAuthorisation
+
+ Private _postExportDeclaration As TShipmentHeadPostExportDeclaration
+
+ Private _oprData As TShipmentHeadOprData
+
+ Private _additionalInformation As List(Of TAttribute)
+
+ Private _stateOfAffairs As List(Of TStateOfAffairs)
+
+ Private _erpData As TErpShipmentData
+
+ Private _authorisations As List(Of TAuthorisation)
+
+ Private _prevDoc As List(Of TShipmentPreviousDocument)
+
+ Private _departureTransportMeans As List(Of TShipmentHeadDepartureTransportMeans)
+
+ Private _officePresentation As TCustomsOffice
+
+ Private _deliveryType As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._officePresentation = New TCustomsOffice()
+ Me._departureTransportMeans = New List(Of TShipmentHeadDepartureTransportMeans)()
+ Me._prevDoc = New List(Of TShipmentPreviousDocument)()
+ Me._authorisations = New List(Of TAuthorisation)()
+ Me._erpData = New TErpShipmentData()
+ Me._stateOfAffairs = New List(Of TStateOfAffairs)()
+ Me._additionalInformation = New List(Of TAttribute)()
+ Me._oprData = New TShipmentHeadOprData()
+ Me._postExportDeclaration = New TShipmentHeadPostExportDeclaration()
+ Me._authorisation = New TShipmentHeadAuthorisation()
+ Me._route = New List(Of TRoute)()
+ Me._attributes = New List(Of TAttribute)()
+ Me._customerFields = New TCustomerFields()
+ Me._documents = New List(Of TDocuments)()
+ Me._assurCost = New TAssurance()
+ Me._addCosts = New List(Of TAddCosts)()
+ Me._freightCost = New TFreight()
+ Me._containers = New List(Of TContainer)()
+ Me._officeDest = New TCustomsOffice()
+ Me._declType = New TDeclType()
+ Me._seals = New List(Of TSeal)()
+ Me._motBorder = New TMot()
+ Me._officeSupervising = New TCustomsOffice()
+ Me._officeBorder = New TCustomsOffice()
+ Me._officeDepart = New TCustomsOffice()
+ Me._locGoods = New TLocationOfGoods()
+ Me._partners = New List(Of TPartner)()
+ Me._text = New List(Of String)()
+ Me._motInl = New TMotInl()
+ Me._shipmentVersion = "1"
+ End Sub
+
+ Public Property company() As String
+ Get
+ Return Me._company
+ End Get
+ Set
+ Me._company = Value
+ End Set
+ End Property
+
+ Public Property plant() As String
+ Get
+ Return Me._plant
+ End Get
+ Set
+ Me._plant = Value
+ End Set
+ End Property
+
+ Public Property shipmentId() As String
+ Get
+ Return Me._shipmentId
+ End Get
+ Set
+ Me._shipmentId = Value
+ End Set
+ End Property
+
+
+ Public Property shipmentVersion() As String
+ Get
+ Return Me._shipmentVersion
+ End Get
+ Set
+ Me._shipmentVersion = Value
+ End Set
+ End Property
+
+ Public Property shipmentIdPart() As String
+ Get
+ Return Me._shipmentIdPart
+ End Get
+ Set
+ Me._shipmentIdPart = Value
+ End Set
+ End Property
+
+ Public Property shipmentType() As String
+ Get
+ Return Me._shipmentType
+ End Get
+ Set
+ Me._shipmentType = Value
+ End Set
+ End Property
+
+ Public Property mrn() As String
+ Get
+ Return Me._mrn
+ End Get
+ Set
+ Me._mrn = Value
+ End Set
+ End Property
+
+ Public Property deliveryDate() As Date
+ Get
+ Return Me._deliveryDate
+ End Get
+ Set
+ Me._deliveryDate = Value
+ End Set
+ End Property
+
+ Public Property cod() As String
+ Get
+ Return Me._cod
+ End Get
+ Set
+ Me._cod = Value
+ End Set
+ End Property
+
+ Public Property exportCountry() As String
+ Get
+ Return Me._exportCountry
+ End Get
+ Set
+ Me._exportCountry = Value
+ End Set
+ End Property
+
+ Public Property contCode() As ContainerCode
+ Get
+ Return Me._contCode
+ End Get
+ Set
+ Me._contCode = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property dateStartPack() As Date
+ Get
+ Return Me._dateStartPack
+ End Get
+ Set
+ Me._dateStartPack = Value
+ End Set
+ End Property
+
+ Public Property dateEndPack() As Date
+ Get
+ Return Me._dateEndPack
+ End Get
+ Set
+ Me._dateEndPack = Value
+ End Set
+ End Property
+
+ Public Property partyConst() As String
+ Get
+ Return Me._partyConst
+ End Get
+ Set
+ Me._partyConst = Value
+ End Set
+ End Property
+
+ Public Property security() As String
+ Get
+ Return Me._security
+ End Get
+ Set
+ Me._security = Value
+ End Set
+ End Property
+
+ Public Property consigneeEndUserFlag() As String
+ Get
+ Return Me._consigneeEndUserFlag
+ End Get
+ Set
+ Me._consigneeEndUserFlag = Value
+ End Set
+ End Property
+
+ Public Property endUserInEam() As TShipmentHeadEndUserInEam
+ Get
+ Return Me._endUserInEam
+ End Get
+ Set
+ Me._endUserInEam = Value
+ End Set
+ End Property
+
+ Public Property estimatedArrivalDate() As Date
+ Get
+ Return Me._estimatedArrivalDate
+ End Get
+ Set
+ Me._estimatedArrivalDate = Value
+ End Set
+ End Property
+
+ Public Property nctsIndicator() As Boolean
+ Get
+ Return Me._nctsIndicator
+ End Get
+ Set
+ Me._nctsIndicator = Value
+ End Set
+ End Property
+
+ Public Property motInl() As TMotInl
+ Get
+ Return Me._motInl
+ End Get
+ Set
+ Me._motInl = 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 partners() As List(Of TPartner)
+ Get
+ Return Me._partners
+ End Get
+ Set
+ Me._partners = Value
+ End Set
+ End Property
+
+ Public Property locGoods() As TLocationOfGoods
+ Get
+ Return Me._locGoods
+ End Get
+ Set
+ Me._locGoods = Value
+ End Set
+ End Property
+
+ Public Property officeDepart() As TCustomsOffice
+ Get
+ Return Me._officeDepart
+ End Get
+ Set
+ Me._officeDepart = Value
+ End Set
+ End Property
+
+ Public Property officeBorder() As TCustomsOffice
+ Get
+ Return Me._officeBorder
+ End Get
+ Set
+ Me._officeBorder = Value
+ End Set
+ End Property
+
+ Public Property officeSupervising() As TCustomsOffice
+ Get
+ Return Me._officeSupervising
+ End Get
+ Set
+ Me._officeSupervising = Value
+ End Set
+ End Property
+
+ Public Property motBorder() As TMot
+ Get
+ Return Me._motBorder
+ End Get
+ Set
+ Me._motBorder = Value
+ End Set
+ End Property
+
+
+ Public Property seals() As List(Of TSeal)
+ Get
+ Return Me._seals
+ End Get
+ Set
+ Me._seals = Value
+ End Set
+ End Property
+
+ Public Property declType() As TDeclType
+ Get
+ Return Me._declType
+ End Get
+ Set
+ Me._declType = Value
+ End Set
+ End Property
+
+ Public Property placeDest() As String
+ Get
+ Return Me._placeDest
+ End Get
+ Set
+ Me._placeDest = Value
+ End Set
+ End Property
+
+ Public Property authLocation() As String
+ Get
+ Return Me._authLocation
+ End Get
+ Set
+ Me._authLocation = Value
+ End Set
+ End Property
+
+ Public Property declPlace() As String
+ Get
+ Return Me._declPlace
+ End Get
+ Set
+ Me._declPlace = Value
+ End Set
+ End Property
+
+ Public Property agreedLocationOfGoodsCd() As String
+ Get
+ Return Me._agreedLocationOfGoodsCd
+ End Get
+ Set
+ Me._agreedLocationOfGoodsCd = Value
+ End Set
+ End Property
+
+ Public Property agreedLocationOfGoods() As String
+ Get
+ Return Me._agreedLocationOfGoods
+ End Get
+ Set
+ Me._agreedLocationOfGoods = Value
+ End Set
+ End Property
+
+ Public Property custSubPlace() As String
+ Get
+ Return Me._custSubPlace
+ End Get
+ Set
+ Me._custSubPlace = Value
+ End Set
+ End Property
+
+ Public Property codFirst() As String
+ Get
+ Return Me._codFirst
+ End Get
+ Set
+ Me._codFirst = Value
+ End Set
+ End Property
+
+ Public Property broker() As String
+ Get
+ Return Me._broker
+ End Get
+ Set
+ Me._broker = Value
+ End Set
+ End Property
+
+ Public Property waybillNumber() As String
+ Get
+ Return Me._waybillNumber
+ End Get
+ Set
+ Me._waybillNumber = Value
+ End Set
+ End Property
+
+
+ Public Property waybillDate() As Date
+ Get
+ Return Me._waybillDate
+ End Get
+ Set
+ Me._waybillDate = Value
+ End Set
+ End Property
+
+ Public Property houseWaybillNumber() As String
+ Get
+ Return Me._houseWaybillNumber
+ End Get
+ Set
+ Me._houseWaybillNumber = Value
+ End Set
+ End Property
+
+
+ Public Property houseWaybillDate() As Date
+ Get
+ Return Me._houseWaybillDate
+ End Get
+ Set
+ Me._houseWaybillDate = Value
+ End Set
+ End Property
+
+ Public Property officeDest() As TCustomsOffice
+ Get
+ Return Me._officeDest
+ End Get
+ Set
+ Me._officeDest = Value
+ End Set
+ End Property
+
+ Public Property carrier() As String
+ Get
+ Return Me._carrier
+ End Get
+ Set
+ Me._carrier = Value
+ End Set
+ End Property
+
+
+ Public Property containers() As List(Of TContainer)
+ Get
+ Return Me._containers
+ End Get
+ Set
+ Me._containers = Value
+ End Set
+ End Property
+
+ Public Property freightCost() As TFreight
+ Get
+ Return Me._freightCost
+ End Get
+ Set
+ Me._freightCost = Value
+ End Set
+ End Property
+
+
+ Public Property addCosts() As List(Of TAddCosts)
+ Get
+ Return Me._addCosts
+ End Get
+ Set
+ Me._addCosts = Value
+ End Set
+ End Property
+
+ Public Property assurCost() As TAssurance
+ Get
+ Return Me._assurCost
+ End Get
+ Set
+ Me._assurCost = Value
+ End Set
+ End Property
+
+ Public Property groupID() As String
+ Get
+ Return Me._groupID
+ End Get
+ Set
+ Me._groupID = Value
+ End Set
+ End Property
+
+
+ Public Property documents() As List(Of TDocuments)
+ Get
+ Return Me._documents
+ End Get
+ Set
+ Me._documents = Value
+ End Set
+ End Property
+
+ Public Property regNoExt() As String
+ Get
+ Return Me._regNoExt
+ End Get
+ Set
+ Me._regNoExt = Value
+ End Set
+ End Property
+
+ Public Property customerFields() As TCustomerFields
+ Get
+ Return Me._customerFields
+ End Get
+ Set
+ Me._customerFields = Value
+ End Set
+ End Property
+
+
+ Public Property attributes() As List(Of TAttribute)
+ Get
+ Return Me._attributes
+ End Get
+ Set
+ Me._attributes = Value
+ End Set
+ End Property
+
+ Public Property coe() As String
+ Get
+ Return Me._coe
+ End Get
+ Set
+ Me._coe = Value
+ End Set
+ End Property
+
+ Public Property specCircum() As String
+ Get
+ Return Me._specCircum
+ End Get
+ Set
+ Me._specCircum = Value
+ End Set
+ End Property
+
+ Public Property carriageCosts() As String
+ Get
+ Return Me._carriageCosts
+ End Get
+ Set
+ Me._carriageCosts = Value
+ End Set
+ End Property
+
+ Public Property shipmentIdentification() As String
+ Get
+ Return Me._shipmentIdentification
+ End Get
+ Set
+ Me._shipmentIdentification = Value
+ End Set
+ End Property
+
+ Public Property conveyRefNr() As String
+ Get
+ Return Me._conveyRefNr
+ End Get
+ Set
+ Me._conveyRefNr = Value
+ End Set
+ End Property
+
+ Public Property unloadingPlace() As String
+ Get
+ Return Me._unloadingPlace
+ End Get
+ Set
+ Me._unloadingPlace = Value
+ End Set
+ End Property
+
+
+ Public Property route() As List(Of TRoute)
+ Get
+ Return Me._route
+ End Get
+ Set
+ Me._route = Value
+ End Set
+ End Property
+
+
+ Public Property express() As String
+ Get
+ Return Me._express
+ End Get
+ Set
+ Me._express = Value
+ End Set
+ End Property
+
+ Public Property routeName() As String
+ Get
+ Return Me._routeName
+ End Get
+ Set
+ Me._routeName = Value
+ End Set
+ End Property
+
+ Public Property authorisationNo() As String
+ Get
+ Return Me._authorisationNo
+ End Get
+ Set
+ Me._authorisationNo = Value
+ End Set
+ End Property
+
+ Public Property authorisation() As TShipmentHeadAuthorisation
+ Get
+ Return Me._authorisation
+ End Get
+ Set
+ Me._authorisation = Value
+ End Set
+ End Property
+
+ Public Property postExportDeclaration() As TShipmentHeadPostExportDeclaration
+ Get
+ Return Me._postExportDeclaration
+ End Get
+ Set
+ Me._postExportDeclaration = Value
+ End Set
+ End Property
+
+ Public Property oprData() As TShipmentHeadOprData
+ Get
+ Return Me._oprData
+ End Get
+ Set
+ Me._oprData = Value
+ End Set
+ End Property
+
+
+ Public Property additionalInformation() As List(Of TAttribute)
+ Get
+ Return Me._additionalInformation
+ End Get
+ Set
+ Me._additionalInformation = Value
+ End Set
+ End Property
+
+
+ Public Property stateOfAffairs() As List(Of TStateOfAffairs)
+ Get
+ Return Me._stateOfAffairs
+ End Get
+ Set
+ Me._stateOfAffairs = Value
+ End Set
+ End Property
+
+ Public Property erpData() As TErpShipmentData
+ Get
+ Return Me._erpData
+ End Get
+ Set
+ Me._erpData = Value
+ End Set
+ End Property
+
+
+ Public Property authorisations() As List(Of TAuthorisation)
+ Get
+ Return Me._authorisations
+ End Get
+ Set
+ Me._authorisations = Value
+ End Set
+ End Property
+
+
+ Public Property prevDoc() As List(Of TShipmentPreviousDocument)
+ Get
+ Return Me._prevDoc
+ End Get
+ Set
+ Me._prevDoc = Value
+ End Set
+ End Property
+
+
+ Public Property departureTransportMeans() As List(Of TShipmentHeadDepartureTransportMeans)
+ Get
+ Return Me._departureTransportMeans
+ End Get
+ Set
+ Me._departureTransportMeans = Value
+ End Set
+ End Property
+
+ Public Property officePresentation() As TCustomsOffice
+ Get
+ Return Me._officePresentation
+ End Get
+ Set
+ Me._officePresentation = Value
+ End Set
+ End Property
+
+ Public Property deliveryType() As String
+ Get
+ Return Me._deliveryType
+ End Get
+ Set
+ Me._deliveryType = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHead))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHead 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()
+ 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 TShipmentHead object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHead 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 TShipmentHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHead)
+ 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 TShipmentHead) 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 TShipmentHead
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHead)
+ 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 TShipmentHead
+ Return CType(SerializerXml.Deserialize(s), TShipmentHead)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHead 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 TShipmentHead object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHead 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 TShipmentHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHead)
+ 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 TShipmentHead) 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 TShipmentHead
+ 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 ContainerCode
+
+
+ Item1
+
+
+ Item0
+ End Enum
+
+
+ Public Enum TShipmentHeadEndUserInEam
+
+
+ Item
+
+
+ Item0
+
+
+ Item1
+ End Enum
+
+
+ Partial Public Class TMotInl
+
+#Region "Private fields"
+ Private _mot As String
+
+ Private _nat As String
+
+ Private _type As String
+
+ Private _licNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property mot() As String
+ Get
+ Return Me._mot
+ End Get
+ Set
+ Me._mot = Value
+ End Set
+ End Property
+
+ Public Property nat() As String
+ Get
+ Return Me._nat
+ End Get
+ Set
+ Me._nat = 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 licNo() As String
+ Get
+ Return Me._licNo
+ End Get
+ Set
+ Me._licNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMotInl))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMotInl 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()
+ 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 TMotInl object
+ '''
+ ''' string to deserialize
+ ''' Output TMotInl 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 TMotInl, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMotInl)
+ 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 TMotInl) 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 TMotInl
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMotInl)
+ 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 TMotInl
+ Return CType(SerializerXml.Deserialize(s), TMotInl)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMotInl 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 TMotInl object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMotInl 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 TMotInl, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMotInl)
+ 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 TMotInl) 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 TMotInl
+ 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 TPackageLine
+
+#Region "Private fields"
+ Private _invNo As String
+
+ Private _invoiceVersion As String
+
+ Private _invPos As String
+
+ Private _quantity As Decimal
+
+ Private _unit As String
+
+ Private _nWeight As Decimal
+
+ Private _numberOfPackages As Long
+
+ Private _itemQuantity As Long
+
+ Private _itemUnit As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._invoiceVersion = "1"
+ End Sub
+
+ Public Property invNo() As String
+ Get
+ Return Me._invNo
+ End Get
+ Set
+ Me._invNo = Value
+ End Set
+ End Property
+
+
+ Public Property invoiceVersion() As String
+ Get
+ Return Me._invoiceVersion
+ End Get
+ Set
+ Me._invoiceVersion = Value
+ End Set
+ End Property
+
+
+ Public Property invPos() As String
+ Get
+ Return Me._invPos
+ End Get
+ Set
+ Me._invPos = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property numberOfPackages() As Long
+ Get
+ Return Me._numberOfPackages
+ End Get
+ Set
+ Me._numberOfPackages = Value
+ End Set
+ End Property
+
+ Public Property itemQuantity() As Long
+ Get
+ Return Me._itemQuantity
+ End Get
+ Set
+ Me._itemQuantity = Value
+ End Set
+ End Property
+
+ Public Property itemUnit() As String
+ Get
+ Return Me._itemUnit
+ End Get
+ Set
+ Me._itemUnit = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackageLine))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackageLine 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()
+ 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 TPackageLine object
+ '''
+ ''' string to deserialize
+ ''' Output TPackageLine 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 TPackageLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageLine)
+ 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 TPackageLine) 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 TPackageLine
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackageLine)
+ 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 TPackageLine
+ Return CType(SerializerXml.Deserialize(s), TPackageLine)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackageLine 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 TPackageLine object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackageLine 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 TPackageLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageLine)
+ 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 TPackageLine) 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 TPackageLine
+ 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 TPackageHead
+
+#Region "Private fields"
+ Private _packageNo As String
+
+ Private _pType As String
+
+ Private _unit As String
+
+ Private _packageNoExt As String
+
+ Private _gWeight As Decimal
+
+ Private _nWeight As Decimal
+
+ Private _tara As Decimal
+
+ Private _unitWeight As String
+
+ Private _volume As Decimal
+
+ Private _grossVolume As Decimal
+
+ Private _netVolume As Decimal
+
+ Private _unitVolume As String
+
+ Private _length As Decimal
+
+ Private _width As Decimal
+
+ Private _height As Decimal
+
+ Private _unitlwh As String
+
+ Private _description As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property packageNo() As String
+ Get
+ Return Me._packageNo
+ End Get
+ Set
+ Me._packageNo = Value
+ End Set
+ End Property
+
+ Public Property pType() As String
+ Get
+ Return Me._pType
+ End Get
+ Set
+ Me._pType = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property packageNoExt() As String
+ Get
+ Return Me._packageNoExt
+ End Get
+ Set
+ Me._packageNoExt = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property tara() As Decimal
+ Get
+ Return Me._tara
+ End Get
+ Set
+ Me._tara = Value
+ End Set
+ End Property
+
+ Public Property unitWeight() As String
+ Get
+ Return Me._unitWeight
+ End Get
+ Set
+ Me._unitWeight = Value
+ End Set
+ End Property
+
+ Public Property volume() As Decimal
+ Get
+ Return Me._volume
+ End Get
+ Set
+ Me._volume = Value
+ End Set
+ End Property
+
+ Public Property grossVolume() As Decimal
+ Get
+ Return Me._grossVolume
+ End Get
+ Set
+ Me._grossVolume = Value
+ End Set
+ End Property
+
+ Public Property netVolume() As Decimal
+ Get
+ Return Me._netVolume
+ End Get
+ Set
+ Me._netVolume = Value
+ End Set
+ End Property
+
+ Public Property unitVolume() As String
+ Get
+ Return Me._unitVolume
+ End Get
+ Set
+ Me._unitVolume = Value
+ End Set
+ End Property
+
+ Public Property length() As Decimal
+ Get
+ Return Me._length
+ End Get
+ Set
+ Me._length = Value
+ End Set
+ End Property
+
+ Public Property width() As Decimal
+ Get
+ Return Me._width
+ End Get
+ Set
+ Me._width = Value
+ End Set
+ End Property
+
+ Public Property height() As Decimal
+ Get
+ Return Me._height
+ End Get
+ Set
+ Me._height = Value
+ End Set
+ End Property
+
+ Public Property unitlwh() As String
+ Get
+ Return Me._unitlwh
+ End Get
+ Set
+ Me._unitlwh = Value
+ End Set
+ End Property
+
+ Public Property description() As String
+ Get
+ Return Me._description
+ End Get
+ Set
+ Me._description = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackageHead))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackageHead 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()
+ 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 TPackageHead object
+ '''
+ ''' string to deserialize
+ ''' Output TPackageHead 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 TPackageHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageHead)
+ 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 TPackageHead) 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 TPackageHead
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackageHead)
+ 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 TPackageHead
+ Return CType(SerializerXml.Deserialize(s), TPackageHead)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackageHead 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 TPackageHead object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackageHead 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 TPackageHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageHead)
+ 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 TPackageHead) 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 TPackageHead
+ 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 TPackage
+
+#Region "Private fields"
+ Private _packageHead As TPackageHead
+
+ Private _packageLine As List(Of TPackageLine)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._packageLine = New List(Of TPackageLine)()
+ Me._packageHead = New TPackageHead()
+ End Sub
+
+ Public Property packageHead() As TPackageHead
+ Get
+ Return Me._packageHead
+ End Get
+ Set
+ Me._packageHead = Value
+ End Set
+ End Property
+
+
+ Public Property packageLine() As List(Of TPackageLine)
+ Get
+ Return Me._packageLine
+ End Get
+ Set
+ Me._packageLine = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackage))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackage 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()
+ 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 TPackage object
+ '''
+ ''' string to deserialize
+ ''' Output TPackage 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 TPackage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackage)
+ 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 TPackage) 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 TPackage
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackage)
+ 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 TPackage
+ Return CType(SerializerXml.Deserialize(s), TPackage)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackage 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 TPackage object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackage 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 TPackage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackage)
+ 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 TPackage) 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 TPackage
+ 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 TMicDutyTax
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _calculationBase As Decimal
+
+ Private _calculationBaseUom As String
+
+ Private _code As String
+
+ Private _rate As Decimal
+
+ Private _dutyAmount As Decimal
+
+ Private _additionalCosts As Decimal
+
+ Private _calculatedDuties As Decimal
+
+ Private _paymentCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property calculationBase() As Decimal
+ Get
+ Return Me._calculationBase
+ End Get
+ Set
+ Me._calculationBase = Value
+ End Set
+ End Property
+
+ Public Property calculationBaseUom() As String
+ Get
+ Return Me._calculationBaseUom
+ End Get
+ Set
+ Me._calculationBaseUom = Value
+ End Set
+ End Property
+
+ Public Property code() As String
+ Get
+ Return Me._code
+ End Get
+ Set
+ Me._code = Value
+ End Set
+ End Property
+
+ Public Property rate() As Decimal
+ Get
+ Return Me._rate
+ End Get
+ Set
+ Me._rate = Value
+ End Set
+ End Property
+
+ Public Property dutyAmount() As Decimal
+ Get
+ Return Me._dutyAmount
+ End Get
+ Set
+ Me._dutyAmount = Value
+ End Set
+ End Property
+
+ Public Property additionalCosts() As Decimal
+ Get
+ Return Me._additionalCosts
+ End Get
+ Set
+ Me._additionalCosts = Value
+ End Set
+ End Property
+
+ Public Property calculatedDuties() As Decimal
+ Get
+ Return Me._calculatedDuties
+ End Get
+ Set
+ Me._calculatedDuties = Value
+ End Set
+ End Property
+
+ Public Property paymentCode() As String
+ Get
+ Return Me._paymentCode
+ End Get
+ Set
+ Me._paymentCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTax))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDutyTax 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()
+ 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 TMicDutyTax object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTax)
+ 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 TMicDutyTax) 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 TMicDutyTax
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTax)
+ 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 TMicDutyTax
+ Return CType(SerializerXml.Deserialize(s), TMicDutyTax)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDutyTax 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 TMicDutyTax object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTax)
+ 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 TMicDutyTax) 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 TMicDutyTax
+ 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 TMicDutyTaxes
+
+#Region "Private fields"
+ Private _dutyTax As List(Of TMicDutyTax)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._dutyTax = New List(Of TMicDutyTax)()
+ End Sub
+
+
+ Public Property DutyTax() As List(Of TMicDutyTax)
+ Get
+ Return Me._dutyTax
+ End Get
+ Set
+ Me._dutyTax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTaxes))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDutyTaxes 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()
+ 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 TMicDutyTaxes object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTaxes)
+ 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 TMicDutyTaxes) 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 TMicDutyTaxes
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTaxes)
+ 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 TMicDutyTaxes
+ Return CType(SerializerXml.Deserialize(s), TMicDutyTaxes)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDutyTaxes 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 TMicDutyTaxes object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTaxes)
+ 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 TMicDutyTaxes) 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 TMicDutyTaxes
+ 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 TMicDuty
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _calculatedDutyBase As Decimal
+
+ Private _currency As String
+
+ Private _code As String
+
+ Private _rate As Decimal
+
+ Private _amount As Decimal
+
+ Private _addDeduct As Decimal
+
+ Private _calculatedDuty As Decimal
+
+ Private _duty As Decimal
+
+ Private _dutyBase As Decimal
+
+ Private _measureCode As String
+
+ Private _measure As String
+
+ Private _authorityDutyCode As String
+
+ Private _territory As String
+
+ Private _typeAddCode As String
+
+ Private _numberAddCode As String
+
+ Private _tariffRateQuota As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property calculatedDutyBase() As Decimal
+ Get
+ Return Me._calculatedDutyBase
+ End Get
+ Set
+ Me._calculatedDutyBase = Value
+ End Set
+ End Property
+
+ Public Property currency() As String
+ Get
+ Return Me._currency
+ End Get
+ Set
+ Me._currency = Value
+ End Set
+ End Property
+
+ Public Property code() As String
+ Get
+ Return Me._code
+ End Get
+ Set
+ Me._code = Value
+ End Set
+ End Property
+
+ Public Property rate() As Decimal
+ Get
+ Return Me._rate
+ End Get
+ Set
+ Me._rate = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property addDeduct() As Decimal
+ Get
+ Return Me._addDeduct
+ End Get
+ Set
+ Me._addDeduct = Value
+ End Set
+ End Property
+
+ Public Property calculatedDuty() As Decimal
+ Get
+ Return Me._calculatedDuty
+ End Get
+ Set
+ Me._calculatedDuty = Value
+ End Set
+ End Property
+
+ Public Property duty() As Decimal
+ Get
+ Return Me._duty
+ End Get
+ Set
+ Me._duty = Value
+ End Set
+ End Property
+
+ Public Property dutyBase() As Decimal
+ Get
+ Return Me._dutyBase
+ End Get
+ Set
+ Me._dutyBase = Value
+ End Set
+ End Property
+
+ Public Property measureCode() As String
+ Get
+ Return Me._measureCode
+ End Get
+ Set
+ Me._measureCode = Value
+ End Set
+ End Property
+
+ Public Property measure() As String
+ Get
+ Return Me._measure
+ End Get
+ Set
+ Me._measure = Value
+ End Set
+ End Property
+
+ Public Property authorityDutyCode() As String
+ Get
+ Return Me._authorityDutyCode
+ End Get
+ Set
+ Me._authorityDutyCode = Value
+ End Set
+ End Property
+
+ Public Property territory() As String
+ Get
+ Return Me._territory
+ End Get
+ Set
+ Me._territory = Value
+ End Set
+ End Property
+
+ Public Property typeAddCode() As String
+ Get
+ Return Me._typeAddCode
+ End Get
+ Set
+ Me._typeAddCode = Value
+ End Set
+ End Property
+
+ Public Property numberAddCode() As String
+ Get
+ Return Me._numberAddCode
+ End Get
+ Set
+ Me._numberAddCode = Value
+ End Set
+ End Property
+
+ Public Property tariffRateQuota() As String
+ Get
+ Return Me._tariffRateQuota
+ End Get
+ Set
+ Me._tariffRateQuota = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuty))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDuty 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()
+ 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 TMicDuty object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuty)
+ 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 TMicDuty) 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 TMicDuty
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuty)
+ 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 TMicDuty
+ Return CType(SerializerXml.Deserialize(s), TMicDuty)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDuty 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 TMicDuty object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuty)
+ 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 TMicDuty) 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 TMicDuty
+ 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 TMicDuties
+
+#Region "Private fields"
+ Private _duty As List(Of TMicDuty)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._duty = New List(Of TMicDuty)()
+ End Sub
+
+
+ Public Property Duty() As List(Of TMicDuty)
+ Get
+ Return Me._duty
+ End Get
+ Set
+ Me._duty = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuties))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDuties 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()
+ 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 TMicDuties object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuties)
+ 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 TMicDuties) 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 TMicDuties
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuties)
+ 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 TMicDuties
+ Return CType(SerializerXml.Deserialize(s), TMicDuties)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDuties 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 TMicDuties object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuties)
+ 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 TMicDuties) 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 TMicDuties
+ 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 TErpLineData
+
+#Region "Private fields"
+ Private _legalRegulation As String
+
+ Private _exportControlClass As String
+
+ Private _embargo As String
+
+ Private _licenseType As String
+
+ Private _licenseNumber As String
+
+ Private _profitCenter As String
+
+ Private _vZTA As String
+
+ Private _erpInvoicelinenumber As String
+
+ Private _erpPartnumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property legalRegulation() As String
+ Get
+ Return Me._legalRegulation
+ End Get
+ Set
+ Me._legalRegulation = Value
+ End Set
+ End Property
+
+ Public Property exportControlClass() As String
+ Get
+ Return Me._exportControlClass
+ End Get
+ Set
+ Me._exportControlClass = Value
+ End Set
+ End Property
+
+ Public Property embargo() As String
+ Get
+ Return Me._embargo
+ End Get
+ Set
+ Me._embargo = Value
+ End Set
+ End Property
+
+ Public Property licenseType() As String
+ Get
+ Return Me._licenseType
+ End Get
+ Set
+ Me._licenseType = Value
+ End Set
+ End Property
+
+ Public Property licenseNumber() As String
+ Get
+ Return Me._licenseNumber
+ End Get
+ Set
+ Me._licenseNumber = Value
+ End Set
+ End Property
+
+ Public Property profitCenter() As String
+ Get
+ Return Me._profitCenter
+ End Get
+ Set
+ Me._profitCenter = Value
+ End Set
+ End Property
+
+ Public Property vZTA() As String
+ Get
+ Return Me._vZTA
+ End Get
+ Set
+ Me._vZTA = Value
+ End Set
+ End Property
+
+
+ Public Property erpInvoicelinenumber() As String
+ Get
+ Return Me._erpInvoicelinenumber
+ End Get
+ Set
+ Me._erpInvoicelinenumber = Value
+ End Set
+ End Property
+
+ Public Property erpPartnumber() As String
+ Get
+ Return Me._erpPartnumber
+ End Get
+ Set
+ Me._erpPartnumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TErpLineData))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErpLineData 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()
+ 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 TErpLineData object
+ '''
+ ''' string to deserialize
+ ''' Output TErpLineData 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 TErpLineData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpLineData)
+ 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 TErpLineData) 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 TErpLineData
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErpLineData)
+ 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 TErpLineData
+ Return CType(SerializerXml.Deserialize(s), TErpLineData)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErpLineData 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 TErpLineData object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErpLineData 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 TErpLineData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpLineData)
+ 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 TErpLineData) 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 TErpLineData
+ 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 TRegInfo
+
+#Region "Private fields"
+ Private _registrationNumber1 As String
+
+ Private _registrationNumber2 As String
+
+ Private _registrationNumber3 As String
+
+ Private _referenceNumber1 As String
+
+ Private _referenceNumber2 As String
+
+ Private _referenceNumber3 As String
+
+ Private _registrationDate As Date
+
+ Private _acceptanceDate As Date
+
+ Private _releaseDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property registrationNumber1() As String
+ Get
+ Return Me._registrationNumber1
+ End Get
+ Set
+ Me._registrationNumber1 = Value
+ End Set
+ End Property
+
+ Public Property registrationNumber2() As String
+ Get
+ Return Me._registrationNumber2
+ End Get
+ Set
+ Me._registrationNumber2 = Value
+ End Set
+ End Property
+
+ Public Property registrationNumber3() As String
+ Get
+ Return Me._registrationNumber3
+ End Get
+ Set
+ Me._registrationNumber3 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber1() As String
+ Get
+ Return Me._referenceNumber1
+ End Get
+ Set
+ Me._referenceNumber1 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber2() As String
+ Get
+ Return Me._referenceNumber2
+ End Get
+ Set
+ Me._referenceNumber2 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber3() As String
+ Get
+ Return Me._referenceNumber3
+ End Get
+ Set
+ Me._referenceNumber3 = Value
+ End Set
+ End Property
+
+
+ Public Property registrationDate() As Date
+ Get
+ Return Me._registrationDate
+ End Get
+ Set
+ Me._registrationDate = Value
+ End Set
+ End Property
+
+
+ Public Property acceptanceDate() As Date
+ Get
+ Return Me._acceptanceDate
+ End Get
+ Set
+ Me._acceptanceDate = Value
+ End Set
+ End Property
+
+
+ Public Property releaseDate() As Date
+ Get
+ Return Me._releaseDate
+ End Get
+ Set
+ Me._releaseDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRegInfo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TRegInfo 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()
+ 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 TRegInfo object
+ '''
+ ''' string to deserialize
+ ''' Output TRegInfo 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 TRegInfo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRegInfo)
+ 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 TRegInfo) 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 TRegInfo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRegInfo)
+ 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 TRegInfo
+ Return CType(SerializerXml.Deserialize(s), TRegInfo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TRegInfo 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 TRegInfo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TRegInfo 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 TRegInfo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRegInfo)
+ 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 TRegInfo) 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 TRegInfo
+ 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 TImportQuantity
+
+#Region "Private fields"
+ Private _qualifier As String
+
+ Private _unit As String
+
+ Private _value As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property qualifier() As String
+ Get
+ Return Me._qualifier
+ End Get
+ Set
+ Me._qualifier = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property value() As Decimal
+ 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(TImportQuantity))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TImportQuantity 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()
+ 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 TImportQuantity object
+ '''
+ ''' string to deserialize
+ ''' Output TImportQuantity 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 TImportQuantity, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportQuantity)
+ 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 TImportQuantity) 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 TImportQuantity
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TImportQuantity)
+ 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 TImportQuantity
+ Return CType(SerializerXml.Deserialize(s), TImportQuantity)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TImportQuantity 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 TImportQuantity object
+ '''
+ ''' File to load and deserialize
+ ''' Output TImportQuantity 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 TImportQuantity, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportQuantity)
+ 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 TImportQuantity) 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 TImportQuantity
+ 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 TImportReference
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _authType As String
+
+ Private _authNr As String
+
+ Private _mrn As String
+
+ Private _impShpNr As String
+
+ Private _lineNo As String
+
+ Private _authRegistryNo As String
+
+ Private _commCode As String
+
+ Private _usualTreatment As String
+
+ Private _importAtlas As String
+
+ Private _addInfo As String
+
+ Private _quantity As TImportQuantity
+
+ Private _tradeQuantity As TImportQuantity
+
+ Private _packageQuantity As Decimal
+
+ Private _netMass As Decimal
+
+ Private _grossMass As Decimal
+
+ Private _statisticalQuantity As Decimal
+
+ Private _simpleIprApplication As String
+
+ Private _supervisingOffice As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._tradeQuantity = New TImportQuantity()
+ Me._quantity = New TImportQuantity()
+ End Sub
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property authType() As String
+ Get
+ Return Me._authType
+ End Get
+ Set
+ Me._authType = Value
+ End Set
+ End Property
+
+ Public Property authNr() As String
+ Get
+ Return Me._authNr
+ End Get
+ Set
+ Me._authNr = Value
+ End Set
+ End Property
+
+ Public Property mrn() As String
+ Get
+ Return Me._mrn
+ End Get
+ Set
+ Me._mrn = Value
+ End Set
+ End Property
+
+ Public Property impShpNr() As String
+ Get
+ Return Me._impShpNr
+ End Get
+ Set
+ Me._impShpNr = Value
+ End Set
+ End Property
+
+
+ Public Property lineNo() As String
+ Get
+ Return Me._lineNo
+ End Get
+ Set
+ Me._lineNo = Value
+ End Set
+ End Property
+
+ Public Property authRegistryNo() As String
+ Get
+ Return Me._authRegistryNo
+ End Get
+ Set
+ Me._authRegistryNo = Value
+ End Set
+ End Property
+
+ Public Property commCode() As String
+ Get
+ Return Me._commCode
+ End Get
+ Set
+ Me._commCode = Value
+ End Set
+ End Property
+
+ Public Property usualTreatment() As String
+ Get
+ Return Me._usualTreatment
+ End Get
+ Set
+ Me._usualTreatment = Value
+ End Set
+ End Property
+
+ Public Property importAtlas() As String
+ Get
+ Return Me._importAtlas
+ End Get
+ Set
+ Me._importAtlas = Value
+ End Set
+ End Property
+
+ Public Property addInfo() As String
+ Get
+ Return Me._addInfo
+ End Get
+ Set
+ Me._addInfo = Value
+ End Set
+ End Property
+
+ Public Property quantity() As TImportQuantity
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property tradeQuantity() As TImportQuantity
+ Get
+ Return Me._tradeQuantity
+ End Get
+ Set
+ Me._tradeQuantity = Value
+ End Set
+ End Property
+
+ Public Property packageQuantity() As Decimal
+ Get
+ Return Me._packageQuantity
+ End Get
+ Set
+ Me._packageQuantity = Value
+ End Set
+ End Property
+
+ Public Property netMass() As Decimal
+ Get
+ Return Me._netMass
+ End Get
+ Set
+ Me._netMass = Value
+ End Set
+ End Property
+
+ Public Property grossMass() As Decimal
+ Get
+ Return Me._grossMass
+ End Get
+ Set
+ Me._grossMass = Value
+ End Set
+ End Property
+
+ Public Property statisticalQuantity() As Decimal
+ Get
+ Return Me._statisticalQuantity
+ End Get
+ Set
+ Me._statisticalQuantity = Value
+ End Set
+ End Property
+
+ Public Property simpleIprApplication() As String
+ Get
+ Return Me._simpleIprApplication
+ End Get
+ Set
+ Me._simpleIprApplication = Value
+ End Set
+ End Property
+
+ Public Property supervisingOffice() As String
+ Get
+ Return Me._supervisingOffice
+ End Get
+ Set
+ Me._supervisingOffice = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TImportReference))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TImportReference 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()
+ 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 TImportReference object
+ '''
+ ''' string to deserialize
+ ''' Output TImportReference 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 TImportReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportReference)
+ 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 TImportReference) 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 TImportReference
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TImportReference)
+ 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 TImportReference
+ Return CType(SerializerXml.Deserialize(s), TImportReference)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TImportReference 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 TImportReference object
+ '''
+ ''' File to load and deserialize
+ ''' Output TImportReference 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 TImportReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportReference)
+ 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 TImportReference) 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 TImportReference
+ 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 TBomNo
+
+#Region "Private fields"
+ Private _no As String
+
+ Private _var As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property no() As String
+ Get
+ Return Me._no
+ End Get
+ Set
+ Me._no = Value
+ End Set
+ End Property
+
+ Public Property var() As String
+ Get
+ Return Me._var
+ End Get
+ Set
+ Me._var = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TBomNo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TBomNo 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()
+ 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 TBomNo object
+ '''
+ ''' string to deserialize
+ ''' Output TBomNo 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 TBomNo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TBomNo)
+ 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 TBomNo) 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 TBomNo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TBomNo)
+ 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 TBomNo
+ Return CType(SerializerXml.Deserialize(s), TBomNo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TBomNo 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 TBomNo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TBomNo 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 TBomNo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TBomNo)
+ 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 TBomNo) 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 TBomNo
+ 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 TOrder
+
+#Region "Private fields"
+ Private _ordNo As String
+
+ Private _ordDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property ordNo() As String
+ Get
+ Return Me._ordNo
+ End Get
+ Set
+ Me._ordNo = Value
+ End Set
+ End Property
+
+
+ Public Property ordDate() As Date
+ Get
+ Return Me._ordDate
+ End Get
+ Set
+ Me._ordDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TOrder))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TOrder 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()
+ 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 TOrder object
+ '''
+ ''' string to deserialize
+ ''' Output TOrder 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 TOrder, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TOrder)
+ 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 TOrder) 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 TOrder
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TOrder)
+ 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 TOrder
+ Return CType(SerializerXml.Deserialize(s), TOrder)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TOrder 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 TOrder object
+ '''
+ ''' File to load and deserialize
+ ''' Output TOrder 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 TOrder, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TOrder)
+ 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 TOrder) 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 TOrder
+ 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 TDelNote
+
+#Region "Private fields"
+ Private _delNo As String
+
+ Private _position As Long
+
+ Private _delDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property delNo() As String
+ Get
+ Return Me._delNo
+ End Get
+ Set
+ Me._delNo = Value
+ End Set
+ End Property
+
+ Public Property position() As Long
+ Get
+ Return Me._position
+ End Get
+ Set
+ Me._position = Value
+ End Set
+ End Property
+
+
+ Public Property delDate() As Date
+ Get
+ Return Me._delDate
+ End Get
+ Set
+ Me._delDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDelNote))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDelNote 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()
+ 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 TDelNote object
+ '''
+ ''' string to deserialize
+ ''' Output TDelNote 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 TDelNote, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelNote)
+ 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 TDelNote) 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 TDelNote
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDelNote)
+ 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 TDelNote
+ Return CType(SerializerXml.Deserialize(s), TDelNote)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDelNote 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 TDelNote object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDelNote 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 TDelNote, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelNote)
+ 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 TDelNote) 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 TDelNote
+ 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 TItem
+
+#Region "Private fields"
+ Private _itemNo As String
+
+ Private _itemDesc As String
+
+ Private _commCode As String
+
+ Private _prodGr As String
+
+ Private _cusCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property itemNo() As String
+ Get
+ Return Me._itemNo
+ End Get
+ Set
+ Me._itemNo = Value
+ End Set
+ End Property
+
+ Public Property itemDesc() As String
+ Get
+ Return Me._itemDesc
+ End Get
+ Set
+ Me._itemDesc = Value
+ End Set
+ End Property
+
+ Public Property commCode() As String
+ Get
+ Return Me._commCode
+ End Get
+ Set
+ Me._commCode = Value
+ End Set
+ End Property
+
+ Public Property prodGr() As String
+ Get
+ Return Me._prodGr
+ End Get
+ Set
+ Me._prodGr = Value
+ End Set
+ End Property
+
+ Public Property cusCode() As String
+ Get
+ Return Me._cusCode
+ End Get
+ Set
+ Me._cusCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TItem))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TItem 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()
+ 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 TItem object
+ '''
+ ''' string to deserialize
+ ''' Output TItem 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 TItem, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TItem)
+ 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 TItem) 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 TItem
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TItem)
+ 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 TItem
+ Return CType(SerializerXml.Deserialize(s), TItem)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TItem 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 TItem object
+ '''
+ ''' File to load and deserialize
+ ''' Output TItem 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 TItem, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TItem)
+ 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 TItem) 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 TItem
+ 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 TPreviousDocument
+
+#Region "Private fields"
+ Private _docType As String
+
+ Private _docQual As String
+
+ Private _docNo As String
+
+ Private _docAddText As String
+
+ Private _docCategory As String
+
+ Private _itemNumber As String
+
+ Private _unit As String
+
+ Private _quantity As Decimal
+
+ Private _numberOfPackages As String
+
+ Private _packageType As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property docType() As String
+ Get
+ Return Me._docType
+ End Get
+ Set
+ Me._docType = Value
+ End Set
+ End Property
+
+ Public Property docQual() As String
+ Get
+ Return Me._docQual
+ End Get
+ Set
+ Me._docQual = Value
+ End Set
+ End Property
+
+ Public Property docNo() As String
+ Get
+ Return Me._docNo
+ End Get
+ Set
+ Me._docNo = Value
+ End Set
+ End Property
+
+ Public Property docAddText() As String
+ Get
+ Return Me._docAddText
+ End Get
+ Set
+ Me._docAddText = Value
+ End Set
+ End Property
+
+ Public Property docCategory() As String
+ Get
+ Return Me._docCategory
+ End Get
+ Set
+ Me._docCategory = Value
+ End Set
+ End Property
+
+
+ Public Property itemNumber() As String
+ Get
+ Return Me._itemNumber
+ End Get
+ Set
+ Me._itemNumber = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+
+ Public Property numberOfPackages() As String
+ Get
+ Return Me._numberOfPackages
+ End Get
+ Set
+ Me._numberOfPackages = Value
+ End Set
+ End Property
+
+ Public Property packageType() As String
+ Get
+ Return Me._packageType
+ End Get
+ Set
+ Me._packageType = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPreviousDocument))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPreviousDocument 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()
+ 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 TPreviousDocument object
+ '''
+ ''' string to deserialize
+ ''' Output TPreviousDocument 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 TPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPreviousDocument)
+ 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 TPreviousDocument) 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 TPreviousDocument
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPreviousDocument)
+ 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 TPreviousDocument
+ Return CType(SerializerXml.Deserialize(s), TPreviousDocument)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPreviousDocument 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 TPreviousDocument object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPreviousDocument 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 TPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPreviousDocument)
+ 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 TPreviousDocument) 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 TPreviousDocument
+ 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 TInvoiceLine
+
+#Region "Private fields"
+ Private _lineNo As String
+
+ Private _unitPrice As Decimal
+
+ Private _amount As Decimal
+
+ Private _nWeight As Decimal
+
+ Private _gWeight As Decimal
+
+ Private _statQuant As Decimal
+
+ Private _statUnit As String
+
+ Private _statVal As Decimal
+
+ Private _custProc As String
+
+ Private _eUCode As String
+
+ Private _statCode As String
+
+ Private _transType As String
+
+ Private _exportCountry As String
+
+ Private _coo As String
+
+ Private _cooState As String
+
+ Private _addText As List(Of String)
+
+ Private _prevDoc As List(Of TPreviousDocument)
+
+ Private _item As TItem
+
+ Private _taricAddCode As List(Of TInvoiceLineTaricAddCode)
+
+ Private _dangerousGoods As List(Of TInvoiceLineDangerousGoods)
+
+ Private _documents As List(Of TDocuments)
+
+ Private _delTerm As TInvoiceLineDelTerm
+
+ Private _quantity As Decimal
+
+ Private _unit As String
+
+ Private _specialQuantity As Decimal
+
+ Private _specialQuantityUnit As String
+
+ Private _delnote As TDelNote
+
+ Private _order As TOrder
+
+ Private _itemRef As String
+
+ Private _addCosts As List(Of TAddCosts)
+
+ Private _addCode As List(Of String)
+
+ Private _natCode As List(Of String)
+
+ Private _stockTypeAdd As String
+
+ Private _stockTypeDed As String
+
+ Private _bom As TBomNo
+
+ Private _accountNo As String
+
+ Private _customerFields As TCustomerFields
+
+ Private _attributes As List(Of TAttribute)
+
+ Private _containers As List(Of TContainer)
+
+ Private _shipmentIdentification As String
+
+ Private _uNDG As String
+
+ Private _consigneeEndUserFlag As String
+
+ Private _endUserInEam As TInvoiceLineEndUserInEam
+
+ Private _carriageCosts As String
+
+ Private _shipTo As TInvoiceLineShipTo
+
+ Private _endUser As TInvoiceLineEndUser
+
+ Private _importReference As List(Of TImportReference)
+
+ Private _registrationInfo As TRegInfo
+
+ Private _serialNo As String
+
+ Private _referenceValue As Decimal
+
+ Private _model As String
+
+ Private _brand As String
+
+ Private _addedValue As Decimal
+
+ Private _ctoId As String
+
+ Private _infoText2 As String
+
+ Private _branchNo As String
+
+ Private _additionalInformation As List(Of TAttribute)
+
+ Private _trackingNumber As String
+
+ Private _erpData As TErpLineData
+
+ Private _outwardProcessing As TInvoiceLineOutwardProcessing
+
+ Private _partners As List(Of TPartner)
+
+ Private _authorisations As List(Of TAuthorisation)
+
+ Private _eudr As TInvoiceLineEudr
+
+ Private _duties As TMicDuties
+
+ Private _dutyTaxes As TMicDutyTaxes
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._dutyTaxes = New TMicDutyTaxes()
+ Me._duties = New TMicDuties()
+ Me._eudr = New TInvoiceLineEudr()
+ Me._authorisations = New List(Of TAuthorisation)()
+ Me._partners = New List(Of TPartner)()
+ Me._outwardProcessing = New TInvoiceLineOutwardProcessing()
+ Me._erpData = New TErpLineData()
+ Me._additionalInformation = New List(Of TAttribute)()
+ Me._registrationInfo = New TRegInfo()
+ Me._importReference = New List(Of TImportReference)()
+ Me._endUser = New TInvoiceLineEndUser()
+ Me._shipTo = New TInvoiceLineShipTo()
+ Me._containers = New List(Of TContainer)()
+ Me._attributes = New List(Of TAttribute)()
+ Me._customerFields = New TCustomerFields()
+ Me._bom = New TBomNo()
+ Me._natCode = New List(Of String)()
+ Me._addCode = New List(Of String)()
+ Me._addCosts = New List(Of TAddCosts)()
+ Me._order = New TOrder()
+ Me._delnote = New TDelNote()
+ Me._delTerm = New TInvoiceLineDelTerm()
+ Me._documents = New List(Of TDocuments)()
+ Me._dangerousGoods = New List(Of TInvoiceLineDangerousGoods)()
+ Me._taricAddCode = New List(Of TInvoiceLineTaricAddCode)()
+ Me._item = New TItem()
+ Me._prevDoc = New List(Of TPreviousDocument)()
+ Me._addText = New List(Of String)()
+ End Sub
+
+
+ Public Property lineNo() As String
+ Get
+ Return Me._lineNo
+ End Get
+ Set
+ Me._lineNo = Value
+ End Set
+ End Property
+
+ Public Property unitPrice() As Decimal
+ Get
+ Return Me._unitPrice
+ End Get
+ Set
+ Me._unitPrice = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property statQuant() As Decimal
+ Get
+ Return Me._statQuant
+ End Get
+ Set
+ Me._statQuant = Value
+ End Set
+ End Property
+
+ Public Property statUnit() As String
+ Get
+ Return Me._statUnit
+ End Get
+ Set
+ Me._statUnit = Value
+ End Set
+ End Property
+
+ Public Property statVal() As Decimal
+ Get
+ Return Me._statVal
+ End Get
+ Set
+ Me._statVal = Value
+ End Set
+ End Property
+
+ Public Property custProc() As String
+ Get
+ Return Me._custProc
+ End Get
+ Set
+ Me._custProc = Value
+ End Set
+ End Property
+
+ Public Property EUCode() As String
+ Get
+ Return Me._eUCode
+ End Get
+ Set
+ Me._eUCode = Value
+ End Set
+ End Property
+
+ Public Property statCode() As String
+ Get
+ Return Me._statCode
+ End Get
+ Set
+ Me._statCode = Value
+ End Set
+ End Property
+
+ Public Property transType() As String
+ Get
+ Return Me._transType
+ End Get
+ Set
+ Me._transType = Value
+ End Set
+ End Property
+
+ Public Property exportCountry() As String
+ Get
+ Return Me._exportCountry
+ End Get
+ Set
+ Me._exportCountry = Value
+ End Set
+ End Property
+
+ Public Property coo() As String
+ Get
+ Return Me._coo
+ End Get
+ Set
+ Me._coo = Value
+ End Set
+ End Property
+
+ Public Property cooState() As String
+ Get
+ Return Me._cooState
+ End Get
+ Set
+ Me._cooState = Value
+ End Set
+ End Property
+
+
+ Public Property addText() As List(Of String)
+ Get
+ Return Me._addText
+ End Get
+ Set
+ Me._addText = Value
+ End Set
+ End Property
+
+
+ Public Property prevDoc() As List(Of TPreviousDocument)
+ Get
+ Return Me._prevDoc
+ End Get
+ Set
+ Me._prevDoc = Value
+ End Set
+ End Property
+
+ Public Property item() As TItem
+ Get
+ Return Me._item
+ End Get
+ Set
+ Me._item = Value
+ End Set
+ End Property
+
+
+ Public Property taricAddCode() As List(Of TInvoiceLineTaricAddCode)
+ Get
+ Return Me._taricAddCode
+ End Get
+ Set
+ Me._taricAddCode = Value
+ End Set
+ End Property
+
+
+ Public Property dangerousGoods() As List(Of TInvoiceLineDangerousGoods)
+ Get
+ Return Me._dangerousGoods
+ End Get
+ Set
+ Me._dangerousGoods = Value
+ End Set
+ End Property
+
+
+ Public Property documents() As List(Of TDocuments)
+ Get
+ Return Me._documents
+ End Get
+ Set
+ Me._documents = Value
+ End Set
+ End Property
+
+ Public Property delTerm() As TInvoiceLineDelTerm
+ Get
+ Return Me._delTerm
+ End Get
+ Set
+ Me._delTerm = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property specialQuantity() As Decimal
+ Get
+ Return Me._specialQuantity
+ End Get
+ Set
+ Me._specialQuantity = Value
+ End Set
+ End Property
+
+ Public Property specialQuantityUnit() As String
+ Get
+ Return Me._specialQuantityUnit
+ End Get
+ Set
+ Me._specialQuantityUnit = Value
+ End Set
+ End Property
+
+ Public Property delnote() As TDelNote
+ Get
+ Return Me._delnote
+ End Get
+ Set
+ Me._delnote = Value
+ End Set
+ End Property
+
+ Public Property order() As TOrder
+ Get
+ Return Me._order
+ End Get
+ Set
+ Me._order = Value
+ End Set
+ End Property
+
+ Public Property itemRef() As String
+ Get
+ Return Me._itemRef
+ End Get
+ Set
+ Me._itemRef = Value
+ End Set
+ End Property
+
+
+ Public Property addCosts() As List(Of TAddCosts)
+ Get
+ Return Me._addCosts
+ End Get
+ Set
+ Me._addCosts = Value
+ End Set
+ End Property
+
+
+ Public Property addCode() As List(Of String)
+ Get
+ Return Me._addCode
+ End Get
+ Set
+ Me._addCode = Value
+ End Set
+ End Property
+
+
+ Public Property natCode() As List(Of String)
+ Get
+ Return Me._natCode
+ End Get
+ Set
+ Me._natCode = Value
+ End Set
+ End Property
+
+ Public Property stockTypeAdd() As String
+ Get
+ Return Me._stockTypeAdd
+ End Get
+ Set
+ Me._stockTypeAdd = Value
+ End Set
+ End Property
+
+ Public Property stockTypeDed() As String
+ Get
+ Return Me._stockTypeDed
+ End Get
+ Set
+ Me._stockTypeDed = Value
+ End Set
+ End Property
+
+ Public Property bom() As TBomNo
+ Get
+ Return Me._bom
+ End Get
+ Set
+ Me._bom = Value
+ End Set
+ End Property
+
+ Public Property accountNo() As String
+ Get
+ Return Me._accountNo
+ End Get
+ Set
+ Me._accountNo = Value
+ End Set
+ End Property
+
+ Public Property customerFields() As TCustomerFields
+ Get
+ Return Me._customerFields
+ End Get
+ Set
+ Me._customerFields = Value
+ End Set
+ End Property
+
+
+ Public Property attributes() As List(Of TAttribute)
+ Get
+ Return Me._attributes
+ End Get
+ Set
+ Me._attributes = Value
+ End Set
+ End Property
+
+
+ Public Property containers() As List(Of TContainer)
+ Get
+ Return Me._containers
+ End Get
+ Set
+ Me._containers = Value
+ End Set
+ End Property
+
+ Public Property shipmentIdentification() As String
+ Get
+ Return Me._shipmentIdentification
+ End Get
+ Set
+ Me._shipmentIdentification = Value
+ End Set
+ End Property
+
+ Public Property UNDG() As String
+ Get
+ Return Me._uNDG
+ End Get
+ Set
+ Me._uNDG = Value
+ End Set
+ End Property
+
+ Public Property consigneeEndUserFlag() As String
+ Get
+ Return Me._consigneeEndUserFlag
+ End Get
+ Set
+ Me._consigneeEndUserFlag = Value
+ End Set
+ End Property
+
+ Public Property endUserInEam() As TInvoiceLineEndUserInEam
+ Get
+ Return Me._endUserInEam
+ End Get
+ Set
+ Me._endUserInEam = Value
+ End Set
+ End Property
+
+ Public Property carriageCosts() As String
+ Get
+ Return Me._carriageCosts
+ End Get
+ Set
+ Me._carriageCosts = Value
+ End Set
+ End Property
+
+ Public Property shipTo() As TInvoiceLineShipTo
+ Get
+ Return Me._shipTo
+ End Get
+ Set
+ Me._shipTo = Value
+ End Set
+ End Property
+
+ Public Property endUser() As TInvoiceLineEndUser
+ Get
+ Return Me._endUser
+ End Get
+ Set
+ Me._endUser = Value
+ End Set
+ End Property
+
+
+ Public Property importReference() As List(Of TImportReference)
+ Get
+ Return Me._importReference
+ End Get
+ Set
+ Me._importReference = Value
+ End Set
+ End Property
+
+ Public Property registrationInfo() As TRegInfo
+ Get
+ Return Me._registrationInfo
+ End Get
+ Set
+ Me._registrationInfo = Value
+ End Set
+ End Property
+
+ Public Property serialNo() As String
+ Get
+ Return Me._serialNo
+ End Get
+ Set
+ Me._serialNo = Value
+ End Set
+ End Property
+
+ Public Property referenceValue() As Decimal
+ Get
+ Return Me._referenceValue
+ End Get
+ Set
+ Me._referenceValue = Value
+ End Set
+ End Property
+
+ Public Property model() As String
+ Get
+ Return Me._model
+ End Get
+ Set
+ Me._model = Value
+ End Set
+ End Property
+
+ Public Property brand() As String
+ Get
+ Return Me._brand
+ End Get
+ Set
+ Me._brand = Value
+ End Set
+ End Property
+
+ Public Property addedValue() As Decimal
+ Get
+ Return Me._addedValue
+ End Get
+ Set
+ Me._addedValue = Value
+ End Set
+ End Property
+
+ Public Property ctoId() As String
+ Get
+ Return Me._ctoId
+ End Get
+ Set
+ Me._ctoId = Value
+ End Set
+ End Property
+
+ Public Property infoText2() As String
+ Get
+ Return Me._infoText2
+ End Get
+ Set
+ Me._infoText2 = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+
+ Public Property additionalInformation() As List(Of TAttribute)
+ Get
+ Return Me._additionalInformation
+ End Get
+ Set
+ Me._additionalInformation = Value
+ End Set
+ End Property
+
+ Public Property trackingNumber() As String
+ Get
+ Return Me._trackingNumber
+ End Get
+ Set
+ Me._trackingNumber = Value
+ End Set
+ End Property
+
+ Public Property erpData() As TErpLineData
+ Get
+ Return Me._erpData
+ End Get
+ Set
+ Me._erpData = Value
+ End Set
+ End Property
+
+ Public Property outwardProcessing() As TInvoiceLineOutwardProcessing
+ Get
+ Return Me._outwardProcessing
+ End Get
+ Set
+ Me._outwardProcessing = Value
+ End Set
+ End Property
+
+
+ Public Property partners() As List(Of TPartner)
+ Get
+ Return Me._partners
+ End Get
+ Set
+ Me._partners = Value
+ End Set
+ End Property
+
+
+ Public Property authorisations() As List(Of TAuthorisation)
+ Get
+ Return Me._authorisations
+ End Get
+ Set
+ Me._authorisations = Value
+ End Set
+ End Property
+
+ Public Property eudr() As TInvoiceLineEudr
+ Get
+ Return Me._eudr
+ End Get
+ Set
+ Me._eudr = Value
+ End Set
+ End Property
+
+ Public Property Duties() As TMicDuties
+ Get
+ Return Me._duties
+ End Get
+ Set
+ Me._duties = Value
+ End Set
+ End Property
+
+ Public Property DutyTaxes() As TMicDutyTaxes
+ Get
+ Return Me._dutyTaxes
+ End Get
+ Set
+ Me._dutyTaxes = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLine))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLine 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()
+ 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 TInvoiceLine object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLine 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 TInvoiceLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLine)
+ 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 TInvoiceLine) 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 TInvoiceLine
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLine)
+ 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 TInvoiceLine
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLine)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLine 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 TInvoiceLine object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLine 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 TInvoiceLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLine)
+ 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 TInvoiceLine) 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 TInvoiceLine
+ 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 TInvoiceLineTaricAddCode
+
+#Region "Private fields"
+ Private _additionalCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property additionalCode() As String
+ Get
+ Return Me._additionalCode
+ End Get
+ Set
+ Me._additionalCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineTaricAddCode))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineTaricAddCode 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()
+ 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 TInvoiceLineTaricAddCode object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode) 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 TInvoiceLineTaricAddCode
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineTaricAddCode)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode) 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 TInvoiceLineTaricAddCode
+ 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 TInvoiceLineDangerousGoods
+
+#Region "Private fields"
+ Private _unNumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property unNumber() As String
+ Get
+ Return Me._unNumber
+ End Get
+ Set
+ Me._unNumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineDangerousGoods))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineDangerousGoods 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()
+ 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 TInvoiceLineDangerousGoods object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods) 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 TInvoiceLineDangerousGoods
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineDangerousGoods)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods) 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 TInvoiceLineDangerousGoods
+ 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 TDocuments
+
+#Region "Private fields"
+ Private _docNo As String
+
+ Private _docDate As Date
+
+ Private _docType As String
+
+ Private _docQual As String
+
+ Private _docValidFrom As Date
+
+ Private _docValidTo As Date
+
+ Private _docAddText As String
+
+ Private _docQuantity As Decimal
+
+ Private _docUnit As String
+
+ Private _docDetail As String
+
+ Private _docValue As Decimal
+
+ Private _docUnitQual As String
+
+ Private _docStatUnit As String
+
+ Private _docDepreciateQuantity As Decimal
+
+ Private _docSupplier As String
+
+ Private _docSupplierName As String
+
+ Private _docCategory As String
+
+ Private _docCurrency As String
+
+ Private _docLineItemNo As Integer
+
+ Private _docQuantityMax As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property docNo() As String
+ Get
+ Return Me._docNo
+ End Get
+ Set
+ Me._docNo = Value
+ End Set
+ End Property
+
+
+ Public Property docDate() As Date
+ Get
+ Return Me._docDate
+ End Get
+ Set
+ Me._docDate = Value
+ End Set
+ End Property
+
+ Public Property docType() As String
+ Get
+ Return Me._docType
+ End Get
+ Set
+ Me._docType = Value
+ End Set
+ End Property
+
+ Public Property docQual() As String
+ Get
+ Return Me._docQual
+ End Get
+ Set
+ Me._docQual = Value
+ End Set
+ End Property
+
+
+ Public Property docValidFrom() As Date
+ Get
+ Return Me._docValidFrom
+ End Get
+ Set
+ Me._docValidFrom = Value
+ End Set
+ End Property
+
+
+ Public Property docValidTo() As Date
+ Get
+ Return Me._docValidTo
+ End Get
+ Set
+ Me._docValidTo = Value
+ End Set
+ End Property
+
+ Public Property docAddText() As String
+ Get
+ Return Me._docAddText
+ End Get
+ Set
+ Me._docAddText = Value
+ End Set
+ End Property
+
+ Public Property docQuantity() As Decimal
+ Get
+ Return Me._docQuantity
+ End Get
+ Set
+ Me._docQuantity = Value
+ End Set
+ End Property
+
+ Public Property docUnit() As String
+ Get
+ Return Me._docUnit
+ End Get
+ Set
+ Me._docUnit = Value
+ End Set
+ End Property
+
+ Public Property docDetail() As String
+ Get
+ Return Me._docDetail
+ End Get
+ Set
+ Me._docDetail = Value
+ End Set
+ End Property
+
+ Public Property docValue() As Decimal
+ Get
+ Return Me._docValue
+ End Get
+ Set
+ Me._docValue = Value
+ End Set
+ End Property
+
+ Public Property docUnitQual() As String
+ Get
+ Return Me._docUnitQual
+ End Get
+ Set
+ Me._docUnitQual = Value
+ End Set
+ End Property
+
+ Public Property docStatUnit() As String
+ Get
+ Return Me._docStatUnit
+ End Get
+ Set
+ Me._docStatUnit = Value
+ End Set
+ End Property
+
+ Public Property docDepreciateQuantity() As Decimal
+ Get
+ Return Me._docDepreciateQuantity
+ End Get
+ Set
+ Me._docDepreciateQuantity = Value
+ End Set
+ End Property
+
+ Public Property docSupplier() As String
+ Get
+ Return Me._docSupplier
+ End Get
+ Set
+ Me._docSupplier = Value
+ End Set
+ End Property
+
+ Public Property docSupplierName() As String
+ Get
+ Return Me._docSupplierName
+ End Get
+ Set
+ Me._docSupplierName = Value
+ End Set
+ End Property
+
+ Public Property docCategory() As String
+ Get
+ Return Me._docCategory
+ End Get
+ Set
+ Me._docCategory = Value
+ End Set
+ End Property
+
+ Public Property docCurrency() As String
+ Get
+ Return Me._docCurrency
+ End Get
+ Set
+ Me._docCurrency = Value
+ End Set
+ End Property
+
+ Public Property docLineItemNo() As Integer
+ Get
+ Return Me._docLineItemNo
+ End Get
+ Set
+ Me._docLineItemNo = Value
+ End Set
+ End Property
+
+ Public Property docQuantityMax() As Decimal
+ Get
+ Return Me._docQuantityMax
+ End Get
+ Set
+ Me._docQuantityMax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDocuments))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDocuments 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()
+ 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 TDocuments object
+ '''
+ ''' string to deserialize
+ ''' Output TDocuments 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 TDocuments, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDocuments)
+ 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 TDocuments) 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 TDocuments
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDocuments)
+ 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 TDocuments
+ Return CType(SerializerXml.Deserialize(s), TDocuments)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDocuments 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 TDocuments object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDocuments 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 TDocuments, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDocuments)
+ 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 TDocuments) 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 TDocuments
+ 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 TInvoiceLineDelTerm
+
+#Region "Private fields"
+ Private _code As String
+
+ Private _desc 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 desc() As String
+ Get
+ Return Me._desc
+ End Get
+ Set
+ Me._desc = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineDelTerm))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineDelTerm 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()
+ 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 TInvoiceLineDelTerm object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineDelTerm 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 TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm) 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 TInvoiceLineDelTerm
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineDelTerm)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineDelTerm 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 TInvoiceLineDelTerm object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineDelTerm 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 TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm) 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 TInvoiceLineDelTerm
+ 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 TAddCosts
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _flag As TAddCostsFlag
+
+ Private _amount As Decimal
+
+ Private _curr As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property flag() As TAddCostsFlag
+ Get
+ Return Me._flag
+ End Get
+ Set
+ Me._flag = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property curr() As String
+ Get
+ Return Me._curr
+ End Get
+ Set
+ Me._curr = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAddCosts))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAddCosts 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()
+ 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 TAddCosts object
+ '''
+ ''' string to deserialize
+ ''' Output TAddCosts 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 TAddCosts, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddCosts)
+ 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 TAddCosts) 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 TAddCosts
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAddCosts)
+ 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 TAddCosts
+ Return CType(SerializerXml.Deserialize(s), TAddCosts)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAddCosts 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 TAddCosts object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAddCosts 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 TAddCosts, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddCosts)
+ 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 TAddCosts) 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 TAddCosts
+ 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 TAddCostsFlag
+
+ P
+
+ V
+ End Enum
+
+
+ Partial Public Class TCustomerFields
+
+#Region "Private fields"
+ Private _texts As List(Of TCustomerText)
+
+ Private _dates As List(Of TCustomerDate)
+
+ Private _flags As List(Of TCustomerFlag)
+
+ Private _numbers As List(Of TCustomerNumber)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._numbers = New List(Of TCustomerNumber)()
+ Me._flags = New List(Of TCustomerFlag)()
+ Me._dates = New List(Of TCustomerDate)()
+ Me._texts = New List(Of TCustomerText)()
+ End Sub
+
+
+ Public Property texts() As List(Of TCustomerText)
+ Get
+ Return Me._texts
+ End Get
+ Set
+ Me._texts = Value
+ End Set
+ End Property
+
+
+ Public Property dates() As List(Of TCustomerDate)
+ Get
+ Return Me._dates
+ End Get
+ Set
+ Me._dates = Value
+ End Set
+ End Property
+
+
+ Public Property flags() As List(Of TCustomerFlag)
+ Get
+ Return Me._flags
+ End Get
+ Set
+ Me._flags = Value
+ End Set
+ End Property
+
+
+ Public Property numbers() As List(Of TCustomerNumber)
+ Get
+ Return Me._numbers
+ End Get
+ Set
+ Me._numbers = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TCustomerFields))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerFields 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()
+ 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 TCustomerFields object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerFields 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 TCustomerFields, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFields)
+ 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 TCustomerFields) 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 TCustomerFields
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerFields)
+ 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 TCustomerFields
+ Return CType(SerializerXml.Deserialize(s), TCustomerFields)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerFields 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 TCustomerFields object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerFields 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 TCustomerFields, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFields)
+ 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 TCustomerFields) 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 TCustomerFields
+ 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 TCustomerText
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = 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(TCustomerText))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerText 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()
+ 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 TCustomerText object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerText 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 TCustomerText, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerText)
+ 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 TCustomerText) 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 TCustomerText
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerText)
+ 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 TCustomerText
+ Return CType(SerializerXml.Deserialize(s), TCustomerText)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerText 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 TCustomerText object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerText 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 TCustomerText, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerText)
+ 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 TCustomerText) 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 TCustomerText
+ 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 TCustomerDate
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Date
+ 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(TCustomerDate))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerDate 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()
+ 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 TCustomerDate object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerDate 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 TCustomerDate, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerDate)
+ 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 TCustomerDate) 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 TCustomerDate
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerDate)
+ 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 TCustomerDate
+ Return CType(SerializerXml.Deserialize(s), TCustomerDate)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerDate 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 TCustomerDate object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerDate 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 TCustomerDate, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerDate)
+ 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 TCustomerDate) 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 TCustomerDate
+ 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 TCustomerFlag
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Boolean
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Boolean
+ 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(TCustomerFlag))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerFlag 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()
+ 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 TCustomerFlag object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerFlag 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 TCustomerFlag, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFlag)
+ 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 TCustomerFlag) 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 TCustomerFlag
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerFlag)
+ 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 TCustomerFlag
+ Return CType(SerializerXml.Deserialize(s), TCustomerFlag)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerFlag 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 TCustomerFlag object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerFlag 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 TCustomerFlag, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFlag)
+ 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 TCustomerFlag) 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 TCustomerFlag
+ 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 TCustomerNumber
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Decimal
+ 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(TCustomerNumber))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerNumber 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()
+ 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 TCustomerNumber object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerNumber 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 TCustomerNumber, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerNumber)
+ 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 TCustomerNumber) 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 TCustomerNumber
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerNumber)
+ 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 TCustomerNumber
+ Return CType(SerializerXml.Deserialize(s), TCustomerNumber)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerNumber 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 TCustomerNumber object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerNumber 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 TCustomerNumber, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerNumber)
+ 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 TCustomerNumber) 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 TCustomerNumber
+ 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 TAttribute
+
+#Region "Private fields"
+ Private _attribType As String
+
+ Private _attribText As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property attribType() As String
+ Get
+ Return Me._attribType
+ End Get
+ Set
+ Me._attribType = Value
+ End Set
+ End Property
+
+ Public Property attribText() As String
+ Get
+ Return Me._attribText
+ End Get
+ Set
+ Me._attribText = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAttribute))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAttribute 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()
+ 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 TAttribute object
+ '''
+ ''' string to deserialize
+ ''' Output TAttribute 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 TAttribute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAttribute)
+ 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 TAttribute) 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 TAttribute
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAttribute)
+ 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 TAttribute
+ Return CType(SerializerXml.Deserialize(s), TAttribute)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAttribute 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 TAttribute object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAttribute 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 TAttribute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAttribute)
+ 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 TAttribute) 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 TAttribute
+ 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 TContainer
+
+#Region "Private fields"
+ Private _contNo As String
+
+ Private _contType As String
+
+ Private _sealNumber As String
+
+ Private _goodsReference As List(Of TContainerGoodsReference)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._goodsReference = New List(Of TContainerGoodsReference)()
+ End Sub
+
+ Public Property contNo() As String
+ Get
+ Return Me._contNo
+ End Get
+ Set
+ Me._contNo = Value
+ End Set
+ End Property
+
+ Public Property contType() As String
+ Get
+ Return Me._contType
+ End Get
+ Set
+ Me._contType = Value
+ End Set
+ End Property
+
+ Public Property sealNumber() As String
+ Get
+ Return Me._sealNumber
+ End Get
+ Set
+ Me._sealNumber = Value
+ End Set
+ End Property
+
+
+ Public Property goodsReference() As List(Of TContainerGoodsReference)
+ Get
+ Return Me._goodsReference
+ End Get
+ Set
+ Me._goodsReference = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContainer))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContainer 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()
+ 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 TContainer object
+ '''
+ ''' string to deserialize
+ ''' Output TContainer 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 TContainer, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainer)
+ 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 TContainer) 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 TContainer
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContainer)
+ 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 TContainer
+ Return CType(SerializerXml.Deserialize(s), TContainer)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContainer 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 TContainer object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContainer 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 TContainer, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainer)
+ 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 TContainer) 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 TContainer
+ 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 TContainerGoodsReference
+
+#Region "Private fields"
+ Private _itemNumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property itemNumber() As String
+ Get
+ Return Me._itemNumber
+ End Get
+ Set
+ Me._itemNumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContainerGoodsReference))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContainerGoodsReference 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()
+ 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 TContainerGoodsReference object
+ '''
+ ''' string to deserialize
+ ''' Output TContainerGoodsReference 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 TContainerGoodsReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainerGoodsReference)
+ 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 TContainerGoodsReference) 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 TContainerGoodsReference
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContainerGoodsReference)
+ 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 TContainerGoodsReference
+ Return CType(SerializerXml.Deserialize(s), TContainerGoodsReference)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContainerGoodsReference 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 TContainerGoodsReference object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContainerGoodsReference 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 TContainerGoodsReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainerGoodsReference)
+ 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 TContainerGoodsReference) 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 TContainerGoodsReference
+ 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 TInvoiceLineEndUserInEam
+
+
+ Item
+
+
+ Item0
+
+
+ Item1
+ End Enum
+
+
+ Partial Public Class TInvoiceLineShipTo
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrState As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private _addrKvb As String
+
+ Private _contactPerson As TContactPerson
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._contactPerson = New TContactPerson()
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrState() As String
+ Get
+ Return Me._addrState
+ End Get
+ Set
+ Me._addrState = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Public Property addrKvb() As String
+ Get
+ Return Me._addrKvb
+ End Get
+ Set
+ Me._addrKvb = Value
+ End Set
+ End Property
+
+ Public Property contactPerson() As TContactPerson
+ Get
+ Return Me._contactPerson
+ End Get
+ Set
+ Me._contactPerson = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineShipTo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineShipTo 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()
+ 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 TInvoiceLineShipTo object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineShipTo 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 TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo) 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 TInvoiceLineShipTo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineShipTo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineShipTo 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 TInvoiceLineShipTo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineShipTo 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 TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo) 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 TInvoiceLineShipTo
+ 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 TContactPerson
+
+#Region "Private fields"
+ Private _job As String
+
+ Private _name As String
+
+ Private _email As String
+
+ Private _phone As String
+
+ Private _fax As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property job() As String
+ Get
+ Return Me._job
+ End Get
+ Set
+ Me._job = Value
+ End Set
+ End Property
+
+ Public Property name() As String
+ Get
+ Return Me._name
+ End Get
+ Set
+ Me._name = Value
+ End Set
+ End Property
+
+ Public Property email() As String
+ Get
+ Return Me._email
+ End Get
+ Set
+ Me._email = Value
+ End Set
+ End Property
+
+ Public Property phone() As String
+ Get
+ Return Me._phone
+ End Get
+ Set
+ Me._phone = Value
+ End Set
+ End Property
+
+ Public Property fax() As String
+ Get
+ Return Me._fax
+ End Get
+ Set
+ Me._fax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContactPerson))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContactPerson 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()
+ 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 TContactPerson object
+ '''
+ ''' string to deserialize
+ ''' Output TContactPerson 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 TContactPerson, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContactPerson)
+ 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 TContactPerson) 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 TContactPerson
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContactPerson)
+ 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 TContactPerson
+ Return CType(SerializerXml.Deserialize(s), TContactPerson)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContactPerson 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 TContactPerson object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContactPerson 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 TContactPerson, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContactPerson)
+ 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 TContactPerson) 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 TContactPerson
+ 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 TInvoiceLineEndUser
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineEndUser))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineEndUser 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()
+ 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 TInvoiceLineEndUser object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineEndUser 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 TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineEndUser)
+ 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 TInvoiceLineEndUser) 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 TInvoiceLineEndUser
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineEndUser)
+ 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 TInvoiceLineEndUser
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineEndUser)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineEndUser 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 TInvoiceLineEndUser object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineEndUser 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 TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineEndUser)
+ 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 TInvoiceLineEndUser) 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 TInvoiceLineEndUser
+ 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 TInvoiceLineOutwardProcessing
+
+#Region "Private fields"
+ Private _replacement As String
+
+ Private _reimportDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property replacement() As String
+ Get
+ Return Me._replacement
+ End Get
+ Set
+ Me._replacement = Value
+ End Set
+ End Property
+
+
+ Public Property reimportDate() As Date
+ Get
+ Return Me._reimportDate
+ End Get
+ Set
+ Me._reimportDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineOutwardProcessing))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineOutwardProcessing 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()
+ 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 TInvoiceLineOutwardProcessing object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineOutwardProcessing 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 TInvoiceLineOutwardProcessing, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineOutwardProcessing)
+ 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 TInvoiceLineOutwardProcessing) 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 TInvoiceLineOutwardProcessing
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineOutwardProcessing)
+ 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 TInvoiceLineOutwardProcessing
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineOutwardProcessing)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineOutwardProcessing 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 TInvoiceLineOutwardProcessing object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineOutwardProcessing 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 TInvoiceLineOutwardProcessing, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineOutwardProcessing)
+ 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 TInvoiceLineOutwardProcessing) 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 TInvoiceLineOutwardProcessing
+ 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 TPartner
+
+#Region "Private fields"
+ Private _partnerTyp As String
+
+ Private _partnerAddress As TPartnerPartnerAddress
+
+ Private _partnerRelation As String
+
+ Private _customerFields As TCustomerFields
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._customerFields = New TCustomerFields()
+ Me._partnerAddress = New TPartnerPartnerAddress()
+ End Sub
+
+ Public Property partnerTyp() As String
+ Get
+ Return Me._partnerTyp
+ End Get
+ Set
+ Me._partnerTyp = Value
+ End Set
+ End Property
+
+ Public Property partnerAddress() As TPartnerPartnerAddress
+ Get
+ Return Me._partnerAddress
+ End Get
+ Set
+ Me._partnerAddress = Value
+ End Set
+ End Property
+
+ Public Property partnerRelation() As String
+ Get
+ Return Me._partnerRelation
+ End Get
+ Set
+ Me._partnerRelation = Value
+ End Set
+ End Property
+
+ Public Property customerFields() As TCustomerFields
+ Get
+ Return Me._customerFields
+ End Get
+ Set
+ Me._customerFields = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPartner))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPartner 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()
+ 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 TPartner object
+ '''
+ ''' string to deserialize
+ ''' Output TPartner 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 TPartner, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPartner)
+ 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 TPartner) 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 TPartner
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPartner)
+ 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 TPartner
+ Return CType(SerializerXml.Deserialize(s), TPartner)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPartner 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 TPartner object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPartner 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 TPartner, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPartner)
+ 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 TPartner) 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 TPartner
+ 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 TPartnerPartnerAddress
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrNoType As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrStreet2 As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrState As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private _addrKvb As String
+
+ Private _addrInfo As String
+
+ Private _addrRole As String
+
+ Private _contactPerson As TContactPerson
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._contactPerson = New TContactPerson()
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+ Public Property addrNoType() As String
+ Get
+ Return Me._addrNoType
+ End Get
+ Set
+ Me._addrNoType = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrStreet2() As String
+ Get
+ Return Me._addrStreet2
+ End Get
+ Set
+ Me._addrStreet2 = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrState() As String
+ Get
+ Return Me._addrState
+ End Get
+ Set
+ Me._addrState = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Public Property addrKvb() As String
+ Get
+ Return Me._addrKvb
+ End Get
+ Set
+ Me._addrKvb = Value
+ End Set
+ End Property
+
+ Public Property addrInfo() As String
+ Get
+ Return Me._addrInfo
+ End Get
+ Set
+ Me._addrInfo = Value
+ End Set
+ End Property
+
+ Public Property addrRole() As String
+ Get
+ Return Me._addrRole
+ End Get
+ Set
+ Me._addrRole = Value
+ End Set
+ End Property
+
+ Public Property contactPerson() As TContactPerson
+ Get
+ Return Me._contactPerson
+ End Get
+ Set
+ Me._contactPerson = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPartnerPartnerAddress))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPartnerPartnerAddress 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()
+ 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 TPartnerPartnerAddress object
+ '''
+ ''' string to deserialize
+ ''' Output TPartnerPartnerAddress 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 TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPartnerPartnerAddress)
+ 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 TPartnerPartnerAddress) 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 TPartnerPartnerAddress
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPartnerPartnerAddress)
+ 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 TPartnerPartnerAddress
+ Return CType(SerializerXml.Deserialize(s), TPartnerPartnerAddress)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPartnerPartnerAddress 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 TPartnerPartnerAddress object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPartnerPartnerAddress 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 TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPartnerPartnerAddress)
+ 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 TPartnerPartnerAddress) 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 TPartnerPartnerAddress
+ 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 TAuthorisation
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _referenceNumber As String
+
+ Private _id As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber() As String
+ Get
+ Return Me._referenceNumber
+ End Get
+ Set
+ Me._referenceNumber = Value
+ End Set
+ End Property
+
+ Public Property id() As String
+ Get
+ Return Me._id
+ End Get
+ Set
+ Me._id = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAuthorisation))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAuthorisation 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()
+ 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 TAuthorisation object
+ '''
+ ''' string to deserialize
+ ''' Output TAuthorisation 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 TAuthorisation, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAuthorisation)
+ 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 TAuthorisation) 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 TAuthorisation
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAuthorisation)
+ 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 TAuthorisation
+ Return CType(SerializerXml.Deserialize(s), TAuthorisation)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAuthorisation 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 TAuthorisation object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAuthorisation 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 TAuthorisation, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAuthorisation)
+ 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 TAuthorisation) 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 TAuthorisation
+ 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 TInvoiceLineEudr
+
+#Region "Private fields"
+ Private _supplierNumber As String
+
+ Private _countryOfProduction As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property supplierNumber() As String
+ Get
+ Return Me._supplierNumber
+ End Get
+ Set
+ Me._supplierNumber = Value
+ End Set
+ End Property
+
+ Public Property countryOfProduction() As String
+ Get
+ Return Me._countryOfProduction
+ End Get
+ Set
+ Me._countryOfProduction = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineEudr))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineEudr 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()
+ 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 TInvoiceLineEudr object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineEudr 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 TInvoiceLineEudr, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineEudr)
+ 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 TInvoiceLineEudr) 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 TInvoiceLineEudr
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineEudr)
+ 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 TInvoiceLineEudr
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineEudr)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineEudr 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 TInvoiceLineEudr object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineEudr 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 TInvoiceLineEudr, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineEudr)
+ 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 TInvoiceLineEudr) 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 TInvoiceLineEudr
+ 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 TDelTerm
+
+#Region "Private fields"
+ Private _code As String
+
+ Private _unlocode As String
+
+ Private _desc As String
+
+ Private _country As String
+
+ Private _text As String
+
+ Private _code2 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 unlocode() As String
+ Get
+ Return Me._unlocode
+ End Get
+ Set
+ Me._unlocode = Value
+ End Set
+ End Property
+
+ Public Property desc() As String
+ Get
+ Return Me._desc
+ End Get
+ Set
+ Me._desc = Value
+ End Set
+ End Property
+
+ Public Property country() As String
+ Get
+ Return Me._country
+ End Get
+ Set
+ Me._country = Value
+ End Set
+ End Property
+
+ Public Property text() As String
+ Get
+ Return Me._text
+ End Get
+ Set
+ Me._text = Value
+ End Set
+ End Property
+
+ Public Property code2() As String
+ Get
+ Return Me._code2
+ End Get
+ Set
+ Me._code2 = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDelTerm))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDelTerm 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()
+ 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 TDelTerm object
+ '''
+ ''' string to deserialize
+ ''' Output TDelTerm 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 TDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelTerm)
+ 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 TDelTerm) 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 TDelTerm
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDelTerm)
+ 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 TDelTerm
+ Return CType(SerializerXml.Deserialize(s), TDelTerm)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDelTerm 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 TDelTerm object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDelTerm 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 TDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelTerm)
+ 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 TDelTerm) 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 TDelTerm
+ 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 TAddress
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrState As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrVatId As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private _addrKvb As String
+
+ Private _contactPerson As TContactPerson
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._contactPerson = New TContactPerson()
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrState() As String
+ Get
+ Return Me._addrState
+ End Get
+ Set
+ Me._addrState = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrVatId() As String
+ Get
+ Return Me._addrVatId
+ End Get
+ Set
+ Me._addrVatId = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Public Property addrKvb() As String
+ Get
+ Return Me._addrKvb
+ End Get
+ Set
+ Me._addrKvb = Value
+ End Set
+ End Property
+
+ Public Property contactPerson() As TContactPerson
+ Get
+ Return Me._contactPerson
+ End Get
+ Set
+ Me._contactPerson = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAddress))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAddress 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()
+ 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 TAddress object
+ '''
+ ''' string to deserialize
+ ''' Output TAddress 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 TAddress, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddress)
+ 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 TAddress) 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 TAddress
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAddress)
+ 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 TAddress
+ Return CType(SerializerXml.Deserialize(s), TAddress)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAddress 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 TAddress object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAddress 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 TAddress, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddress)
+ 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 TAddress) 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 TAddress
+ 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 TInvoiceHead
+
+#Region "Private fields"
+ Private _invoiceNo As String
+
+ Private _invoiceVersion As String
+
+ Private _invoiceDate As Date
+
+ Private _invType As String
+
+ Private _totAmount As Decimal
+
+ Private _curr As String
+
+ Private _exchangeRate As Decimal
+
+ Private _shipTo As TAddress
+
+ Private _endUser As TInvoiceHeadEndUser
+
+ Private _delTerm As TDelTerm
+
+ Private _billTo As TAddress
+
+ Private _ref As String
+
+ Private _tradeCtry As String
+
+ Private _gWeight As Decimal
+
+ Private _nWeight As Decimal
+
+ Private _addCosts As List(Of TAddCosts)
+
+ Private _bol As String
+
+ Private _transpNr As String
+
+ Private _addtext As List(Of String)
+
+ Private _documents As List(Of TDocuments)
+
+ Private _mrnExt As String
+
+ Private _numberOfPackages As Decimal
+
+ Private _packageDescription As String
+
+ Private _transportType As String
+
+ Private _invoiceReferenceNumber As String
+
+ Private _nctsIndicator As Boolean
+
+ Private _deliveryType As String
+
+ Private _crossingBorderDate As Date
+
+ Private _customerFields As TCustomerFields
+
+ Private _partners As List(Of TPartner)
+
+ Private _attributes As List(Of TAttribute)
+
+ Private _natureOfTransaction As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._attributes = New List(Of TAttribute)()
+ Me._partners = New List(Of TPartner)()
+ Me._customerFields = New TCustomerFields()
+ Me._documents = New List(Of TDocuments)()
+ Me._addtext = New List(Of String)()
+ Me._addCosts = New List(Of TAddCosts)()
+ Me._billTo = New TAddress()
+ Me._delTerm = New TDelTerm()
+ Me._endUser = New TInvoiceHeadEndUser()
+ Me._shipTo = New TAddress()
+ Me._invoiceVersion = "1"
+ End Sub
+
+ Public Property invoiceNo() As String
+ Get
+ Return Me._invoiceNo
+ End Get
+ Set
+ Me._invoiceNo = Value
+ End Set
+ End Property
+
+
+ Public Property invoiceVersion() As String
+ Get
+ Return Me._invoiceVersion
+ End Get
+ Set
+ Me._invoiceVersion = Value
+ End Set
+ End Property
+
+
+ Public Property invoiceDate() As Date
+ Get
+ Return Me._invoiceDate
+ End Get
+ Set
+ Me._invoiceDate = Value
+ End Set
+ End Property
+
+ Public Property invType() As String
+ Get
+ Return Me._invType
+ End Get
+ Set
+ Me._invType = Value
+ End Set
+ End Property
+
+ Public Property totAmount() As Decimal
+ Get
+ Return Me._totAmount
+ End Get
+ Set
+ Me._totAmount = Value
+ End Set
+ End Property
+
+ Public Property curr() As String
+ Get
+ Return Me._curr
+ End Get
+ Set
+ Me._curr = Value
+ End Set
+ End Property
+
+ Public Property exchangeRate() As Decimal
+ Get
+ Return Me._exchangeRate
+ End Get
+ Set
+ Me._exchangeRate = Value
+ End Set
+ End Property
+
+ Public Property shipTo() As TAddress
+ Get
+ Return Me._shipTo
+ End Get
+ Set
+ Me._shipTo = Value
+ End Set
+ End Property
+
+ Public Property endUser() As TInvoiceHeadEndUser
+ Get
+ Return Me._endUser
+ End Get
+ Set
+ Me._endUser = Value
+ End Set
+ End Property
+
+ Public Property delTerm() As TDelTerm
+ Get
+ Return Me._delTerm
+ End Get
+ Set
+ Me._delTerm = Value
+ End Set
+ End Property
+
+ Public Property billTo() As TAddress
+ Get
+ Return Me._billTo
+ End Get
+ Set
+ Me._billTo = Value
+ End Set
+ End Property
+
+ Public Property ref() As String
+ Get
+ Return Me._ref
+ End Get
+ Set
+ Me._ref = Value
+ End Set
+ End Property
+
+ Public Property tradeCtry() As String
+ Get
+ Return Me._tradeCtry
+ End Get
+ Set
+ Me._tradeCtry = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+
+ Public Property addCosts() As List(Of TAddCosts)
+ Get
+ Return Me._addCosts
+ End Get
+ Set
+ Me._addCosts = Value
+ End Set
+ End Property
+
+ Public Property bol() As String
+ Get
+ Return Me._bol
+ End Get
+ Set
+ Me._bol = Value
+ End Set
+ End Property
+
+ Public Property transpNr() As String
+ Get
+ Return Me._transpNr
+ End Get
+ Set
+ Me._transpNr = Value
+ End Set
+ End Property
+
+
+ Public Property addtext() As List(Of String)
+ Get
+ Return Me._addtext
+ End Get
+ Set
+ Me._addtext = Value
+ End Set
+ End Property
+
+
+ Public Property documents() As List(Of TDocuments)
+ Get
+ Return Me._documents
+ End Get
+ Set
+ Me._documents = Value
+ End Set
+ End Property
+
+ Public Property mrnExt() As String
+ Get
+ Return Me._mrnExt
+ End Get
+ Set
+ Me._mrnExt = Value
+ End Set
+ End Property
+
+ Public Property numberOfPackages() As Decimal
+ Get
+ Return Me._numberOfPackages
+ End Get
+ Set
+ Me._numberOfPackages = Value
+ End Set
+ End Property
+
+ Public Property packageDescription() As String
+ Get
+ Return Me._packageDescription
+ End Get
+ Set
+ Me._packageDescription = Value
+ End Set
+ End Property
+
+ Public Property transportType() As String
+ Get
+ Return Me._transportType
+ End Get
+ Set
+ Me._transportType = Value
+ End Set
+ End Property
+
+ Public Property invoiceReferenceNumber() As String
+ Get
+ Return Me._invoiceReferenceNumber
+ End Get
+ Set
+ Me._invoiceReferenceNumber = Value
+ End Set
+ End Property
+
+ Public Property nctsIndicator() As Boolean
+ Get
+ Return Me._nctsIndicator
+ End Get
+ Set
+ Me._nctsIndicator = Value
+ End Set
+ End Property
+
+ Public Property deliveryType() As String
+ Get
+ Return Me._deliveryType
+ End Get
+ Set
+ Me._deliveryType = Value
+ End Set
+ End Property
+
+
+ Public Property crossingBorderDate() As Date
+ Get
+ Return Me._crossingBorderDate
+ End Get
+ Set
+ Me._crossingBorderDate = Value
+ End Set
+ End Property
+
+ Public Property customerFields() As TCustomerFields
+ Get
+ Return Me._customerFields
+ End Get
+ Set
+ Me._customerFields = Value
+ End Set
+ End Property
+
+
+ Public Property partners() As List(Of TPartner)
+ Get
+ Return Me._partners
+ End Get
+ Set
+ Me._partners = Value
+ End Set
+ End Property
+
+
+ Public Property attributes() As List(Of TAttribute)
+ Get
+ Return Me._attributes
+ End Get
+ Set
+ Me._attributes = Value
+ End Set
+ End Property
+
+ Public Property natureOfTransaction() As String
+ Get
+ Return Me._natureOfTransaction
+ End Get
+ Set
+ Me._natureOfTransaction = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceHead))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceHead 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()
+ 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 TInvoiceHead object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceHead 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 TInvoiceHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceHead)
+ 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 TInvoiceHead) 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 TInvoiceHead
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceHead)
+ 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 TInvoiceHead
+ Return CType(SerializerXml.Deserialize(s), TInvoiceHead)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceHead 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 TInvoiceHead object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceHead 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 TInvoiceHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceHead)
+ 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 TInvoiceHead) 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 TInvoiceHead
+ 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 TInvoiceHeadEndUser
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceHeadEndUser))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceHeadEndUser 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()
+ 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 TInvoiceHeadEndUser object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceHeadEndUser 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 TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceHeadEndUser)
+ 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 TInvoiceHeadEndUser) 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 TInvoiceHeadEndUser
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceHeadEndUser)
+ 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 TInvoiceHeadEndUser
+ Return CType(SerializerXml.Deserialize(s), TInvoiceHeadEndUser)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceHeadEndUser 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 TInvoiceHeadEndUser object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceHeadEndUser 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 TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceHeadEndUser)
+ 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 TInvoiceHeadEndUser) 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 TInvoiceHeadEndUser
+ 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 TInvoice
+
+#Region "Private fields"
+ Private _invoiceHead As TInvoiceHead
+
+ Private _invoiceLine As List(Of TInvoiceLine)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._invoiceLine = New List(Of TInvoiceLine)()
+ Me._invoiceHead = New TInvoiceHead()
+ End Sub
+
+ Public Property InvoiceHead() As TInvoiceHead
+ Get
+ Return Me._invoiceHead
+ End Get
+ Set
+ Me._invoiceHead = Value
+ End Set
+ End Property
+
+
+ Public Property InvoiceLine() As List(Of TInvoiceLine)
+ Get
+ Return Me._invoiceLine
+ End Get
+ Set
+ Me._invoiceLine = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoice))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoice 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()
+ 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 TInvoice object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoice 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 TInvoice, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoice)
+ 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 TInvoice) 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 TInvoice
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoice)
+ 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 TInvoice
+ Return CType(SerializerXml.Deserialize(s), TInvoice)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoice 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 TInvoice object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoice 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 TInvoice, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoice)
+ 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 TInvoice) 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 TInvoice
+ 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 TShipmentPreviousDocument
+
+#Region "Private fields"
+ Private _docType As String
+
+ Private _docQual As String
+
+ Private _docNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property docType() As String
+ Get
+ Return Me._docType
+ End Get
+ Set
+ Me._docType = Value
+ End Set
+ End Property
+
+ Public Property docQual() As String
+ Get
+ Return Me._docQual
+ End Get
+ Set
+ Me._docQual = Value
+ End Set
+ End Property
+
+ Public Property docNo() As String
+ Get
+ Return Me._docNo
+ End Get
+ Set
+ Me._docNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentPreviousDocument))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentPreviousDocument 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()
+ 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 TShipmentPreviousDocument object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentPreviousDocument 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 TShipmentPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentPreviousDocument)
+ 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 TShipmentPreviousDocument) 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 TShipmentPreviousDocument
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentPreviousDocument)
+ 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 TShipmentPreviousDocument
+ Return CType(SerializerXml.Deserialize(s), TShipmentPreviousDocument)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentPreviousDocument 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 TShipmentPreviousDocument object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentPreviousDocument 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 TShipmentPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentPreviousDocument)
+ 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 TShipmentPreviousDocument) 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 TShipmentPreviousDocument
+ 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 TErpShipmentData
+
+#Region "Private fields"
+ Private _erpSystemId As String
+
+ Private _client As String
+
+ Private _companyCode As String
+
+ Private _customerId As String
+
+ Private _consolidationCompanyId As String
+
+ Private _accountGroup As String
+
+ Private _shippingPoint As String
+
+ Private _loadingPoint As String
+
+ Private _offshore As Boolean
+
+ Private _route As String
+
+ Private _salesOrganization As String
+
+ Private _distributionChannel As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property erpSystemId() As String
+ Get
+ Return Me._erpSystemId
+ End Get
+ Set
+ Me._erpSystemId = Value
+ End Set
+ End Property
+
+ Public Property client() As String
+ Get
+ Return Me._client
+ End Get
+ Set
+ Me._client = Value
+ End Set
+ End Property
+
+ Public Property companyCode() As String
+ Get
+ Return Me._companyCode
+ End Get
+ Set
+ Me._companyCode = Value
+ End Set
+ End Property
+
+ Public Property customerId() As String
+ Get
+ Return Me._customerId
+ End Get
+ Set
+ Me._customerId = Value
+ End Set
+ End Property
+
+ Public Property consolidationCompanyId() As String
+ Get
+ Return Me._consolidationCompanyId
+ End Get
+ Set
+ Me._consolidationCompanyId = Value
+ End Set
+ End Property
+
+ Public Property accountGroup() As String
+ Get
+ Return Me._accountGroup
+ End Get
+ Set
+ Me._accountGroup = Value
+ End Set
+ End Property
+
+ Public Property shippingPoint() As String
+ Get
+ Return Me._shippingPoint
+ End Get
+ Set
+ Me._shippingPoint = Value
+ End Set
+ End Property
+
+ Public Property loadingPoint() As String
+ Get
+ Return Me._loadingPoint
+ End Get
+ Set
+ Me._loadingPoint = Value
+ End Set
+ End Property
+
+ Public Property offshore() As Boolean
+ Get
+ Return Me._offshore
+ End Get
+ Set
+ Me._offshore = Value
+ End Set
+ End Property
+
+ Public Property route() As String
+ Get
+ Return Me._route
+ End Get
+ Set
+ Me._route = Value
+ End Set
+ End Property
+
+ Public Property salesOrganization() As String
+ Get
+ Return Me._salesOrganization
+ End Get
+ Set
+ Me._salesOrganization = Value
+ End Set
+ End Property
+
+ Public Property distributionChannel() As String
+ Get
+ Return Me._distributionChannel
+ End Get
+ Set
+ Me._distributionChannel = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TErpShipmentData))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErpShipmentData 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()
+ 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 TErpShipmentData object
+ '''
+ ''' string to deserialize
+ ''' Output TErpShipmentData 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 TErpShipmentData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpShipmentData)
+ 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 TErpShipmentData) 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 TErpShipmentData
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErpShipmentData)
+ 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 TErpShipmentData
+ Return CType(SerializerXml.Deserialize(s), TErpShipmentData)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErpShipmentData 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 TErpShipmentData object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErpShipmentData 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 TErpShipmentData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpShipmentData)
+ 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 TErpShipmentData) 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 TErpShipmentData
+ 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 TStateOfAffairs
+
+#Region "Private fields"
+ Private _stateOfAffairsCode As List(Of String)
+
+ Private _text As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._stateOfAffairsCode = New List(Of String)()
+ End Sub
+
+
+ Public Property stateOfAffairsCode() As List(Of String)
+ Get
+ Return Me._stateOfAffairsCode
+ End Get
+ Set
+ Me._stateOfAffairsCode = Value
+ End Set
+ End Property
+
+ Public Property text() As String
+ Get
+ Return Me._text
+ End Get
+ Set
+ Me._text = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TStateOfAffairs))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TStateOfAffairs 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()
+ 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 TStateOfAffairs object
+ '''
+ ''' string to deserialize
+ ''' Output TStateOfAffairs 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 TStateOfAffairs, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TStateOfAffairs)
+ 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 TStateOfAffairs) 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 TStateOfAffairs
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TStateOfAffairs)
+ 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 TStateOfAffairs
+ Return CType(SerializerXml.Deserialize(s), TStateOfAffairs)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TStateOfAffairs 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 TStateOfAffairs object
+ '''
+ ''' File to load and deserialize
+ ''' Output TStateOfAffairs 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 TStateOfAffairs, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TStateOfAffairs)
+ 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 TStateOfAffairs) 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 TStateOfAffairs
+ 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 TRoute
+
+#Region "Private fields"
+ Private _country As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property country() As String
+ Get
+ Return Me._country
+ End Get
+ Set
+ Me._country = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRoute))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TRoute 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()
+ 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 TRoute object
+ '''
+ ''' string to deserialize
+ ''' Output TRoute 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 TRoute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRoute)
+ 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 TRoute) 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 TRoute
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRoute)
+ 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 TRoute
+ Return CType(SerializerXml.Deserialize(s), TRoute)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TRoute 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 TRoute object
+ '''
+ ''' File to load and deserialize
+ ''' Output TRoute 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 TRoute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRoute)
+ 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 TRoute) 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 TRoute
+ 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 TAssurance
+
+#Region "Private fields"
+ Private _flag As String
+
+ Private _amount As Decimal
+
+ Private _curr As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property flag() As String
+ Get
+ Return Me._flag
+ End Get
+ Set
+ Me._flag = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property curr() As String
+ Get
+ Return Me._curr
+ End Get
+ Set
+ Me._curr = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAssurance))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAssurance 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()
+ 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 TAssurance object
+ '''
+ ''' string to deserialize
+ ''' Output TAssurance 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 TAssurance, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAssurance)
+ 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 TAssurance) 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 TAssurance
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAssurance)
+ 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 TAssurance
+ Return CType(SerializerXml.Deserialize(s), TAssurance)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAssurance 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 TAssurance object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAssurance 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 TAssurance, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAssurance)
+ 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 TAssurance) 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 TAssurance
+ 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 TFreight
+
+#Region "Private fields"
+ Private _flag As String
+
+ Private _amount As Decimal
+
+ Private _curr As String
+
+ Private _noneu As Decimal
+
+ Private _eunat As Decimal
+
+ Private _nat As Decimal
+
+ Private _frtInternationalAbs As Decimal
+
+ Private _frtIntCurrency As String
+
+ Private _frtCommunityAbs As Decimal
+
+ Private _frtCommunityCurrency As String
+
+ Private _frtNatAbs As Decimal
+
+ Private _frtNatCurrency As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property flag() As String
+ Get
+ Return Me._flag
+ End Get
+ Set
+ Me._flag = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property curr() As String
+ Get
+ Return Me._curr
+ End Get
+ Set
+ Me._curr = Value
+ End Set
+ End Property
+
+ Public Property noneu() As Decimal
+ Get
+ Return Me._noneu
+ End Get
+ Set
+ Me._noneu = Value
+ End Set
+ End Property
+
+ Public Property eunat() As Decimal
+ Get
+ Return Me._eunat
+ End Get
+ Set
+ Me._eunat = Value
+ End Set
+ End Property
+
+ Public Property nat() As Decimal
+ Get
+ Return Me._nat
+ End Get
+ Set
+ Me._nat = Value
+ End Set
+ End Property
+
+ Public Property frtInternationalAbs() As Decimal
+ Get
+ Return Me._frtInternationalAbs
+ End Get
+ Set
+ Me._frtInternationalAbs = Value
+ End Set
+ End Property
+
+ Public Property frtIntCurrency() As String
+ Get
+ Return Me._frtIntCurrency
+ End Get
+ Set
+ Me._frtIntCurrency = Value
+ End Set
+ End Property
+
+ Public Property frtCommunityAbs() As Decimal
+ Get
+ Return Me._frtCommunityAbs
+ End Get
+ Set
+ Me._frtCommunityAbs = Value
+ End Set
+ End Property
+
+ Public Property frtCommunityCurrency() As String
+ Get
+ Return Me._frtCommunityCurrency
+ End Get
+ Set
+ Me._frtCommunityCurrency = Value
+ End Set
+ End Property
+
+ Public Property frtNatAbs() As Decimal
+ Get
+ Return Me._frtNatAbs
+ End Get
+ Set
+ Me._frtNatAbs = Value
+ End Set
+ End Property
+
+ Public Property frtNatCurrency() As String
+ Get
+ Return Me._frtNatCurrency
+ End Get
+ Set
+ Me._frtNatCurrency = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TFreight))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TFreight 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()
+ 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 TFreight object
+ '''
+ ''' string to deserialize
+ ''' Output TFreight 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 TFreight, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TFreight)
+ 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 TFreight) 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 TFreight
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TFreight)
+ 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 TFreight
+ Return CType(SerializerXml.Deserialize(s), TFreight)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TFreight 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 TFreight object
+ '''
+ ''' File to load and deserialize
+ ''' Output TFreight 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 TFreight, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TFreight)
+ 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 TFreight) 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 TFreight
+ 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 TDeclType
+
+#Region "Private fields"
+ Private _type1 As String
+
+ Private _type2 As String
+
+ Private _type3 As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type1() As String
+ Get
+ Return Me._type1
+ End Get
+ Set
+ Me._type1 = Value
+ End Set
+ End Property
+
+ Public Property type2() As String
+ Get
+ Return Me._type2
+ End Get
+ Set
+ Me._type2 = Value
+ End Set
+ End Property
+
+ Public Property type3() As String
+ Get
+ Return Me._type3
+ End Get
+ Set
+ Me._type3 = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDeclType))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDeclType 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()
+ 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 TDeclType object
+ '''
+ ''' string to deserialize
+ ''' Output TDeclType 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 TDeclType, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDeclType)
+ 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 TDeclType) 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 TDeclType
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDeclType)
+ 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 TDeclType
+ Return CType(SerializerXml.Deserialize(s), TDeclType)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDeclType 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 TDeclType object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDeclType 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 TDeclType, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDeclType)
+ 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 TDeclType) 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 TDeclType
+ 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 TSeal
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _quantity As UInteger
+
+ Private _sign As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property quantity() As UInteger
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property sign() As String
+ Get
+ Return Me._sign
+ End Get
+ Set
+ Me._sign = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TSeal))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TSeal 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()
+ 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 TSeal object
+ '''
+ ''' string to deserialize
+ ''' Output TSeal 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 TSeal, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TSeal)
+ 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 TSeal) 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 TSeal
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TSeal)
+ 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 TSeal
+ Return CType(SerializerXml.Deserialize(s), TSeal)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TSeal 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 TSeal object
+ '''
+ ''' File to load and deserialize
+ ''' Output TSeal 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 TSeal, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TSeal)
+ 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 TSeal) 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 TSeal
+ 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 TMot
+
+#Region "Private fields"
+ Private _mot As String
+
+ Private _typeIdentBorder As Integer
+
+ Private _nat As String
+
+ Private _type As String
+
+ Private _licNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property mot() As String
+ Get
+ Return Me._mot
+ End Get
+ Set
+ Me._mot = Value
+ End Set
+ End Property
+
+ Public Property typeIdentBorder() As Integer
+ Get
+ Return Me._typeIdentBorder
+ End Get
+ Set
+ Me._typeIdentBorder = Value
+ End Set
+ End Property
+
+ Public Property nat() As String
+ Get
+ Return Me._nat
+ End Get
+ Set
+ Me._nat = 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 licNo() As String
+ Get
+ Return Me._licNo
+ End Get
+ Set
+ Me._licNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMot))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMot 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()
+ 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 TMot object
+ '''
+ ''' string to deserialize
+ ''' Output TMot 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 TMot, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMot)
+ 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 TMot) 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 TMot
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMot)
+ 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 TMot
+ Return CType(SerializerXml.Deserialize(s), TMot)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMot 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 TMot object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMot 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 TMot, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMot)
+ 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 TMot) 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 TMot
+ 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 TCustomsOffice
+
+#Region "Private fields"
+ Private _codeOff As String
+
+ Private _offCtry As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property codeOff() As String
+ Get
+ Return Me._codeOff
+ End Get
+ Set
+ Me._codeOff = Value
+ End Set
+ End Property
+
+ Public Property offCtry() As String
+ Get
+ Return Me._offCtry
+ End Get
+ Set
+ Me._offCtry = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TCustomsOffice))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomsOffice 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()
+ 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 TCustomsOffice object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomsOffice 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 TCustomsOffice, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomsOffice)
+ 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 TCustomsOffice) 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 TCustomsOffice
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomsOffice)
+ 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 TCustomsOffice
+ Return CType(SerializerXml.Deserialize(s), TCustomsOffice)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomsOffice 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 TCustomsOffice object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomsOffice 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 TCustomsOffice, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomsOffice)
+ 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 TCustomsOffice) 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 TCustomsOffice
+ 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 TGnss
+
+#Region "Private fields"
+ Private _latitude As String
+
+ Private _longitude As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property latitude() As String
+ Get
+ Return Me._latitude
+ End Get
+ Set
+ Me._latitude = Value
+ End Set
+ End Property
+
+ Public Property longitude() As String
+ Get
+ Return Me._longitude
+ End Get
+ Set
+ Me._longitude = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TGnss))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TGnss 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()
+ 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 TGnss object
+ '''
+ ''' string to deserialize
+ ''' Output TGnss 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 TGnss, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TGnss)
+ 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 TGnss) 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 TGnss
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TGnss)
+ 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 TGnss
+ Return CType(SerializerXml.Deserialize(s), TGnss)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TGnss 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 TGnss object
+ '''
+ ''' File to load and deserialize
+ ''' Output TGnss 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 TGnss, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TGnss)
+ 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 TGnss) 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 TGnss
+ 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 TLocationOfGoods
+
+#Region "Private fields"
+ Private _qual As String
+
+ Private _authNo As String
+
+ Private _additionIdentifier As String
+
+ Private _code As String
+
+ Private _gnss As TGnss
+
+ Private _street As String
+
+ Private _zip As String
+
+ Private _loc As String
+
+ Private _ctry As String
+
+ Private _name As String
+
+ Private _email As String
+
+ Private _phone As String
+
+ Private _addit As String
+
+ Private _type As String
+
+ Private _customsOffice As TCustomsOffice
+
+ Private _country As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._customsOffice = New TCustomsOffice()
+ Me._gnss = New TGnss()
+ End Sub
+
+ Public Property qual() As String
+ Get
+ Return Me._qual
+ End Get
+ Set
+ Me._qual = Value
+ End Set
+ End Property
+
+ Public Property authNo() As String
+ Get
+ Return Me._authNo
+ End Get
+ Set
+ Me._authNo = Value
+ End Set
+ End Property
+
+ Public Property additionIdentifier() As String
+ Get
+ Return Me._additionIdentifier
+ End Get
+ Set
+ Me._additionIdentifier = Value
+ End Set
+ End Property
+
+ Public Property code() As String
+ Get
+ Return Me._code
+ End Get
+ Set
+ Me._code = Value
+ End Set
+ End Property
+
+ Public Property gnss() As TGnss
+ Get
+ Return Me._gnss
+ End Get
+ Set
+ Me._gnss = Value
+ End Set
+ End Property
+
+ Public Property street() As String
+ Get
+ Return Me._street
+ End Get
+ Set
+ Me._street = Value
+ End Set
+ End Property
+
+ Public Property zip() As String
+ Get
+ Return Me._zip
+ End Get
+ Set
+ Me._zip = Value
+ End Set
+ End Property
+
+ Public Property loc() As String
+ Get
+ Return Me._loc
+ End Get
+ Set
+ Me._loc = Value
+ End Set
+ End Property
+
+ Public Property ctry() As String
+ Get
+ Return Me._ctry
+ End Get
+ Set
+ Me._ctry = Value
+ End Set
+ End Property
+
+ Public Property name() As String
+ Get
+ Return Me._name
+ End Get
+ Set
+ Me._name = Value
+ End Set
+ End Property
+
+ Public Property email() As String
+ Get
+ Return Me._email
+ End Get
+ Set
+ Me._email = Value
+ End Set
+ End Property
+
+ Public Property phone() As String
+ Get
+ Return Me._phone
+ End Get
+ Set
+ Me._phone = Value
+ End Set
+ End Property
+
+ Public Property addit() As String
+ Get
+ Return Me._addit
+ End Get
+ Set
+ Me._addit = 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 customsOffice() As TCustomsOffice
+ Get
+ Return Me._customsOffice
+ End Get
+ Set
+ Me._customsOffice = Value
+ End Set
+ End Property
+
+ Public Property country() As String
+ Get
+ Return Me._country
+ End Get
+ Set
+ Me._country = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TLocationOfGoods))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TLocationOfGoods 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()
+ 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 TLocationOfGoods object
+ '''
+ ''' string to deserialize
+ ''' Output TLocationOfGoods 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 TLocationOfGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TLocationOfGoods)
+ 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 TLocationOfGoods) 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 TLocationOfGoods
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TLocationOfGoods)
+ 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 TLocationOfGoods
+ Return CType(SerializerXml.Deserialize(s), TLocationOfGoods)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TLocationOfGoods 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 TLocationOfGoods object
+ '''
+ ''' File to load and deserialize
+ ''' Output TLocationOfGoods 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 TLocationOfGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TLocationOfGoods)
+ 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 TLocationOfGoods) 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 TLocationOfGoods
+ 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 TShipmentHeadAuthorisation
+
+#Region "Private fields"
+ Private _oprEntryInTheRecords As String
+
+ Private _opr As String
+
+ Private _trustworthyExporter As String
+
+ Private _authorisedExporter As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property oprEntryInTheRecords() As String
+ Get
+ Return Me._oprEntryInTheRecords
+ End Get
+ Set
+ Me._oprEntryInTheRecords = Value
+ End Set
+ End Property
+
+ Public Property opr() As String
+ Get
+ Return Me._opr
+ End Get
+ Set
+ Me._opr = Value
+ End Set
+ End Property
+
+ Public Property trustworthyExporter() As String
+ Get
+ Return Me._trustworthyExporter
+ End Get
+ Set
+ Me._trustworthyExporter = Value
+ End Set
+ End Property
+
+ Public Property authorisedExporter() As String
+ Get
+ Return Me._authorisedExporter
+ End Get
+ Set
+ Me._authorisedExporter = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadAuthorisation))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadAuthorisation 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()
+ 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 TShipmentHeadAuthorisation object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadAuthorisation 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 TShipmentHeadAuthorisation, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadAuthorisation)
+ 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 TShipmentHeadAuthorisation) 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 TShipmentHeadAuthorisation
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadAuthorisation)
+ 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 TShipmentHeadAuthorisation
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadAuthorisation)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadAuthorisation 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 TShipmentHeadAuthorisation object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadAuthorisation 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 TShipmentHeadAuthorisation, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadAuthorisation)
+ 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 TShipmentHeadAuthorisation) 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 TShipmentHeadAuthorisation
+ 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 TShipmentHeadPostExportDeclaration
+
+#Region "Private fields"
+ Private _dateOfExit As Date
+
+ Private _dateOfExport As Date
+
+ Private _statisticDecl As String
+
+ Private _officeExit As TCustomsOffice
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._officeExit = New TCustomsOffice()
+ End Sub
+
+ Public Property dateOfExit() As Date
+ Get
+ Return Me._dateOfExit
+ End Get
+ Set
+ Me._dateOfExit = Value
+ End Set
+ End Property
+
+ Public Property dateOfExport() As Date
+ Get
+ Return Me._dateOfExport
+ End Get
+ Set
+ Me._dateOfExport = Value
+ End Set
+ End Property
+
+ Public Property statisticDecl() As String
+ Get
+ Return Me._statisticDecl
+ End Get
+ Set
+ Me._statisticDecl = Value
+ End Set
+ End Property
+
+ Public Property officeExit() As TCustomsOffice
+ Get
+ Return Me._officeExit
+ End Get
+ Set
+ Me._officeExit = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadPostExportDeclaration))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadPostExportDeclaration 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()
+ 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 TShipmentHeadPostExportDeclaration object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadPostExportDeclaration 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 TShipmentHeadPostExportDeclaration, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadPostExportDeclaration)
+ 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 TShipmentHeadPostExportDeclaration) 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 TShipmentHeadPostExportDeclaration
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadPostExportDeclaration)
+ 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 TShipmentHeadPostExportDeclaration
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadPostExportDeclaration)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadPostExportDeclaration 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 TShipmentHeadPostExportDeclaration object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadPostExportDeclaration 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 TShipmentHeadPostExportDeclaration, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadPostExportDeclaration)
+ 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 TShipmentHeadPostExportDeclaration) 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 TShipmentHeadPostExportDeclaration
+ 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 TShipmentHeadOprData
+
+#Region "Private fields"
+ Private _reimportDeadline As Date
+
+ Private _standardExchange As String
+
+ Private _reImport As List(Of TShipmentHeadOprDataReImport)
+
+ Private _meansOfIdentification As List(Of TShipmentHeadOprDataMeansOfIdentification)
+
+ Private _product As List(Of TShipmentHeadOprDataProduct)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._product = New List(Of TShipmentHeadOprDataProduct)()
+ Me._meansOfIdentification = New List(Of TShipmentHeadOprDataMeansOfIdentification)()
+ Me._reImport = New List(Of TShipmentHeadOprDataReImport)()
+ End Sub
+
+ Public Property reimportDeadline() As Date
+ Get
+ Return Me._reimportDeadline
+ End Get
+ Set
+ Me._reimportDeadline = Value
+ End Set
+ End Property
+
+ Public Property standardExchange() As String
+ Get
+ Return Me._standardExchange
+ End Get
+ Set
+ Me._standardExchange = Value
+ End Set
+ End Property
+
+
+ Public Property reImport() As List(Of TShipmentHeadOprDataReImport)
+ Get
+ Return Me._reImport
+ End Get
+ Set
+ Me._reImport = Value
+ End Set
+ End Property
+
+
+ Public Property meansOfIdentification() As List(Of TShipmentHeadOprDataMeansOfIdentification)
+ Get
+ Return Me._meansOfIdentification
+ End Get
+ Set
+ Me._meansOfIdentification = Value
+ End Set
+ End Property
+
+
+ Public Property product() As List(Of TShipmentHeadOprDataProduct)
+ Get
+ Return Me._product
+ End Get
+ Set
+ Me._product = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadOprData))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadOprData 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()
+ 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 TShipmentHeadOprData object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadOprData 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 TShipmentHeadOprData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprData)
+ 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 TShipmentHeadOprData) 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 TShipmentHeadOprData
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadOprData)
+ 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 TShipmentHeadOprData
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadOprData)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadOprData 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 TShipmentHeadOprData object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadOprData 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 TShipmentHeadOprData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprData)
+ 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 TShipmentHeadOprData) 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 TShipmentHeadOprData
+ 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 TShipmentHeadOprDataReImport
+
+#Region "Private fields"
+ Private _ctry As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property ctry() As String
+ Get
+ Return Me._ctry
+ End Get
+ Set
+ Me._ctry = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadOprDataReImport))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadOprDataReImport 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()
+ 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 TShipmentHeadOprDataReImport object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadOprDataReImport 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 TShipmentHeadOprDataReImport, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataReImport)
+ 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 TShipmentHeadOprDataReImport) 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 TShipmentHeadOprDataReImport
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadOprDataReImport)
+ 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 TShipmentHeadOprDataReImport
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadOprDataReImport)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadOprDataReImport 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 TShipmentHeadOprDataReImport object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadOprDataReImport 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 TShipmentHeadOprDataReImport, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataReImport)
+ 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 TShipmentHeadOprDataReImport) 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 TShipmentHeadOprDataReImport
+ 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 TShipmentHeadOprDataMeansOfIdentification
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _description As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property description() As String
+ Get
+ Return Me._description
+ End Get
+ Set
+ Me._description = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadOprDataMeansOfIdentification))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadOprDataMeansOfIdentification 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()
+ 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 TShipmentHeadOprDataMeansOfIdentification object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadOprDataMeansOfIdentification 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 TShipmentHeadOprDataMeansOfIdentification, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataMeansOfIdentification)
+ 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 TShipmentHeadOprDataMeansOfIdentification) 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 TShipmentHeadOprDataMeansOfIdentification
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadOprDataMeansOfIdentification)
+ 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 TShipmentHeadOprDataMeansOfIdentification
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadOprDataMeansOfIdentification)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadOprDataMeansOfIdentification 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 TShipmentHeadOprDataMeansOfIdentification object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadOprDataMeansOfIdentification 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 TShipmentHeadOprDataMeansOfIdentification, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataMeansOfIdentification)
+ 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 TShipmentHeadOprDataMeansOfIdentification) 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 TShipmentHeadOprDataMeansOfIdentification
+ 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 TShipmentHeadOprDataProduct
+
+#Region "Private fields"
+ Private _commodityCode As String
+
+ Private _partDescription As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property commodityCode() As String
+ Get
+ Return Me._commodityCode
+ End Get
+ Set
+ Me._commodityCode = Value
+ End Set
+ End Property
+
+ Public Property partDescription() As String
+ Get
+ Return Me._partDescription
+ End Get
+ Set
+ Me._partDescription = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadOprDataProduct))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadOprDataProduct 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()
+ 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 TShipmentHeadOprDataProduct object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadOprDataProduct 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 TShipmentHeadOprDataProduct, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataProduct)
+ 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 TShipmentHeadOprDataProduct) 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 TShipmentHeadOprDataProduct
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadOprDataProduct)
+ 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 TShipmentHeadOprDataProduct
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadOprDataProduct)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadOprDataProduct 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 TShipmentHeadOprDataProduct object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadOprDataProduct 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 TShipmentHeadOprDataProduct, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadOprDataProduct)
+ 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 TShipmentHeadOprDataProduct) 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 TShipmentHeadOprDataProduct
+ 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 TShipmentHeadDepartureTransportMeans
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _identificationNumber As String
+
+ Private _nationality As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property identificationNumber() As String
+ Get
+ Return Me._identificationNumber
+ End Get
+ Set
+ Me._identificationNumber = Value
+ End Set
+ End Property
+
+ Public Property nationality() As String
+ Get
+ Return Me._nationality
+ End Get
+ Set
+ Me._nationality = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TShipmentHeadDepartureTransportMeans))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TShipmentHeadDepartureTransportMeans 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()
+ 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 TShipmentHeadDepartureTransportMeans object
+ '''
+ ''' string to deserialize
+ ''' Output TShipmentHeadDepartureTransportMeans 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 TShipmentHeadDepartureTransportMeans, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadDepartureTransportMeans)
+ 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 TShipmentHeadDepartureTransportMeans) 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 TShipmentHeadDepartureTransportMeans
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TShipmentHeadDepartureTransportMeans)
+ 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 TShipmentHeadDepartureTransportMeans
+ Return CType(SerializerXml.Deserialize(s), TShipmentHeadDepartureTransportMeans)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TShipmentHeadDepartureTransportMeans 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 TShipmentHeadDepartureTransportMeans object
+ '''
+ ''' File to load and deserialize
+ ''' Output TShipmentHeadDepartureTransportMeans 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 TShipmentHeadDepartureTransportMeans, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TShipmentHeadDepartureTransportMeans)
+ 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 TShipmentHeadDepartureTransportMeans) 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 TShipmentHeadDepartureTransportMeans
+ 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/MIC/MicCustExportShipment.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.xsd
similarity index 69%
rename from VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.xsd
rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.xsd
index aeeb7b05..4658fce7 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.xsd
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.xsd
@@ -1,5 +1,8 @@
-
+
@@ -86,14 +89,14 @@
- Export shipment Header
+ Export shipment Header
MIC-CUST Company
- MIC-CUST Mandant
+ MIC-CUST Mandant
true
@@ -128,9 +131,11 @@
- Unique reference number of export declaration
+ Unique reference number of export declaration
+
Eindeutige Bezugsnummer der Ausfuhranmeldung.
-Ref: EH-Pap Feld 7
+ Ref: EH-Pap Feld 7
+
false
@@ -150,6 +155,30 @@ Ref: EH-Pap Feld 7
+
+
+
+ Shipment version/An unique version id
+ Versionsnummer
+
+
+ true
+ String1..50
+
+ MIC_AAVSDG
+ AASVERSION
+
+
+
+
+
+
+
+
+
+
+
+
@@ -204,7 +233,8 @@ Ref: EH-Pap Feld 7
Movement Reference Number (MRN)
Movement Reference Number (MRN)
MRN is necessary by supplementary declaration
- MRN muss bei Ergänzender Anmeldung angegeben werden.
+ MRN muss bei Ergänzender Anmeldung angegeben werden.
+
false
String18
@@ -225,15 +255,19 @@ Ref: EH-Pap Feld 7
Date and Time of declaration
-
+
Zeitpunkt der Anmeldung
-
- Format: yyyy-mm-ddThh:mm:ss (Use "T" as termination character between date and time part)
+
+ Format: yyyy-mm-ddThh:mm:ss (Use "T" as termination character between
+ date and time part)
-This date is relevant as validation date of tarriff codes, etc.
- Format: jjjj-mm-ttThh:mm:ss (Trennzeichen zw. Datum und Uhrzeit ist das "T")
+ This date is relevant as validation date of tarriff codes, etc.
+
+ Format: jjjj-mm-ttThh:mm:ss (Trennzeichen zw. Datum und Uhrzeit ist
+ das "T")
-Dieses Datum ist relevant als Gültigkeitdatum von Tarifnummern etc.
+ Dieses Datum ist relevant als Gültigkeitdatum von Tarifnummern etc.
+
false
Xs:dateTime
@@ -241,7 +275,7 @@ Dieses Datum ist relevant als Gültigkeitdatum von Tarifnummern etc.Aasliedat
MIC_AUSSDG
Afsliedat
- CH
+ CH
@@ -249,13 +283,17 @@ Dieses Datum ist relevant als Gültigkeitdatum von Tarifnummern etc.
Country of destination
-Ref: SAD Field 17
+ Ref: SAD Field 17
+
Bestimmungsland der Ausfuhranmeldung
-Ref: EH-Pap Feld 17
- LOV:
-ISO-Alpha-2 Country code, no EU-Country allowed
- Gültige Werte:
-ISO-Alpha2 Ländercode, kein EU-Land zulässig
+ Ref: EH-Pap Feld 17
+
+ LOV:
+ ISO-Alpha-2 Country code, no EU-Country allowed
+
+ Gültige Werte:
+ ISO-Alpha2 Ländercode, kein EU-Land zulässig
+
false
String2
@@ -281,7 +319,7 @@ ISO-Alpha2 Ländercode, kein EU-Land zulässig
Aasazld
MIC_AUSSDG
Afsazld
- CH
+ CH
@@ -290,13 +328,16 @@ ISO-Alpha2 Ländercode, kein EU-Land zulässig
Container code
Containerkennzeichen
-Ref: EH-Pap Feld 19
+ Ref: EH-Pap Feld 19
+
LOV:
-0 ... Transport not in container (Standard, cases of doubt)
-1 ... Transport in container(s)
+ 0 ... Transport not in container (Standard, cases of doubt)
+ 1 ... Transport in container(s)
+
gültige Werte:
-0 ... nicht in Containern (Standard, Zweifelsfälle)
-1 ... in Containern befördert
+ 0 ... nicht in Containern (Standard, Zweifelsfälle)
+ 1 ... in Containern befördert
+
false
String1
@@ -313,10 +354,12 @@ Ref: EH-Pap Feld 19
Total gross mass
Gesamt-Rohmasse
-Ref: EH-Pap Feld 35
+ Ref: EH-Pap Feld 35
+
Gross mass without container weight
Gesamtgewicht der Ausfuhrsendung (ohne Container).
-Gültige Werte: > 0
+ Gültige Werte: > 0
+
false
Number(13,4)
@@ -332,20 +375,21 @@ Gültige Werte: > 0
Begin of presentation/packing
-
+
Begin der Gestellung / Verpackung
-
+
Format: <yyyy-mm-dd>T<hh:mm>
-Note:
-Field must remain empty unless Type of declaration (clearance) =c,d
-
+ Note:
+ Field must remain empty unless Type of declaration (clearance) =c,d
+
Format: <jjjj-mm-tt>T<hh:mm>
-Bedingung C1:
-Prinzipiell ist das Feld leer zu lassen.
-Nur für Art der Anmeldung = c,d (Normalverfahren und Antrag auf Gestellung außerhalb Amtsplatz beantragt) ist hier ein Wert anzugeben;
-
+ Bedingung C1:
+ Prinzipiell ist das Feld leer zu lassen.
+ Nur für Art der Anmeldung = c,d (Normalverfahren und Antrag auf Gestellung außerhalb
+ Amtsplatz beantragt) ist hier ein Wert anzugeben;
+
false
Xs:dateTime
@@ -361,22 +405,23 @@ Nur für Art der Anmeldung = c,d (Normalverfahren und Antrag auf Gestellung au
End of presentation/packing (time limit)
-
+
Ende der Gestellung / Verpackung
-
+
Format: <yyyy-mm-dd>T<hh:mm>
-Note:
-Field must remain empty unless Type of declaration (clearance) =c,d
-
+ Note:
+ Field must remain empty unless Type of declaration (clearance) =c,d
+
Format: <jjjj-mm-tt>T<hh:mm>
-Bedingung C1:
-Prinzipiell ist das Feld leer zu lassen.
-Nur für Art der Anmeldung = c,d (Normalverfahren und Antrag auf Gestellung außerhalb Amtsplatz beantragt) ist hier ein Wert anzugeben;
+ Bedingung C1:
+ Prinzipiell ist das Feld leer zu lassen.
+ Nur für Art der Anmeldung = c,d (Normalverfahren und Antrag auf Gestellung außerhalb
+ Amtsplatz beantragt) ist hier ein Wert anzugeben;
-dateStartPack < dateEndPack
-
+ dateStartPack < dateEndPack
+
false
Xs:dateTime
@@ -391,33 +436,54 @@ dateStartPack < dateEndPack
- Parties involved (Consignor/Exporter/Declarant)
- Beteiligtenkonstellation Versender/Ausführer/Anmelder
- 0000 ... Declarant is exporter. Declarant has no direct representative. Exporter mandate no subcontractor.
-0010 ... Declarant is exporter. Declarant has no direct representative. Exporter mandate a subcontractor.
-0100 ... Declarant is exporter. Declarant has a direct representative. Exporter mandate no subcontractor.
-0110 ... Declarant is exporter. Declarant has a direct representative. Exporter mandate a subcontractor.
-1000 ... Declarant is an indirect representative of the exporter. Declarant has no direct representative. Exporter mandate no subcontractor.
-1010 ... Declarant is an indirect representative of the exporter. Declarant has no direct representative. Exporter mandate a subcontractor.
-1100 ... Declarant is an indirect representative of the exporter. Declarant has a direct representative. Exporter mandate no subcontractor.
-1110 ... Declarant is an indirect representative of the exporter. Declarant has a direct representative. Exporter mandate a subcontractor.
+ Parties involved (Consignor/Exporter/Declarant)
+
+ Beteiligtenkonstellation Versender/Ausführer/Anmelder
+
+ 0000 ... Declarant is exporter. Declarant has no direct
+ representative. Exporter mandate no subcontractor.
+ 0010 ... Declarant is exporter. Declarant has no direct representative. Exporter mandate a
+ subcontractor.
+ 0100 ... Declarant is exporter. Declarant has a direct representative. Exporter mandate no
+ subcontractor.
+ 0110 ... Declarant is exporter. Declarant has a direct representative. Exporter mandate a
+ subcontractor.
+ 1000 ... Declarant is an indirect representative of the exporter. Declarant has no direct
+ representative. Exporter mandate no subcontractor.
+ 1010 ... Declarant is an indirect representative of the exporter. Declarant has no direct
+ representative. Exporter mandate a subcontractor.
+ 1100 ... Declarant is an indirect representative of the exporter. Declarant has a direct
+ representative. Exporter mandate no subcontractor.
+ 1110 ... Declarant is an indirect representative of the exporter. Declarant has a direct
+ representative. Exporter mandate a subcontractor.
-At declaration to the simplified procedure ZA (cp. Data field "header / type of declaration (clearance)") the encodings
-"0110" and "1110" signify particularly, that the representative
-represents the declarant.
- 0000 ... Anmelder ist Ausführer. Anmelder lässt sich nicht direkt vertreten. Ausführer beauftragt keinen Subunternehmer.
-0010 ... Anmelder ist Ausführer. Anmelder lässt sich nicht direkt vertreten. Ausführer beauftragt Subunternehmer.
-0100 ... Anmelder ist Ausführer. Anmelder lässt sich direkt vertreten. Ausführer beauftragt keinen Subunternehmer.
-0110 ... Anmelder ist Ausführer. Anmelder lässt sich direkt vertreten. Ausführer beauftragt Subunternehmer.
-1000 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich nicht direkt vertreten. Ausführer beauftragt keinen Subunternehmer.
-1010 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich nicht direkt vertreten. Ausführer beauftragt Subunternehmer.
-1100 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich direkt vertreten. Ausführer beauftragt keinen Subunternehmer.
-1110 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich direkt vertreten. Ausführer beauftragt Subunternehmer.
+ At declaration to the simplified procedure ZA (cp. Data field "header / type of declaration
+ (clearance)") the encodings
+ "0110" and "1110" signify particularly, that the representative
+ represents the declarant.
+
+ 0000 ... Anmelder ist Ausführer. Anmelder lässt sich nicht direkt
+ vertreten. Ausführer beauftragt keinen Subunternehmer.
+ 0010 ... Anmelder ist Ausführer. Anmelder lässt sich nicht direkt vertreten. Ausführer
+ beauftragt Subunternehmer.
+ 0100 ... Anmelder ist Ausführer. Anmelder lässt sich direkt vertreten. Ausführer beauftragt
+ keinen Subunternehmer.
+ 0110 ... Anmelder ist Ausführer. Anmelder lässt sich direkt vertreten. Ausführer beauftragt
+ Subunternehmer.
+ 1000 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich nicht direkt
+ vertreten. Ausführer beauftragt keinen Subunternehmer.
+ 1010 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich nicht direkt
+ vertreten. Ausführer beauftragt Subunternehmer.
+ 1100 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich direkt
+ vertreten. Ausführer beauftragt keinen Subunternehmer.
+ 1110 ... Anmelder ist indirekter Vertreter des Ausführers. Anmelder lässt sich direkt
+ vertreten. Ausführer beauftragt Subunternehmer.
-Bei Anmeldung zum Vereinfachten Verfahren ZA (vgl. Datenfeld „KOPF / Art der Anmeldung (Überführung)“) bedeuten
-die Codierungen „0110“ und „1110“ insbesondere auch, dass
-sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
-
+ Bei Anmeldung zum Vereinfachten Verfahren ZA (vgl. Datenfeld „KOPF / Art der Anmeldung
+ (Überführung)“) bedeuten
+ die Codierungen „0110“ und „1110“ insbesondere auch, dass
+ sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
+
false
Number(4)
@@ -429,6 +495,35 @@ sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
+
+
+
+ Indication if the declaration is combined with EXS
+
+ Kennzeichen für die integrale Anmeldung der Daten für die
+ Summarische Ausgangsmeldung
+
+
+ Codeliste C0217:
+ 0...Not used for safety and security purposes
+ 2...EXS
+
+ false
+ String1
+
+ MIC_AAVSDG
+ aassecind
+ MIC_AUSSDG
+ afssecind
+
+
+
+
+
+
+
+
+
@@ -436,14 +531,17 @@ sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
Adressaten-Konstellation
Describes the relation between the consignee and the end-user.
-0… End-user is equal to consignee
-1… End-user different to consignee
-2… End-user unknown
- Dieses Kennzeichen beschreibt die Beziehung zwischen Empfänger und Endverwender.
+ 0… End-user is equal to consignee
+ 1… End-user different to consignee
+ 2… End-user unknown
+
+ Dieses Kennzeichen beschreibt die Beziehung zwischen Empfänger und
+ Endverwender.
-0… Endverwender ist Empfänger.
-1… Endverwender ist nicht Empfänger.
-2… Endverwender ist nicht bekannt.
+ 0… Endverwender ist Empfänger.
+ 1… Endverwender ist nicht Empfänger.
+ 2… Endverwender ist nicht bekannt.
+
false
String1
@@ -464,9 +562,13 @@ sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
- 1 wenn die Adressatenkonstellation und ggf. der Endverwender in der EAM übermittelt werden soll.
+ 1 wenn die Adressatenkonstellation und ggf. der Endverwender in
+ der EAM übermittelt werden soll.
+
- 1 wenn die Adressatenkonstellation und ggf. der Endverwender in der EAM übermittelt werden soll.
+ 1 wenn die Adressatenkonstellation und ggf. der Endverwender in der
+ EAM übermittelt werden soll.
+
false
Integer(1)
@@ -487,74 +589,78 @@ sich der Anmelder durch den Subunternehmer direkt vertreten lässt.
-
-
- Estimated Arrival Date
- Geschätztes Ankunftsdatum
-
-
- false
- xs:datetime
-
- MIC_AAVSDG
- AASESTDAT
- MIC_AUSSDG
- AFSESTDAT
-
-
-
+
+
+ Estimated Arrival Date
+ Geschätztes Ankunftsdatum
+
+
+ false
+ xs:datetime
+
+ MIC_AAVSDG
+ AASESTDAT
+ MIC_AUSSDG
+ AFSESTDAT
+
+
+
-
-
- NCTS Indicator
- NCTS Indikator
-
-
- false
- xs:boolean
-
- MIC_AAVSDG
- AASNCTSINDICATOR
- MIC_AUSSDG
- AFSNCTSINDICATOR
-
-
-
+
+
+ NCTS Indicator
+ NCTS Indikator
+
+
+ false
+ xs:boolean
+
+ MIC_AAVSDG
+ AASNCTSINDICATOR
+ MIC_AUSSDG
+ AFSNCTSINDICATOR
+
+
+
Inland mode of transport
- Genutzter (inländischer) Verkehrszweig bis zur Außengrenze der Gemeinschaft
+ Genutzter (inländischer) Verkehrszweig bis zur Außengrenze der
+ Gemeinschaft
-Ref: EH-Pap Feld 26
+ Ref: EH-Pap Feld 26
+
LOV: (DE-Codeliste C0018)
-10=Sea transport
-12=railway carriage on seagoing vessel
-16=road vehicle on seagoing vessel
-17=trailer/semi trailer on seagoing vessel
-18=barge on seagoing vessel
-20=Rail transport
-23=road vehicle on railroad
-30=Road transport
-50=Postal consignment
-80=Inland waterway transport
-90=own propulsion
+ 10=Sea transport
+ 12=railway carriage on seagoing vessel
+ 16=road vehicle on seagoing vessel
+ 17=trailer/semi trailer on seagoing vessel
+ 18=barge on seagoing vessel
+ 20=Rail transport
+ 23=road vehicle on railroad
+ 30=Road transport
+ 50=Postal consignment
+ 80=Inland waterway transport
+ 90=own propulsion
+
LOV: (DE-Codeliste C0018)
-10=Seeverkehr
-12=Waggon auf Seeschiff
-16=Straßenfahrzeug auf Seeschiff
-17=Anhänger/Auflieger auf Seeschiff
-18=Binnenschiff auf Seeschiff
-20=Eisenbahnverkehr
-23=Straßenfahrzeug auf Eisenbahn
-30=Straßenverkehr; 40=Luftverkehr
-50=Postsendungen
-80=Binnenschifffahrt
-90=Eigener Antrieb
+ 10=Seeverkehr
+ 12=Waggon auf Seeschiff
+ 16=Straßenfahrzeug auf Seeschiff
+ 17=Anhänger/Auflieger auf Seeschiff
+ 18=Binnenschiff auf Seeschiff
+ 20=Eisenbahnverkehr
+ 23=Straßenfahrzeug auf Eisenbahn
+ 30=Straßenverkehr; 40=Luftverkehr
+ 50=Postsendungen
+ 80=Binnenschifffahrt
+ 90=Eigener Antrieb
-Gruppe/Feld muss entweder in der uAM oder in der eAM angegeben werden.
+ Gruppe/Feld muss entweder in der uAM oder in der eAM angegeben werden.
+
false
1
@@ -572,14 +678,18 @@ Gruppe/Feld muss entweder in der uAM oder in der eAM angegeben werden.Atlas notification
Atlas Vermerk
free text for notification of the customs authorities.
-Proposal: do not fill field !
-Note:
-free text requires manual processing by the customs authorities
---> loss of time
- addText1 wird in Aasinfo geladen, der Rest wird in AasText1..4 geladen.
+ Proposal: do not fill field !
+ Note:
+ free text requires manual processing by the customs authorities
+ --> loss of time
+
+ addText1 wird in Aasinfo geladen, der Rest wird in AasText1..4
+ geladen.
-Vorschlag: Leer lassen !
-Wird hier etwas angetragen, muss der Zöllner den Vorgang händisch freigeben. längere Abwicklung.
+ Vorschlag: Leer lassen !
+ Wird hier etwas angetragen, muss der Zöllner den Vorgang händisch freigeben. längere
+ Abwicklung.
+
false
String1..80
0..5
@@ -619,9 +729,12 @@ Wird hier etwas angetragen, muss der Zöllner den Vorgang händisch freigeben. l
Place of loading
Ladeort
-Ref: EH-Pap Feld 30
+ Ref: EH-Pap Feld 30
+
- Ort, an dem die Waren verladen und ggf. Verschlüsse angebracht werden
+ Ort, an dem die Waren verladen und ggf. Verschlüsse angebracht
+ werden
+
false
1
@@ -638,9 +751,14 @@ Ref: EH-Pap Feld 30
Customs office of export
Ausfuhrzollstelle
-Ref: EH-Pap Feld A
- local customs office of export being responsible for the declaration
- Lokale Dienststelle, die als Ausfuhrzollstelle für diese Anmeldung zuständig ist
+ Ref: EH-Pap Feld A
+
+ local customs office of export being responsible for the
+ declaration
+
+ Lokale Dienststelle, die als Ausfuhrzollstelle für diese Anmeldung
+ zuständig ist
+
true
1
@@ -657,9 +775,12 @@ Ref: EH-Pap Feld A
Expected office of exit
Vorgesehene Ausgangszollstelle
-Ref: EH-Pap Feld 29
+ Ref: EH-Pap Feld 29
+
- Dienststelle, die zum Zeitpunkt der Überlassung als Ausgangszollstelle vorgesehen ist.
+ Dienststelle, die zum Zeitpunkt der Überlassung als
+ Ausgangszollstelle vorgesehen ist.
+
false
1
@@ -671,14 +792,36 @@ Ref: EH-Pap Feld 29
+
+
+
+ Supervising customs office
+ Überwachungszollstelle
+
+
+ false
+
+ 1
+ MIC_AAVSDG
+ aassupervisingcustomsoffice(offCtry+codeOff)
+
+ MIC_AUSSDG
+ Afssupervisingcustomsoffice(offCtry+codeOff)
+
+
+
+
+
Mode of transport at the border
Verkehrszweig Grenze
-
- Mode of transport of the active mean of transport at the border
- Verkehrszweig des aktiven Beförderungsmittels an der Grenze.
+
+ Mode of transport of the active mean of transport at the border
+
+ Verkehrszweig des aktiven Beförderungsmittels an der Grenze.
+
false
1
@@ -752,8 +895,8 @@ Ref: EH-Pap Feld 29
- Authorised location of goods, code
- Authorised location of goods, code
+ Authorised location of goods, code
+ Authorised location of goods, code
For NCTS dispatch only
Nur für NCTS Versand
false
@@ -873,9 +1016,11 @@ Ref: EH-Pap Feld 29
Country first destination
-Ref: SAD Field 10
+ Ref: SAD Field 10
+
Erstes Bestimmungsland
-Ref: EH-Pap Feld 10
+ Ref: EH-Pap Feld 10
+
false
@@ -889,15 +1034,129 @@ Ref: EH-Pap Feld 10
+
+
+
+ The message broker used for customs declarations
+
+ Der Nachrichtenbroker, welcher für die Zollkommunikation
+ verwendet wird
+
+
+
+ false
+ String1..30
+
+ MIC_AAVSDG
+ AASBROKER
+ MIC_AUSSDG
+ AFSBROKER
+
+
+
+
+
+
+
+
+
+
+
+
+ Waybill Number
+ BOL/AWB Nummer
+
+
+ false
+ String1..20
+
+ MIC_AAVSDG
+ AASWBNR
+ MIC_AUSSDG
+ AFSWBNR
+
+
+
+
+
+
+
+
+
+
+
+
+ Waybill Date
+ BOL/AWB Datum
+
+
+ false
+ xs:date
+
+ MIC_AAVSDG
+ AASWBDAT
+ MIC_AUSSDG
+ AFSWBDAT
+
+
+
+
+
+
+
+ House Waybill Number
+ HBOL/HAWB Nummer
+
+
+ false
+ String1..20
+
+ MIC_AAVSDG
+ AASHWBNR
+ MIC_AUSSDG
+ AFSHWBNR
+
+
+
+
+
+
+
+
+
+
+
+
+ House Waybill Date
+ HBOL/HAWB Datum
+
+
+ false
+ xs:date
+
+ MIC_AAVSDG
+ AASHWBDAT
+ MIC_AUSSDG
+ AFSHWBDAT
+
+
+
+
Customs office supplementary declaration
Zollstelle Ergänzende Ausfuhranmeldung
- Note: This field (officeDest = office of destination) is not used in the original semantic but as 'office of destination of the supplementary export declaration'.
Zollstelle, die für die ergänzende Anmeldung zuständig ist.
-Hinweis: Dieses Feld (officeDest = office of destination, 'Bestimmungszollstelle') wird hier nicht in seiner Ursprungsbedeutung verwendet, sondern als Bestimmungszollstelle für die ergänzende Ausfuhranmeldung.
+ Hinweis: Dieses Feld (officeDest = office of destination, 'Bestimmungszollstelle') wird hier
+ nicht in seiner Ursprungsbedeutung verwendet, sondern als Bestimmungszollstelle für die
+ ergänzende Ausfuhranmeldung.
+
+ Note: This field (officeDest = office of destination) is not used in
+ the original semantic but as 'office of destination of the supplementary export
+ declaration'.
+
false
1
@@ -1032,30 +1291,43 @@ Hinweis: Dieses Feld (officeDest = office of destination, 'Bestimmungszollstelle
Documents
-Ref: SAD Paper Field 44
+ Ref: SAD Paper Field 44
+
Unterlagen
-Ref: EH-Pap Feld 44
+ Ref: EH-Pap Feld 44
+
Note:
-Documents can be provided on shipment level, invoice level or invoice line level. Documents provided on shipment level or invoice level are declared on invoice line level to Atlas.
+ Documents can be provided on shipment level, invoice level or invoice line level. Documents
+ provided on shipment level or invoice level are declared on invoice line level to Atlas.
-Condition C1:
-Value required for chapter 98 of the CN8
+ Condition C1:
+ Value required for chapter 98 of the CN8
-Condition C2:
-Value required due to individual certificates, authorizations, etc. such as export lizcences, ...
+ Condition C2:
+ Value required due to individual certificates, authorizations, etc. such as export
+ lizcences, ...
-MIC proposes documents to be provided at invoice line level within the interface as they are reported to ATLAS on invoice line level too.
- Anmerkung:
-Unterlagen können auf Sendungsebene angegeben werden oder auf Fakturenebene oder auf Positionsebene.
-Unterlagen, die auf Sendungsebene oder Fakturenebene angegeben werden, werden an ATLAS für JEDE Position gemeldet (zusätzlich zu Unterlagen auf Positionsebene)
+ MIC proposes documents to be provided at invoice line level within the interface as they are
+ reported to ATLAS on invoice line level too.
+
+ Anmerkung:
+ Unterlagen können auf Sendungsebene angegeben werden oder auf Fakturenebene oder auf
+ Positionsebene.
+ Unterlagen, die auf Sendungsebene oder Fakturenebene angegeben werden, werden an ATLAS für
+ JEDE Position gemeldet (zusätzlich zu Unterlagen auf Positionsebene)
-Bedingung C1:
-Erforderlich für Waren der Kapitel 98
+ Bedingung C1:
+ Erforderlich für Waren der Kapitel 98
-Bedingung C2:
-Hier sind insbesondere Genehmigungen und Bescheinigungen nach den VuB-Vorschriften, MO-Unterlagen/Genehmigungen, Genehmigungen und Bescheinigungen nach der Außenwirtschaftsverordnung und sonstige Unterlagen/Genehmigungen zu vermerken. Besondere Vermerke sind hier ebenfalls in codierter Form anzugeben
+ Bedingung C2:
+ Hier sind insbesondere Genehmigungen und Bescheinigungen nach den VuB-Vorschriften,
+ MO-Unterlagen/Genehmigungen, Genehmigungen und Bescheinigungen nach der
+ Außenwirtschaftsverordnung und sonstige Unterlagen/Genehmigungen zu vermerken. Besondere
+ Vermerke sind hier ebenfalls in codierter Form anzugeben
-MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzlich jede Unterlage auf Positionsebene verlangt.
+ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzlich jede
+ Unterlage auf Positionsebene verlangt.
+
false
0..99
@@ -1128,12 +1400,17 @@ MIC bevorzugt die Angabe der Unterlagen auf Positionsebene, da Atlas grundsätzl
Country of exit
-Ref: SAD Field 15
+ Ref: SAD Field 15
+
Ausfuhrland
-Ref: EH-Papier Feld 15
- EU-Countrycode (ISO-Alpha) from where the goods leave the EU.
-Codelist C0010
- Anzugeben ist das Nationalitätskennzeichen des EU-Landes, von dem aus die Waren zwecks Ausfuhr versandt werden / worden sind. Codeliste: C0010
+ Ref: EH-Papier Feld 15
+
+ EU-Countrycode (ISO-Alpha) from where the goods leave the EU.
+ Codelist C0010
+
+ Anzugeben ist das Nationalitätskennzeichen des EU-Landes, von dem aus
+ die Waren zwecks Ausfuhr versandt werden / worden sind. Codeliste: C0010
+
false
String2
@@ -1152,9 +1429,10 @@ Codelist C0010
Besondere Umstände
Flag of special circumstances (codelist: C0096)
Kennzeichen für das Vorliegen besonderer Umstände
-Codeliste: C0096
+ Codeliste: C0096
+
false
- String1
+ String3
MIC_AAVSDG
Aasbesumstaende
@@ -1167,12 +1445,14 @@ Codeliste: C0096
- Costs of Carriage
+ Costs of Carriage
Beförderungskosten (Zahlungsweise)
- Die Datenfelder auf Warenpositions- und hier auf Kopfebene schließen sich gegenseitig aus.
-Bei nur einer Zahlungsweise für den gesamten Ausfuhrvorgang muss die Angabe auf der Kopfebene erfolgen.
-
+ Die Datenfelder auf Warenpositions- und hier auf Kopfebene schließen
+ sich gegenseitig aus.
+ Bei nur einer Zahlungsweise für den gesamten Ausfuhrvorgang muss die Angabe auf der
+ Kopfebene erfolgen.
+
false
String1
@@ -1190,9 +1470,11 @@ Bei nur einer Zahlungsweise für den gesamten Ausfuhrvorgang muss die Angabe auf
Shipmend-Identification
Kennnummer der Sendung
- Die Datenfelder auf Warenpositions- und hier auf Kopfebene schließen sich gegenseitig aus.
-Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf der Kopfebene erfolgen.
-
+ Die Datenfelder auf Warenpositions- und hier auf Kopfebene schließen
+ sich gegenseitig aus.
+ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf der Kopfebene
+ erfolgen.
+
false
String1..70
@@ -1286,9 +1568,18 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Name of the predefined route in MIC-CUST
- Name der vordefinierten Route in MIC-CUST.
- MIC-CUST grants you the possiblity to predefine routes with unique routenames. To select such a route in MIC-CUST the routename has to be entered here. MIC-CUST validates the routename while taking over the shipmentdate from the workbuffer to the finale tables. The closure of the shipment faile, if the routename doesn't exists.
- MIC-Cust bietet die Möglichkeit Routen im Vorfeld zu definieren. Jede vordefinierte Route wird mit einem eindeutigen Namen für die Mandant/Werk Kombination versehen. Wird der Name der Route in diesem Tag angegeben, sucht MIC-CUST bei der Übernahme der Daten automatisch nach der Route. Ist die Route nicht vorhanden, läuft der Beleg auf Fehler.
+ Name der vordefinierten Route in MIC-CUST.
+ MIC-CUST grants you the possiblity to predefine routes with unique
+ routenames. To select such a route in MIC-CUST the routename has to be entered here.
+ MIC-CUST validates the routename while taking over the shipmentdate from the workbuffer to
+ the finale tables. The closure of the shipment faile, if the routename doesn't exists.
+
+ MIC-Cust bietet die Möglichkeit Routen im Vorfeld zu definieren. Jede
+ vordefinierte Route wird mit einem eindeutigen Namen für die Mandant/Werk Kombination
+ versehen. Wird der Name der Route in diesem Tag angegeben, sucht MIC-CUST bei der Übernahme
+ der Daten automatisch nach der Route. Ist die Route nicht vorhanden, läuft der Beleg auf
+ Fehler.
+
false
String1..100
@@ -1306,7 +1597,9 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
customs authorisation number
- This Tag overwrites the customs authority number of the actual shipment.
+ This Tag overwrites the customs authority number of the actual
+ shipment.
+
false
String1..12
@@ -1322,9 +1615,16 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
customs authorisation number
- Bewilliungsnummern für die Anmeldung zur Ausfuhr
- This Tag overwrites the customs authority number of the actual shipment.
- Solle eine Exportanmeldung mit einer anderen Bewilligungsnummer als die, die im Mandaten hinterlegt wurde, angemeldet werden, kann die Bewilligungsnummer in diesem Tag angegeben werden. Sie überschreibt somit die hinterlegte Bewilligung. Diese Bewilligungsnummer bezieht sich nur auf diesen Vorgang.
+ Bewilliungsnummern für die Anmeldung zur Ausfuhr
+
+ This Tag overwrites the customs authority number of the actual
+ shipment.
+
+ Solle eine Exportanmeldung mit einer anderen Bewilligungsnummer als
+ die, die im Mandaten hinterlegt wurde, angemeldet werden, kann die Bewilligungsnummer in
+ diesem Tag angegeben werden. Sie überschreibt somit die hinterlegte Bewilligung. Diese
+ Bewilligungsnummer bezieht sich nur auf diesen Vorgang.
+
false
@@ -1340,8 +1640,12 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
- Authorisationnumber for entry in the records for OPR
- Bewilligungsnummer zum Anschreibeverfahren in der Passiven Veredelung
+ Authorisationnumber for entry in the records for
+ OPR
+
+ Bewilligungsnummer zum Anschreibeverfahren in der
+ Passiven Veredelung
+
false
@@ -1364,7 +1668,8 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Authorisationnumber for OPR
- Bewilligungsnummer zur Passiven Veredelung
+ Bewilligungsnummer zur Passiven Veredelung
+
false
@@ -1386,8 +1691,11 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
- Authorisationnumber for trustworthy exporter
- Bewilligungsnummer des Vertrauenswürdigen Ausführers
+ Authorisationnumber for trustworthy exporter
+
+ Bewilligungsnummer des Vertrauenswürdigen
+ Ausführers
+
Not used at the moment
Im Moment nicht verwendet
false
@@ -1409,8 +1717,10 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
- Authorisationnumber for authorised exporter
- Bewilligungsnummer des Zugelassenen Ausführers
+ Authorisationnumber for authorised exporter
+
+ Bewilligungsnummer des Zugelassenen Ausführers
+
false
@@ -1457,7 +1767,9 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Date of Exit
Datum des Ausgangs
- Datum des körperlichen Ausgangs der Waren aus dem Zollgebiet der Gemeinschaft
+ Datum des körperlichen Ausgangs der Waren aus dem
+ Zollgebiet der Gemeinschaft
+
false
Xs:date
@@ -1472,10 +1784,13 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
- Date of acceptance of Export Declaration
+ Date of acceptance of Export Declaration
+
Maßgebliches Datum
- Für die nachträgliche Ausfuhranmeldung maßgebliches Datum
+ Für die nachträgliche Ausfuhranmeldung maßgebliches
+ Datum
+
false
Xs:date
@@ -1493,7 +1808,11 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Statistic Declaration Flag
Statistische Meldung
- Kennzeichen, ob zu einer nachträglichen Ausfuhranmeldung aus dem Notfallverfahren noch eine Meldung zur Außenhandelsstatistik (Extrastat/Intrastat) seitens ATLAS/Ausfuhr an das Statistische Bundesamt erfolgen soll
+ Kennzeichen, ob zu einer nachträglichen Ausfuhranmeldung
+ aus dem Notfallverfahren noch eine Meldung zur Außenhandelsstatistik
+ (Extrastat/Intrastat) seitens ATLAS/Ausfuhr an das Statistische Bundesamt
+ erfolgen soll
+
false
String1
@@ -1515,15 +1834,17 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Actual Office of Exit
Tatsächliche Ausgangszollstelle
-
+
false
MIC_AAVSDG
- Aasofficeofexit (Offctry+Codeoff)
+ Aasofficeofexit (Offctry+Codeoff)
+
MIC_AUSSDG
- Afsofficeofexit (Offctry+Codeoff)
+ Afsofficeofexit (Offctry+Codeoff)
+
@@ -1537,7 +1858,8 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
OPR
Passive Veredelung
- Informationen zur Überführung in die Passive Veredelung
+ Informationen zur Überführung in die Passive Veredelung
+
false
@@ -1556,7 +1878,9 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Date of re-import
Datum der Wiedereinfuhr
Deadline für re-import
- Letztmöglicher Tag für die Wiedereinfuhr der Veredelungserzeugnisse
+ Letztmöglicher Tag für die Wiedereinfuhr der
+ Veredelungserzeugnisse
+
false
Xs:date
@@ -1573,8 +1897,11 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Standard exchange
Standardaustausch
- Flag for application to standard exchange
- Kennzeichen, ob ein Standardaustausch im Rahmen der Passiven Veredelung beantragt wird
+ Flag for application to standard exchange
+
+ Kennzeichen, ob ein Standardaustausch im Rahmen der
+ Passiven Veredelung beantragt wird
+
false
String1
@@ -1616,12 +1943,16 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Country
Land
- Verschlüsselung des Landes der Wiedereinfuhr
+ Verschlüsselung des Landes der
+ Wiedereinfuhr
+
true
String2
- MIC_CUST_WB_OPR_REIMPORT
- Oiwcountry
+ MIC_CUST_WB_OPR_REIMPORT
+
+ Oiwcountry
+
MIC_CUST_OPR_REIMPORT
Oricountry
@@ -1642,7 +1973,8 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Means of identification
Nämlichkeitsmittel
- Art und Beschreibung der Nämlichkeitsmittel
+ Art und Beschreibung der Nämlichkeitsmittel
+
false
0..8
@@ -1661,11 +1993,14 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Type
Art
- Verschlüsselung für die Art des verwendeten Nämlichkeitsmittels
+ Verschlüsselung für die Art des verwendeten
+ Nämlichkeitsmittels
+
false
String1
- MIC_CUST_WB_OPR_REFERENCE
+ MIC_CUST_WB_OPR_REFERENCE
+
Orwtype
MIC_CUST_OPR_REFERENCE
Omrtype
@@ -1682,14 +2017,19 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Desciption
- Textliche Beschreibung
+ Textliche Beschreibung
+
- Textliche Beschreibung des verwendeten Nämlichkeitsmittels
+ Textliche Beschreibung des verwendeten
+ Nämlichkeitsmittels
+
false
String1..350
- MIC_CUST_WB_OPR_REFERENCE
- Orwdescription
+ MIC_CUST_WB_OPR_REFERENCE
+
+ Orwdescription
+
MIC_CUST_OPR_REFERENCE
Omrdescription
@@ -1710,7 +2050,9 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Products
Erzeugnis
- Die Veredelungserzeugnisse müssen vorab durch eine Warennummer und eine Warenbeschreibung bezeichnet werden.
+ Die Veredelungserzeugnisse müssen vorab durch eine
+ Warennummer und eine Warenbeschreibung bezeichnet werden.
+
false
0..999
@@ -1729,12 +2071,16 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Commodity code
Warennummer
- Warennummer nach dem Warenverzeichnis für die Außenhandelsstatistik (HS4, HS6 oder KN8)
+ Warennummer nach dem Warenverzeichnis für die
+ Außenhandelsstatistik (HS4, HS6 oder KN8)
+
false
String1..13
- MIC_CUST_WB_OPR_FINISHEDGOOD
- Ofwcodenumber
+ MIC_CUST_WB_OPR_FINISHGOOD
+
+ Ofwcodenumber
+
MIC_CUST_OPR_FINISHEDGOOD
Ofgcodenumber
DES
@@ -1752,12 +2098,15 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
Desciption
Warenbezeichnung
- Textuelle Beschreibung der Ware
+ Textuelle Beschreibung der Ware
+
false
- String1..280
+ String1..512
- MIC_CUST_WB_OPR_FINISHEDGOOD
- Ofwgoodsdescription
+ MIC_CUST_WB_OPR_FINISHGOOD
+
+ Ofwgoodsdescription
+
MIC_CUST_OPR_FINISHEDGOOD
Ofggoodsdescription
Fürth
@@ -1765,7 +2114,7 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
-
+
@@ -1793,16 +2142,16 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
-
+
-
-
-
+ Additional Information
+ Zusätzliche Information
+
false
-
+ 0..99
@@ -1810,36 +2159,8 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
ERP Specific Data
@@ -1856,7 +2177,174 @@ Bei nur einer Kennnummer für den gesamten Ausfuhrvorgang muss die Angabe auf de
-
+
+
+
+
+ Authorisation holders
+ Bewillingungsinhaber
+
+
+ false
+
+ 0..9
+
+
+
+
+
+
+
+
+
+
+
+ Previous Document
+ Vorpapier
+
+
+ false
+
+ 0..99
+
+
+
+
+
+
+
+
+
+
+
+ Departure Transport Means
+ Beförderungsmittel beim Abgang
+
+
+ false
+
+ 0..999
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of Identification
+ Art der Identifikation
+
+
+ true
+ Number(2)
+
+ MIC_CUST_DEPARTURE_TRANSP_WB
+ dtwmeanstype
+ MIC_CUST_DEPARTURE_TRANSPORT
+ dptmeanstype
+
+
+
+
+
+
+
+
+
+
+
+
+ Identification Number
+ Kennzeichen
+
+
+ true
+ String1..35
+
+ MIC_CUST_DEPARTURE_TRANSP_WB
+ dtwmeansidno
+ MIC_CUST_DEPARTURE_TRANSPORT
+ dptmeansidno
+
+
+
+
+
+
+
+
+
+
+
+
+ Nationality
+ Staatszugehörigkeit
+
+
+ true
+ String1..2
+
+ MIC_CUST_DEPARTURE_TRANSP_WB
+ dtwmeansnationality
+ MIC_CUST_DEPARTURE_TRANSPORT
+ dptmeansnationality
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Customs office of presentation
+ Gestellungszollstelle
+
+ Dienststellennummer der zuständigen Gestellungszollstelle
+
+ false
+
+ 1
+ MIC_AAVSDG
+ aaspresentationcustomsoffice(offCtry+codeOff)
+
+ MIC_AUSSDG
+ afspresentationcustomsoffice(offCtry+codeOff)
+
+
+
+
+
+
+
+
+ Type of Delivery
+ Versandart
+ false
+ xs:string
+ MIC_AAVSDG
+ AASVSART
+ MIC_AUSSDG
+ AFSVSART
+
+
+
+
+
+
+
+
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.Designer.vb
new file mode 100644
index 00000000..ea395951
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.Designer.vb
@@ -0,0 +1,1278 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicErrorWarningMessage","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicErrorWarningMessage
+
+
+ Partial Public Class ErrorMessages
+
+#Region "Private fields"
+ Private _errorMessage As List(Of TErrorMessageType)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._errorMessage = New List(Of TErrorMessageType)()
+ End Sub
+
+
+ Public Property ErrorMessage() As List(Of TErrorMessageType)
+ Get
+ Return Me._errorMessage
+ End Get
+ Set
+ Me._errorMessage = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ErrorMessages))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize ErrorMessages 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()
+ 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 ErrorMessages object
+ '''
+ ''' string to deserialize
+ ''' Output ErrorMessages 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 ErrorMessages, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, ErrorMessages)
+ 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 ErrorMessages) 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 ErrorMessages
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ErrorMessages)
+ 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 ErrorMessages
+ Return CType(SerializerXml.Deserialize(s), ErrorMessages)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current ErrorMessages 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 ErrorMessages object
+ '''
+ ''' File to load and deserialize
+ ''' Output ErrorMessages 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 ErrorMessages, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, ErrorMessages)
+ 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 ErrorMessages) 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 ErrorMessages
+ 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 TErrorMessageType
+
+#Region "Private fields"
+ Private _module As String
+
+ Private _process As String
+
+ Private _errorCode As String
+
+ Private _errorDesc As String
+
+ Private _reference As TReference
+
+ Private _details As TErrorDetail
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._details = New TErrorDetail()
+ Me._reference = New TReference()
+ End Sub
+
+ Public Property [module]() As String
+ Get
+ Return Me._module
+ End Get
+ Set
+ Me._module = Value
+ End Set
+ End Property
+
+ Public Property process() As String
+ Get
+ Return Me._process
+ End Get
+ Set
+ Me._process = Value
+ End Set
+ End Property
+
+ Public Property errorCode() As String
+ Get
+ Return Me._errorCode
+ End Get
+ Set
+ Me._errorCode = Value
+ End Set
+ End Property
+
+ Public Property errorDesc() As String
+ Get
+ Return Me._errorDesc
+ End Get
+ Set
+ Me._errorDesc = Value
+ End Set
+ End Property
+
+ Public Property Reference() As TReference
+ Get
+ Return Me._reference
+ End Get
+ Set
+ Me._reference = Value
+ End Set
+ End Property
+
+ Public Property Details() As TErrorDetail
+ Get
+ Return Me._details
+ End Get
+ Set
+ Me._details = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TErrorMessageType))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErrorMessageType 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()
+ 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 TErrorMessageType object
+ '''
+ ''' string to deserialize
+ ''' Output TErrorMessageType 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 TErrorMessageType, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorMessageType)
+ 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 TErrorMessageType) 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 TErrorMessageType
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErrorMessageType)
+ 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 TErrorMessageType
+ Return CType(SerializerXml.Deserialize(s), TErrorMessageType)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErrorMessageType 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 TErrorMessageType object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErrorMessageType 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 TErrorMessageType, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorMessageType)
+ 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 TErrorMessageType) 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 TErrorMessageType
+ 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 TReference
+
+#Region "Private fields"
+ Private _company As String
+
+ Private _plant As String
+
+ Private _correlationId As String
+
+ Private _referenceType As String
+
+ Private _referenceSid As Long
+
+ Private _user As String
+
+ Private _partnerId As String
+
+ Private _routeId As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property company() As String
+ Get
+ Return Me._company
+ End Get
+ Set
+ Me._company = Value
+ End Set
+ End Property
+
+ Public Property plant() As String
+ Get
+ Return Me._plant
+ End Get
+ Set
+ Me._plant = Value
+ End Set
+ End Property
+
+ Public Property correlationId() As String
+ Get
+ Return Me._correlationId
+ End Get
+ Set
+ Me._correlationId = Value
+ End Set
+ End Property
+
+ Public Property referenceType() As String
+ Get
+ Return Me._referenceType
+ End Get
+ Set
+ Me._referenceType = Value
+ End Set
+ End Property
+
+ Public Property referenceSid() As Long
+ Get
+ Return Me._referenceSid
+ End Get
+ Set
+ Me._referenceSid = Value
+ End Set
+ End Property
+
+ Public Property user() As String
+ Get
+ Return Me._user
+ End Get
+ Set
+ Me._user = Value
+ End Set
+ End Property
+
+ Public Property partnerId() As String
+ Get
+ Return Me._partnerId
+ End Get
+ Set
+ Me._partnerId = Value
+ End Set
+ End Property
+
+ Public Property routeId() As String
+ Get
+ Return Me._routeId
+ End Get
+ Set
+ Me._routeId = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TReference))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TReference 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()
+ 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 TReference object
+ '''
+ ''' string to deserialize
+ ''' Output TReference 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 TReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TReference)
+ 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 TReference) 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 TReference
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TReference)
+ 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 TReference
+ Return CType(SerializerXml.Deserialize(s), TReference)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TReference 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 TReference object
+ '''
+ ''' File to load and deserialize
+ ''' Output TReference 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 TReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TReference)
+ 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 TReference) 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 TReference
+ 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 TErrorDetail
+
+#Region "Private fields"
+ Private _timestamp As Date
+
+ Private _stackTrace As String
+
+ Private _additionalDetails As List(Of TErrorDetailAdditionalDetails)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._additionalDetails = New List(Of TErrorDetailAdditionalDetails)()
+ End Sub
+
+ Public Property timestamp() As Date
+ Get
+ Return Me._timestamp
+ End Get
+ Set
+ Me._timestamp = Value
+ End Set
+ End Property
+
+ Public Property stackTrace() As String
+ Get
+ Return Me._stackTrace
+ End Get
+ Set
+ Me._stackTrace = Value
+ End Set
+ End Property
+
+
+ Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails)
+ Get
+ Return Me._additionalDetails
+ End Get
+ Set
+ Me._additionalDetails = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TErrorDetail))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErrorDetail 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()
+ 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 TErrorDetail object
+ '''
+ ''' string to deserialize
+ ''' Output TErrorDetail 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 TErrorDetail, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorDetail)
+ 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 TErrorDetail) 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 TErrorDetail
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErrorDetail)
+ 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 TErrorDetail
+ Return CType(SerializerXml.Deserialize(s), TErrorDetail)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErrorDetail 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 TErrorDetail object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErrorDetail 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 TErrorDetail, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorDetail)
+ 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 TErrorDetail) 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 TErrorDetail
+ 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 TErrorDetailAdditionalDetails
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _key As String
+
+ Private _value As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+
+ Public Property key() As String
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = 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(TErrorDetailAdditionalDetails))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErrorDetailAdditionalDetails 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()
+ 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 TErrorDetailAdditionalDetails object
+ '''
+ ''' string to deserialize
+ ''' Output TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorDetailAdditionalDetails)
+ 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 TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails)
+ 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 TErrorDetailAdditionalDetails
+ Return CType(SerializerXml.Deserialize(s), TErrorDetailAdditionalDetails)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErrorDetailAdditionalDetails 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 TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErrorDetailAdditionalDetails)
+ 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 TErrorDetailAdditionalDetails) 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 TErrorDetailAdditionalDetails
+ 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 WarningMessages
+
+#Region "Private fields"
+ Private _warningMessage As List(Of TErrorMessageType)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._warningMessage = New List(Of TErrorMessageType)()
+ End Sub
+
+
+ Public Property WarningMessage() As List(Of TErrorMessageType)
+ Get
+ Return Me._warningMessage
+ End Get
+ Set
+ Me._warningMessage = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(WarningMessages))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize WarningMessages 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()
+ 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 WarningMessages object
+ '''
+ ''' string to deserialize
+ ''' Output WarningMessages 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 WarningMessages, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, WarningMessages)
+ 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 WarningMessages) 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 WarningMessages
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), WarningMessages)
+ 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 WarningMessages
+ Return CType(SerializerXml.Deserialize(s), WarningMessages)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current WarningMessages 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 WarningMessages object
+ '''
+ ''' File to load and deserialize
+ ''' Output WarningMessages 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 WarningMessages, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, WarningMessages)
+ 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 WarningMessages) 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 WarningMessages
+ 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/MIC/MIC_EXPORT/MicErrorWarningMessage.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.xsd
new file mode 100644
index 00000000..d2cbe34c
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.xsd
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Warning message used for all occurred warnings and minor exceptions
+
+
+
+
+ Error message used for all occurred exceptions
+
+
+
+
+ Fault message used for all occurred fault exceptions
+
+
+
+
+ Contains details to an error message
+
+
+
+
+
+ Stacktrace from Exception
+
+
+
+
+ Additional error details
+
+
+
+
+
+
+
+
+
+
+
+ General error type used for error messages
+
+
+
+
+ MIC Module where the error occured
+
+
+
+
+ Process inside the MIC module where the error occured
+
+
+
+
+ Error code to identify error
+
+
+
+
+ Description of the occurred exception
+
+
+
+
+
+ More detailed information about the error
+
+
+
+
+
+
+
+
+ MIC company
+
+
+
+
+ MIC plant
+
+
+
+
+ Unique reference number generated in MIC
+
+
+
+
+
+
+
+
+
+ Reference type used in MIC
+
+
+
+
+ Reference sid used MIC
+
+
+
+
+ MIC user
+
+
+
+
+ Partner ID used in MIC
+
+
+
+
+ ID of route where error is occurred
+
+
+
+
+
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.Designer.vb
new file mode 100644
index 00000000..1e39b8c5
--- /dev/null
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.Designer.vb
@@ -0,0 +1,19762 @@
+'' ------------------------------------------------------------------------------
+''
+'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
+'' {"TargetFramework":"Net48","NameSpace":"MicMetaSendExportShipment","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{},"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 MicMetaSendExportShipment
+
+
+ Partial Public Class SendExportShipment
+
+#Region "Private fields"
+ Private _exportShipmentMessage As TExportShipmentMessage
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._exportShipmentMessage = New TExportShipmentMessage()
+ End Sub
+
+ Public Property ExportShipmentMessage() As TExportShipmentMessage
+ Get
+ Return Me._exportShipmentMessage
+ End Get
+ Set
+ Me._exportShipmentMessage = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SendExportShipment))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize SendExportShipment 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()
+ 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 SendExportShipment object
+ '''
+ ''' string to deserialize
+ ''' Output SendExportShipment 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 SendExportShipment, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, SendExportShipment)
+ 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 SendExportShipment) 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 SendExportShipment
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SendExportShipment)
+ 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 SendExportShipment
+ Return CType(SerializerXml.Deserialize(s), SendExportShipment)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current SendExportShipment 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 SendExportShipment object
+ '''
+ ''' File to load and deserialize
+ ''' Output SendExportShipment 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 SendExportShipment, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, SendExportShipment)
+ 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 SendExportShipment) 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 SendExportShipment
+ 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 TExportShipmentMessage
+
+#Region "Private fields"
+ Private _metadata As TMicMetadata
+
+ Private _messageDetail As TMessageDetail
+
+ Private _exportShipment As ExportShipment
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._exportShipment = New ExportShipment()
+ Me._messageDetail = New TMessageDetail()
+ Me._metadata = New TMicMetadata()
+ End Sub
+
+
+ Public Property Metadata() As TMicMetadata
+ Get
+ Return Me._metadata
+ End Get
+ Set
+ Me._metadata = Value
+ End Set
+ End Property
+
+
+ Public Property MessageDetail() As TMessageDetail
+ Get
+ Return Me._messageDetail
+ End Get
+ Set
+ Me._messageDetail = Value
+ End Set
+ End Property
+
+
+ Public Property ExportShipment() As ExportShipment
+ Get
+ Return Me._exportShipment
+ End Get
+ Set
+ Me._exportShipment = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TExportShipmentMessage))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TExportShipmentMessage 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()
+ 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 TExportShipmentMessage object
+ '''
+ ''' string to deserialize
+ ''' Output TExportShipmentMessage 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 TExportShipmentMessage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TExportShipmentMessage)
+ 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 TExportShipmentMessage) 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 TExportShipmentMessage
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TExportShipmentMessage)
+ 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 TExportShipmentMessage
+ Return CType(SerializerXml.Deserialize(s), TExportShipmentMessage)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TExportShipmentMessage 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 TExportShipmentMessage object
+ '''
+ ''' File to load and deserialize
+ ''' Output TExportShipmentMessage 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 TExportShipmentMessage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TExportShipmentMessage)
+ 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 TExportShipmentMessage) 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 TExportShipmentMessage
+ 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 TMicMetadata
+
+#Region "Private fields"
+ Private _connectionId As String
+
+ Private _partnerId As String
+
+ Private _dateTime As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property connectionId() As String
+ Get
+ Return Me._connectionId
+ End Get
+ Set
+ Me._connectionId = Value
+ End Set
+ End Property
+
+ Public Property partnerId() As String
+ Get
+ Return Me._partnerId
+ End Get
+ Set
+ Me._partnerId = Value
+ End Set
+ End Property
+
+ Public Property dateTime() As Date
+ Get
+ Return Me._dateTime
+ End Get
+ Set
+ Me._dateTime = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicMetadata))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicMetadata 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()
+ 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 TMicMetadata object
+ '''
+ ''' string to deserialize
+ ''' Output TMicMetadata 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 TMicMetadata, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicMetadata)
+ 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 TMicMetadata) 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 TMicMetadata
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicMetadata)
+ 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 TMicMetadata
+ Return CType(SerializerXml.Deserialize(s), TMicMetadata)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicMetadata 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 TMicMetadata object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicMetadata 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 TMicMetadata, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicMetadata)
+ 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 TMicMetadata) 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 TMicMetadata
+ 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 TPackageLine
+
+#Region "Private fields"
+ Private _invNo As String
+
+ Private _invoiceVersion As String
+
+ Private _invPos As String
+
+ Private _quantity As Decimal
+
+ Private _unit As String
+
+ Private _nWeight As Decimal
+
+ Private _numberOfPackages As Long
+
+ Private _itemQuantity As Long
+
+ Private _itemUnit As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._invoiceVersion = "1"
+ End Sub
+
+ Public Property invNo() As String
+ Get
+ Return Me._invNo
+ End Get
+ Set
+ Me._invNo = Value
+ End Set
+ End Property
+
+
+ Public Property invoiceVersion() As String
+ Get
+ Return Me._invoiceVersion
+ End Get
+ Set
+ Me._invoiceVersion = Value
+ End Set
+ End Property
+
+
+ Public Property invPos() As String
+ Get
+ Return Me._invPos
+ End Get
+ Set
+ Me._invPos = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property numberOfPackages() As Long
+ Get
+ Return Me._numberOfPackages
+ End Get
+ Set
+ Me._numberOfPackages = Value
+ End Set
+ End Property
+
+ Public Property itemQuantity() As Long
+ Get
+ Return Me._itemQuantity
+ End Get
+ Set
+ Me._itemQuantity = Value
+ End Set
+ End Property
+
+ Public Property itemUnit() As String
+ Get
+ Return Me._itemUnit
+ End Get
+ Set
+ Me._itemUnit = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackageLine))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackageLine 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()
+ 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 TPackageLine object
+ '''
+ ''' string to deserialize
+ ''' Output TPackageLine 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 TPackageLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageLine)
+ 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 TPackageLine) 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 TPackageLine
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackageLine)
+ 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 TPackageLine
+ Return CType(SerializerXml.Deserialize(s), TPackageLine)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackageLine 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 TPackageLine object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackageLine 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 TPackageLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageLine)
+ 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 TPackageLine) 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 TPackageLine
+ 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 TPackageHead
+
+#Region "Private fields"
+ Private _packageNo As String
+
+ Private _pType As String
+
+ Private _unit As String
+
+ Private _packageNoExt As String
+
+ Private _gWeight As Decimal
+
+ Private _nWeight As Decimal
+
+ Private _tara As Decimal
+
+ Private _unitWeight As String
+
+ Private _volume As Decimal
+
+ Private _grossVolume As Decimal
+
+ Private _netVolume As Decimal
+
+ Private _unitVolume As String
+
+ Private _length As Decimal
+
+ Private _width As Decimal
+
+ Private _height As Decimal
+
+ Private _unitlwh As String
+
+ Private _description As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property packageNo() As String
+ Get
+ Return Me._packageNo
+ End Get
+ Set
+ Me._packageNo = Value
+ End Set
+ End Property
+
+ Public Property pType() As String
+ Get
+ Return Me._pType
+ End Get
+ Set
+ Me._pType = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property packageNoExt() As String
+ Get
+ Return Me._packageNoExt
+ End Get
+ Set
+ Me._packageNoExt = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property tara() As Decimal
+ Get
+ Return Me._tara
+ End Get
+ Set
+ Me._tara = Value
+ End Set
+ End Property
+
+ Public Property unitWeight() As String
+ Get
+ Return Me._unitWeight
+ End Get
+ Set
+ Me._unitWeight = Value
+ End Set
+ End Property
+
+ Public Property volume() As Decimal
+ Get
+ Return Me._volume
+ End Get
+ Set
+ Me._volume = Value
+ End Set
+ End Property
+
+ Public Property grossVolume() As Decimal
+ Get
+ Return Me._grossVolume
+ End Get
+ Set
+ Me._grossVolume = Value
+ End Set
+ End Property
+
+ Public Property netVolume() As Decimal
+ Get
+ Return Me._netVolume
+ End Get
+ Set
+ Me._netVolume = Value
+ End Set
+ End Property
+
+ Public Property unitVolume() As String
+ Get
+ Return Me._unitVolume
+ End Get
+ Set
+ Me._unitVolume = Value
+ End Set
+ End Property
+
+ Public Property length() As Decimal
+ Get
+ Return Me._length
+ End Get
+ Set
+ Me._length = Value
+ End Set
+ End Property
+
+ Public Property width() As Decimal
+ Get
+ Return Me._width
+ End Get
+ Set
+ Me._width = Value
+ End Set
+ End Property
+
+ Public Property height() As Decimal
+ Get
+ Return Me._height
+ End Get
+ Set
+ Me._height = Value
+ End Set
+ End Property
+
+ Public Property unitlwh() As String
+ Get
+ Return Me._unitlwh
+ End Get
+ Set
+ Me._unitlwh = Value
+ End Set
+ End Property
+
+ Public Property description() As String
+ Get
+ Return Me._description
+ End Get
+ Set
+ Me._description = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackageHead))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackageHead 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()
+ 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 TPackageHead object
+ '''
+ ''' string to deserialize
+ ''' Output TPackageHead 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 TPackageHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageHead)
+ 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 TPackageHead) 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 TPackageHead
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackageHead)
+ 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 TPackageHead
+ Return CType(SerializerXml.Deserialize(s), TPackageHead)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackageHead 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 TPackageHead object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackageHead 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 TPackageHead, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackageHead)
+ 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 TPackageHead) 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 TPackageHead
+ 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 TPackage
+
+#Region "Private fields"
+ Private _packageHead As TPackageHead
+
+ Private _packageLine As List(Of TPackageLine)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._packageLine = New List(Of TPackageLine)()
+ Me._packageHead = New TPackageHead()
+ End Sub
+
+ Public Property packageHead() As TPackageHead
+ Get
+ Return Me._packageHead
+ End Get
+ Set
+ Me._packageHead = Value
+ End Set
+ End Property
+
+
+ Public Property packageLine() As List(Of TPackageLine)
+ Get
+ Return Me._packageLine
+ End Get
+ Set
+ Me._packageLine = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPackage))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPackage 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()
+ 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 TPackage object
+ '''
+ ''' string to deserialize
+ ''' Output TPackage 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 TPackage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackage)
+ 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 TPackage) 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 TPackage
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPackage)
+ 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 TPackage
+ Return CType(SerializerXml.Deserialize(s), TPackage)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPackage 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 TPackage object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPackage 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 TPackage, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPackage)
+ 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 TPackage) 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 TPackage
+ 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 TMicDutyTax
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _calculationBase As Decimal
+
+ Private _calculationBaseUom As String
+
+ Private _code As String
+
+ Private _rate As Decimal
+
+ Private _dutyAmount As Decimal
+
+ Private _additionalCosts As Decimal
+
+ Private _calculatedDuties As Decimal
+
+ Private _paymentCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property calculationBase() As Decimal
+ Get
+ Return Me._calculationBase
+ End Get
+ Set
+ Me._calculationBase = Value
+ End Set
+ End Property
+
+ Public Property calculationBaseUom() As String
+ Get
+ Return Me._calculationBaseUom
+ End Get
+ Set
+ Me._calculationBaseUom = Value
+ End Set
+ End Property
+
+ Public Property code() As String
+ Get
+ Return Me._code
+ End Get
+ Set
+ Me._code = Value
+ End Set
+ End Property
+
+ Public Property rate() As Decimal
+ Get
+ Return Me._rate
+ End Get
+ Set
+ Me._rate = Value
+ End Set
+ End Property
+
+ Public Property dutyAmount() As Decimal
+ Get
+ Return Me._dutyAmount
+ End Get
+ Set
+ Me._dutyAmount = Value
+ End Set
+ End Property
+
+ Public Property additionalCosts() As Decimal
+ Get
+ Return Me._additionalCosts
+ End Get
+ Set
+ Me._additionalCosts = Value
+ End Set
+ End Property
+
+ Public Property calculatedDuties() As Decimal
+ Get
+ Return Me._calculatedDuties
+ End Get
+ Set
+ Me._calculatedDuties = Value
+ End Set
+ End Property
+
+ Public Property paymentCode() As String
+ Get
+ Return Me._paymentCode
+ End Get
+ Set
+ Me._paymentCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTax))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDutyTax 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()
+ 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 TMicDutyTax object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTax)
+ 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 TMicDutyTax) 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 TMicDutyTax
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTax)
+ 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 TMicDutyTax
+ Return CType(SerializerXml.Deserialize(s), TMicDutyTax)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDutyTax 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 TMicDutyTax object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDutyTax 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 TMicDutyTax, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTax)
+ 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 TMicDutyTax) 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 TMicDutyTax
+ 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 TMicDutyTaxes
+
+#Region "Private fields"
+ Private _dutyTax As List(Of TMicDutyTax)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._dutyTax = New List(Of TMicDutyTax)()
+ End Sub
+
+
+ Public Property DutyTax() As List(Of TMicDutyTax)
+ Get
+ Return Me._dutyTax
+ End Get
+ Set
+ Me._dutyTax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutyTaxes))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDutyTaxes 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()
+ 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 TMicDutyTaxes object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTaxes)
+ 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 TMicDutyTaxes) 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 TMicDutyTaxes
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutyTaxes)
+ 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 TMicDutyTaxes
+ Return CType(SerializerXml.Deserialize(s), TMicDutyTaxes)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDutyTaxes 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 TMicDutyTaxes object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDutyTaxes 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 TMicDutyTaxes, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDutyTaxes)
+ 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 TMicDutyTaxes) 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 TMicDutyTaxes
+ 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 TMicDuty
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _calculatedDutyBase As Decimal
+
+ Private _currency As String
+
+ Private _code As String
+
+ Private _rate As Decimal
+
+ Private _amount As Decimal
+
+ Private _addDeduct As Decimal
+
+ Private _calculatedDuty As Decimal
+
+ Private _duty As Decimal
+
+ Private _dutyBase As Decimal
+
+ Private _measureCode As String
+
+ Private _measure As String
+
+ Private _authorityDutyCode As String
+
+ Private _territory As String
+
+ Private _typeAddCode As String
+
+ Private _numberAddCode As String
+
+ Private _tariffRateQuota As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property calculatedDutyBase() As Decimal
+ Get
+ Return Me._calculatedDutyBase
+ End Get
+ Set
+ Me._calculatedDutyBase = Value
+ End Set
+ End Property
+
+ Public Property currency() As String
+ Get
+ Return Me._currency
+ End Get
+ Set
+ Me._currency = Value
+ End Set
+ End Property
+
+ Public Property code() As String
+ Get
+ Return Me._code
+ End Get
+ Set
+ Me._code = Value
+ End Set
+ End Property
+
+ Public Property rate() As Decimal
+ Get
+ Return Me._rate
+ End Get
+ Set
+ Me._rate = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property addDeduct() As Decimal
+ Get
+ Return Me._addDeduct
+ End Get
+ Set
+ Me._addDeduct = Value
+ End Set
+ End Property
+
+ Public Property calculatedDuty() As Decimal
+ Get
+ Return Me._calculatedDuty
+ End Get
+ Set
+ Me._calculatedDuty = Value
+ End Set
+ End Property
+
+ Public Property duty() As Decimal
+ Get
+ Return Me._duty
+ End Get
+ Set
+ Me._duty = Value
+ End Set
+ End Property
+
+ Public Property dutyBase() As Decimal
+ Get
+ Return Me._dutyBase
+ End Get
+ Set
+ Me._dutyBase = Value
+ End Set
+ End Property
+
+ Public Property measureCode() As String
+ Get
+ Return Me._measureCode
+ End Get
+ Set
+ Me._measureCode = Value
+ End Set
+ End Property
+
+ Public Property measure() As String
+ Get
+ Return Me._measure
+ End Get
+ Set
+ Me._measure = Value
+ End Set
+ End Property
+
+ Public Property authorityDutyCode() As String
+ Get
+ Return Me._authorityDutyCode
+ End Get
+ Set
+ Me._authorityDutyCode = Value
+ End Set
+ End Property
+
+ Public Property territory() As String
+ Get
+ Return Me._territory
+ End Get
+ Set
+ Me._territory = Value
+ End Set
+ End Property
+
+ Public Property typeAddCode() As String
+ Get
+ Return Me._typeAddCode
+ End Get
+ Set
+ Me._typeAddCode = Value
+ End Set
+ End Property
+
+ Public Property numberAddCode() As String
+ Get
+ Return Me._numberAddCode
+ End Get
+ Set
+ Me._numberAddCode = Value
+ End Set
+ End Property
+
+ Public Property tariffRateQuota() As String
+ Get
+ Return Me._tariffRateQuota
+ End Get
+ Set
+ Me._tariffRateQuota = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuty))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDuty 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()
+ 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 TMicDuty object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuty)
+ 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 TMicDuty) 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 TMicDuty
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuty)
+ 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 TMicDuty
+ Return CType(SerializerXml.Deserialize(s), TMicDuty)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDuty 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 TMicDuty object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDuty 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 TMicDuty, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuty)
+ 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 TMicDuty) 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 TMicDuty
+ 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 TMicDuties
+
+#Region "Private fields"
+ Private _duty As List(Of TMicDuty)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._duty = New List(Of TMicDuty)()
+ End Sub
+
+
+ Public Property Duty() As List(Of TMicDuty)
+ Get
+ Return Me._duty
+ End Get
+ Set
+ Me._duty = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDuties))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TMicDuties 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()
+ 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 TMicDuties object
+ '''
+ ''' string to deserialize
+ ''' Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuties)
+ 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 TMicDuties) 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 TMicDuties
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDuties)
+ 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 TMicDuties
+ Return CType(SerializerXml.Deserialize(s), TMicDuties)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TMicDuties 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 TMicDuties object
+ '''
+ ''' File to load and deserialize
+ ''' Output TMicDuties 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 TMicDuties, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TMicDuties)
+ 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 TMicDuties) 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 TMicDuties
+ 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 TErpLineData
+
+#Region "Private fields"
+ Private _legalRegulation As String
+
+ Private _exportControlClass As String
+
+ Private _embargo As String
+
+ Private _licenseType As String
+
+ Private _licenseNumber As String
+
+ Private _profitCenter As String
+
+ Private _vZTA As String
+
+ Private _erpInvoicelinenumber As String
+
+ Private _erpPartnumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property legalRegulation() As String
+ Get
+ Return Me._legalRegulation
+ End Get
+ Set
+ Me._legalRegulation = Value
+ End Set
+ End Property
+
+ Public Property exportControlClass() As String
+ Get
+ Return Me._exportControlClass
+ End Get
+ Set
+ Me._exportControlClass = Value
+ End Set
+ End Property
+
+ Public Property embargo() As String
+ Get
+ Return Me._embargo
+ End Get
+ Set
+ Me._embargo = Value
+ End Set
+ End Property
+
+ Public Property licenseType() As String
+ Get
+ Return Me._licenseType
+ End Get
+ Set
+ Me._licenseType = Value
+ End Set
+ End Property
+
+ Public Property licenseNumber() As String
+ Get
+ Return Me._licenseNumber
+ End Get
+ Set
+ Me._licenseNumber = Value
+ End Set
+ End Property
+
+ Public Property profitCenter() As String
+ Get
+ Return Me._profitCenter
+ End Get
+ Set
+ Me._profitCenter = Value
+ End Set
+ End Property
+
+ Public Property vZTA() As String
+ Get
+ Return Me._vZTA
+ End Get
+ Set
+ Me._vZTA = Value
+ End Set
+ End Property
+
+
+ Public Property erpInvoicelinenumber() As String
+ Get
+ Return Me._erpInvoicelinenumber
+ End Get
+ Set
+ Me._erpInvoicelinenumber = Value
+ End Set
+ End Property
+
+ Public Property erpPartnumber() As String
+ Get
+ Return Me._erpPartnumber
+ End Get
+ Set
+ Me._erpPartnumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TErpLineData))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TErpLineData 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()
+ 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 TErpLineData object
+ '''
+ ''' string to deserialize
+ ''' Output TErpLineData 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 TErpLineData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpLineData)
+ 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 TErpLineData) 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 TErpLineData
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TErpLineData)
+ 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 TErpLineData
+ Return CType(SerializerXml.Deserialize(s), TErpLineData)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TErpLineData 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 TErpLineData object
+ '''
+ ''' File to load and deserialize
+ ''' Output TErpLineData 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 TErpLineData, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TErpLineData)
+ 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 TErpLineData) 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 TErpLineData
+ 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 TRegInfo
+
+#Region "Private fields"
+ Private _registrationNumber1 As String
+
+ Private _registrationNumber2 As String
+
+ Private _registrationNumber3 As String
+
+ Private _referenceNumber1 As String
+
+ Private _referenceNumber2 As String
+
+ Private _referenceNumber3 As String
+
+ Private _registrationDate As Date
+
+ Private _acceptanceDate As Date
+
+ Private _releaseDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property registrationNumber1() As String
+ Get
+ Return Me._registrationNumber1
+ End Get
+ Set
+ Me._registrationNumber1 = Value
+ End Set
+ End Property
+
+ Public Property registrationNumber2() As String
+ Get
+ Return Me._registrationNumber2
+ End Get
+ Set
+ Me._registrationNumber2 = Value
+ End Set
+ End Property
+
+ Public Property registrationNumber3() As String
+ Get
+ Return Me._registrationNumber3
+ End Get
+ Set
+ Me._registrationNumber3 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber1() As String
+ Get
+ Return Me._referenceNumber1
+ End Get
+ Set
+ Me._referenceNumber1 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber2() As String
+ Get
+ Return Me._referenceNumber2
+ End Get
+ Set
+ Me._referenceNumber2 = Value
+ End Set
+ End Property
+
+ Public Property referenceNumber3() As String
+ Get
+ Return Me._referenceNumber3
+ End Get
+ Set
+ Me._referenceNumber3 = Value
+ End Set
+ End Property
+
+
+ Public Property registrationDate() As Date
+ Get
+ Return Me._registrationDate
+ End Get
+ Set
+ Me._registrationDate = Value
+ End Set
+ End Property
+
+
+ Public Property acceptanceDate() As Date
+ Get
+ Return Me._acceptanceDate
+ End Get
+ Set
+ Me._acceptanceDate = Value
+ End Set
+ End Property
+
+
+ Public Property releaseDate() As Date
+ Get
+ Return Me._releaseDate
+ End Get
+ Set
+ Me._releaseDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRegInfo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TRegInfo 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()
+ 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 TRegInfo object
+ '''
+ ''' string to deserialize
+ ''' Output TRegInfo 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 TRegInfo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRegInfo)
+ 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 TRegInfo) 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 TRegInfo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRegInfo)
+ 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 TRegInfo
+ Return CType(SerializerXml.Deserialize(s), TRegInfo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TRegInfo 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 TRegInfo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TRegInfo 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 TRegInfo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TRegInfo)
+ 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 TRegInfo) 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 TRegInfo
+ 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 TImportQuantity
+
+#Region "Private fields"
+ Private _qualifier As String
+
+ Private _unit As String
+
+ Private _value As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property qualifier() As String
+ Get
+ Return Me._qualifier
+ End Get
+ Set
+ Me._qualifier = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property value() As Decimal
+ 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(TImportQuantity))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TImportQuantity 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()
+ 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 TImportQuantity object
+ '''
+ ''' string to deserialize
+ ''' Output TImportQuantity 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 TImportQuantity, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportQuantity)
+ 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 TImportQuantity) 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 TImportQuantity
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TImportQuantity)
+ 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 TImportQuantity
+ Return CType(SerializerXml.Deserialize(s), TImportQuantity)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TImportQuantity 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 TImportQuantity object
+ '''
+ ''' File to load and deserialize
+ ''' Output TImportQuantity 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 TImportQuantity, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportQuantity)
+ 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 TImportQuantity) 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 TImportQuantity
+ 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 TImportReference
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _authType As String
+
+ Private _authNr As String
+
+ Private _mrn As String
+
+ Private _impShpNr As String
+
+ Private _lineNo As String
+
+ Private _authRegistryNo As String
+
+ Private _commCode As String
+
+ Private _usualTreatment As String
+
+ Private _importAtlas As String
+
+ Private _addInfo As String
+
+ Private _quantity As TImportQuantity
+
+ Private _tradeQuantity As TImportQuantity
+
+ Private _packageQuantity As Decimal
+
+ Private _netMass As Decimal
+
+ Private _grossMass As Decimal
+
+ Private _statisticalQuantity As Decimal
+
+ Private _simpleIprApplication As String
+
+ Private _supervisingOffice As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._tradeQuantity = New TImportQuantity()
+ Me._quantity = New TImportQuantity()
+ End Sub
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property authType() As String
+ Get
+ Return Me._authType
+ End Get
+ Set
+ Me._authType = Value
+ End Set
+ End Property
+
+ Public Property authNr() As String
+ Get
+ Return Me._authNr
+ End Get
+ Set
+ Me._authNr = Value
+ End Set
+ End Property
+
+ Public Property mrn() As String
+ Get
+ Return Me._mrn
+ End Get
+ Set
+ Me._mrn = Value
+ End Set
+ End Property
+
+ Public Property impShpNr() As String
+ Get
+ Return Me._impShpNr
+ End Get
+ Set
+ Me._impShpNr = Value
+ End Set
+ End Property
+
+
+ Public Property lineNo() As String
+ Get
+ Return Me._lineNo
+ End Get
+ Set
+ Me._lineNo = Value
+ End Set
+ End Property
+
+ Public Property authRegistryNo() As String
+ Get
+ Return Me._authRegistryNo
+ End Get
+ Set
+ Me._authRegistryNo = Value
+ End Set
+ End Property
+
+ Public Property commCode() As String
+ Get
+ Return Me._commCode
+ End Get
+ Set
+ Me._commCode = Value
+ End Set
+ End Property
+
+ Public Property usualTreatment() As String
+ Get
+ Return Me._usualTreatment
+ End Get
+ Set
+ Me._usualTreatment = Value
+ End Set
+ End Property
+
+ Public Property importAtlas() As String
+ Get
+ Return Me._importAtlas
+ End Get
+ Set
+ Me._importAtlas = Value
+ End Set
+ End Property
+
+ Public Property addInfo() As String
+ Get
+ Return Me._addInfo
+ End Get
+ Set
+ Me._addInfo = Value
+ End Set
+ End Property
+
+ Public Property quantity() As TImportQuantity
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property tradeQuantity() As TImportQuantity
+ Get
+ Return Me._tradeQuantity
+ End Get
+ Set
+ Me._tradeQuantity = Value
+ End Set
+ End Property
+
+ Public Property packageQuantity() As Decimal
+ Get
+ Return Me._packageQuantity
+ End Get
+ Set
+ Me._packageQuantity = Value
+ End Set
+ End Property
+
+ Public Property netMass() As Decimal
+ Get
+ Return Me._netMass
+ End Get
+ Set
+ Me._netMass = Value
+ End Set
+ End Property
+
+ Public Property grossMass() As Decimal
+ Get
+ Return Me._grossMass
+ End Get
+ Set
+ Me._grossMass = Value
+ End Set
+ End Property
+
+ Public Property statisticalQuantity() As Decimal
+ Get
+ Return Me._statisticalQuantity
+ End Get
+ Set
+ Me._statisticalQuantity = Value
+ End Set
+ End Property
+
+ Public Property simpleIprApplication() As String
+ Get
+ Return Me._simpleIprApplication
+ End Get
+ Set
+ Me._simpleIprApplication = Value
+ End Set
+ End Property
+
+ Public Property supervisingOffice() As String
+ Get
+ Return Me._supervisingOffice
+ End Get
+ Set
+ Me._supervisingOffice = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TImportReference))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TImportReference 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()
+ 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 TImportReference object
+ '''
+ ''' string to deserialize
+ ''' Output TImportReference 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 TImportReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportReference)
+ 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 TImportReference) 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 TImportReference
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TImportReference)
+ 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 TImportReference
+ Return CType(SerializerXml.Deserialize(s), TImportReference)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TImportReference 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 TImportReference object
+ '''
+ ''' File to load and deserialize
+ ''' Output TImportReference 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 TImportReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TImportReference)
+ 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 TImportReference) 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 TImportReference
+ 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 TBomNo
+
+#Region "Private fields"
+ Private _no As String
+
+ Private _var As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property no() As String
+ Get
+ Return Me._no
+ End Get
+ Set
+ Me._no = Value
+ End Set
+ End Property
+
+ Public Property var() As String
+ Get
+ Return Me._var
+ End Get
+ Set
+ Me._var = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TBomNo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TBomNo 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()
+ 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 TBomNo object
+ '''
+ ''' string to deserialize
+ ''' Output TBomNo 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 TBomNo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TBomNo)
+ 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 TBomNo) 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 TBomNo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TBomNo)
+ 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 TBomNo
+ Return CType(SerializerXml.Deserialize(s), TBomNo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TBomNo 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 TBomNo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TBomNo 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 TBomNo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TBomNo)
+ 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 TBomNo) 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 TBomNo
+ 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 TOrder
+
+#Region "Private fields"
+ Private _ordNo As String
+
+ Private _ordDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property ordNo() As String
+ Get
+ Return Me._ordNo
+ End Get
+ Set
+ Me._ordNo = Value
+ End Set
+ End Property
+
+
+ Public Property ordDate() As Date
+ Get
+ Return Me._ordDate
+ End Get
+ Set
+ Me._ordDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TOrder))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TOrder 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()
+ 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 TOrder object
+ '''
+ ''' string to deserialize
+ ''' Output TOrder 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 TOrder, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TOrder)
+ 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 TOrder) 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 TOrder
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TOrder)
+ 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 TOrder
+ Return CType(SerializerXml.Deserialize(s), TOrder)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TOrder 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 TOrder object
+ '''
+ ''' File to load and deserialize
+ ''' Output TOrder 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 TOrder, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TOrder)
+ 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 TOrder) 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 TOrder
+ 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 TDelNote
+
+#Region "Private fields"
+ Private _delNo As String
+
+ Private _position As Long
+
+ Private _delDate As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property delNo() As String
+ Get
+ Return Me._delNo
+ End Get
+ Set
+ Me._delNo = Value
+ End Set
+ End Property
+
+ Public Property position() As Long
+ Get
+ Return Me._position
+ End Get
+ Set
+ Me._position = Value
+ End Set
+ End Property
+
+
+ Public Property delDate() As Date
+ Get
+ Return Me._delDate
+ End Get
+ Set
+ Me._delDate = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDelNote))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDelNote 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()
+ 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 TDelNote object
+ '''
+ ''' string to deserialize
+ ''' Output TDelNote 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 TDelNote, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelNote)
+ 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 TDelNote) 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 TDelNote
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDelNote)
+ 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 TDelNote
+ Return CType(SerializerXml.Deserialize(s), TDelNote)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDelNote 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 TDelNote object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDelNote 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 TDelNote, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDelNote)
+ 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 TDelNote) 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 TDelNote
+ 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 TItem
+
+#Region "Private fields"
+ Private _itemNo As String
+
+ Private _itemDesc As String
+
+ Private _commCode As String
+
+ Private _prodGr As String
+
+ Private _cusCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property itemNo() As String
+ Get
+ Return Me._itemNo
+ End Get
+ Set
+ Me._itemNo = Value
+ End Set
+ End Property
+
+ Public Property itemDesc() As String
+ Get
+ Return Me._itemDesc
+ End Get
+ Set
+ Me._itemDesc = Value
+ End Set
+ End Property
+
+ Public Property commCode() As String
+ Get
+ Return Me._commCode
+ End Get
+ Set
+ Me._commCode = Value
+ End Set
+ End Property
+
+ Public Property prodGr() As String
+ Get
+ Return Me._prodGr
+ End Get
+ Set
+ Me._prodGr = Value
+ End Set
+ End Property
+
+ Public Property cusCode() As String
+ Get
+ Return Me._cusCode
+ End Get
+ Set
+ Me._cusCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TItem))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TItem 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()
+ 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 TItem object
+ '''
+ ''' string to deserialize
+ ''' Output TItem 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 TItem, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TItem)
+ 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 TItem) 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 TItem
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TItem)
+ 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 TItem
+ Return CType(SerializerXml.Deserialize(s), TItem)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TItem 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 TItem object
+ '''
+ ''' File to load and deserialize
+ ''' Output TItem 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 TItem, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TItem)
+ 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 TItem) 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 TItem
+ 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 TPreviousDocument
+
+#Region "Private fields"
+ Private _docType As String
+
+ Private _docQual As String
+
+ Private _docNo As String
+
+ Private _docAddText As String
+
+ Private _docCategory As String
+
+ Private _itemNumber As String
+
+ Private _unit As String
+
+ Private _quantity As Decimal
+
+ Private _numberOfPackages As String
+
+ Private _packageType As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property docType() As String
+ Get
+ Return Me._docType
+ End Get
+ Set
+ Me._docType = Value
+ End Set
+ End Property
+
+ Public Property docQual() As String
+ Get
+ Return Me._docQual
+ End Get
+ Set
+ Me._docQual = Value
+ End Set
+ End Property
+
+ Public Property docNo() As String
+ Get
+ Return Me._docNo
+ End Get
+ Set
+ Me._docNo = Value
+ End Set
+ End Property
+
+ Public Property docAddText() As String
+ Get
+ Return Me._docAddText
+ End Get
+ Set
+ Me._docAddText = Value
+ End Set
+ End Property
+
+ Public Property docCategory() As String
+ Get
+ Return Me._docCategory
+ End Get
+ Set
+ Me._docCategory = Value
+ End Set
+ End Property
+
+
+ Public Property itemNumber() As String
+ Get
+ Return Me._itemNumber
+ End Get
+ Set
+ Me._itemNumber = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+
+ Public Property numberOfPackages() As String
+ Get
+ Return Me._numberOfPackages
+ End Get
+ Set
+ Me._numberOfPackages = Value
+ End Set
+ End Property
+
+ Public Property packageType() As String
+ Get
+ Return Me._packageType
+ End Get
+ Set
+ Me._packageType = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TPreviousDocument))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TPreviousDocument 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()
+ 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 TPreviousDocument object
+ '''
+ ''' string to deserialize
+ ''' Output TPreviousDocument 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 TPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPreviousDocument)
+ 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 TPreviousDocument) 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 TPreviousDocument
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TPreviousDocument)
+ 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 TPreviousDocument
+ Return CType(SerializerXml.Deserialize(s), TPreviousDocument)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TPreviousDocument 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 TPreviousDocument object
+ '''
+ ''' File to load and deserialize
+ ''' Output TPreviousDocument 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 TPreviousDocument, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TPreviousDocument)
+ 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 TPreviousDocument) 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 TPreviousDocument
+ 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 TInvoiceLine
+
+#Region "Private fields"
+ Private _lineNo As String
+
+ Private _unitPrice As Decimal
+
+ Private _amount As Decimal
+
+ Private _nWeight As Decimal
+
+ Private _gWeight As Decimal
+
+ Private _statQuant As Decimal
+
+ Private _statUnit As String
+
+ Private _statVal As Decimal
+
+ Private _custProc As String
+
+ Private _eUCode As String
+
+ Private _statCode As String
+
+ Private _transType As String
+
+ Private _exportCountry As String
+
+ Private _coo As String
+
+ Private _cooState As String
+
+ Private _addText As List(Of String)
+
+ Private _prevDoc As List(Of TPreviousDocument)
+
+ Private _item As TItem
+
+ Private _taricAddCode As List(Of TInvoiceLineTaricAddCode)
+
+ Private _dangerousGoods As List(Of TInvoiceLineDangerousGoods)
+
+ Private _documents As List(Of TDocuments)
+
+ Private _delTerm As TInvoiceLineDelTerm
+
+ Private _quantity As Decimal
+
+ Private _unit As String
+
+ Private _specialQuantity As Decimal
+
+ Private _specialQuantityUnit As String
+
+ Private _delnote As TDelNote
+
+ Private _order As TOrder
+
+ Private _itemRef As String
+
+ Private _addCosts As List(Of TAddCosts)
+
+ Private _addCode As List(Of String)
+
+ Private _natCode As List(Of String)
+
+ Private _stockTypeAdd As String
+
+ Private _stockTypeDed As String
+
+ Private _bom As TBomNo
+
+ Private _accountNo As String
+
+ Private _customerFields As TCustomerFields
+
+ Private _attributes As List(Of TAttribute)
+
+ Private _containers As List(Of TContainer)
+
+ Private _shipmentIdentification As String
+
+ Private _uNDG As String
+
+ Private _consigneeEndUserFlag As String
+
+ Private _endUserInEam As TInvoiceLineEndUserInEam
+
+ Private _carriageCosts As String
+
+ Private _shipTo As TInvoiceLineShipTo
+
+ Private _endUser As TInvoiceLineEndUser
+
+ Private _importReference As List(Of TImportReference)
+
+ Private _registrationInfo As TRegInfo
+
+ Private _serialNo As String
+
+ Private _referenceValue As Decimal
+
+ Private _model As String
+
+ Private _brand As String
+
+ Private _addedValue As Decimal
+
+ Private _ctoId As String
+
+ Private _infoText2 As String
+
+ Private _branchNo As String
+
+ Private _additionalInformation As List(Of TAttribute)
+
+ Private _trackingNumber As String
+
+ Private _erpData As TErpLineData
+
+ Private _outwardProcessing As TInvoiceLineOutwardProcessing
+
+ Private _partners As List(Of TPartner)
+
+ Private _authorisations As List(Of TAuthorisation)
+
+ Private _eudr As TInvoiceLineEudr
+
+ Private _duties As TMicDuties
+
+ Private _dutyTaxes As TMicDutyTaxes
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._dutyTaxes = New TMicDutyTaxes()
+ Me._duties = New TMicDuties()
+ Me._eudr = New TInvoiceLineEudr()
+ Me._authorisations = New List(Of TAuthorisation)()
+ Me._partners = New List(Of TPartner)()
+ Me._outwardProcessing = New TInvoiceLineOutwardProcessing()
+ Me._erpData = New TErpLineData()
+ Me._additionalInformation = New List(Of TAttribute)()
+ Me._registrationInfo = New TRegInfo()
+ Me._importReference = New List(Of TImportReference)()
+ Me._endUser = New TInvoiceLineEndUser()
+ Me._shipTo = New TInvoiceLineShipTo()
+ Me._containers = New List(Of TContainer)()
+ Me._attributes = New List(Of TAttribute)()
+ Me._customerFields = New TCustomerFields()
+ Me._bom = New TBomNo()
+ Me._natCode = New List(Of String)()
+ Me._addCode = New List(Of String)()
+ Me._addCosts = New List(Of TAddCosts)()
+ Me._order = New TOrder()
+ Me._delnote = New TDelNote()
+ Me._delTerm = New TInvoiceLineDelTerm()
+ Me._documents = New List(Of TDocuments)()
+ Me._dangerousGoods = New List(Of TInvoiceLineDangerousGoods)()
+ Me._taricAddCode = New List(Of TInvoiceLineTaricAddCode)()
+ Me._item = New TItem()
+ Me._prevDoc = New List(Of TPreviousDocument)()
+ Me._addText = New List(Of String)()
+ End Sub
+
+
+ Public Property lineNo() As String
+ Get
+ Return Me._lineNo
+ End Get
+ Set
+ Me._lineNo = Value
+ End Set
+ End Property
+
+ Public Property unitPrice() As Decimal
+ Get
+ Return Me._unitPrice
+ End Get
+ Set
+ Me._unitPrice = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property nWeight() As Decimal
+ Get
+ Return Me._nWeight
+ End Get
+ Set
+ Me._nWeight = Value
+ End Set
+ End Property
+
+ Public Property gWeight() As Decimal
+ Get
+ Return Me._gWeight
+ End Get
+ Set
+ Me._gWeight = Value
+ End Set
+ End Property
+
+ Public Property statQuant() As Decimal
+ Get
+ Return Me._statQuant
+ End Get
+ Set
+ Me._statQuant = Value
+ End Set
+ End Property
+
+ Public Property statUnit() As String
+ Get
+ Return Me._statUnit
+ End Get
+ Set
+ Me._statUnit = Value
+ End Set
+ End Property
+
+ Public Property statVal() As Decimal
+ Get
+ Return Me._statVal
+ End Get
+ Set
+ Me._statVal = Value
+ End Set
+ End Property
+
+ Public Property custProc() As String
+ Get
+ Return Me._custProc
+ End Get
+ Set
+ Me._custProc = Value
+ End Set
+ End Property
+
+ Public Property EUCode() As String
+ Get
+ Return Me._eUCode
+ End Get
+ Set
+ Me._eUCode = Value
+ End Set
+ End Property
+
+ Public Property statCode() As String
+ Get
+ Return Me._statCode
+ End Get
+ Set
+ Me._statCode = Value
+ End Set
+ End Property
+
+ Public Property transType() As String
+ Get
+ Return Me._transType
+ End Get
+ Set
+ Me._transType = Value
+ End Set
+ End Property
+
+ Public Property exportCountry() As String
+ Get
+ Return Me._exportCountry
+ End Get
+ Set
+ Me._exportCountry = Value
+ End Set
+ End Property
+
+ Public Property coo() As String
+ Get
+ Return Me._coo
+ End Get
+ Set
+ Me._coo = Value
+ End Set
+ End Property
+
+ Public Property cooState() As String
+ Get
+ Return Me._cooState
+ End Get
+ Set
+ Me._cooState = Value
+ End Set
+ End Property
+
+
+ Public Property addText() As List(Of String)
+ Get
+ Return Me._addText
+ End Get
+ Set
+ Me._addText = Value
+ End Set
+ End Property
+
+
+ Public Property prevDoc() As List(Of TPreviousDocument)
+ Get
+ Return Me._prevDoc
+ End Get
+ Set
+ Me._prevDoc = Value
+ End Set
+ End Property
+
+ Public Property item() As TItem
+ Get
+ Return Me._item
+ End Get
+ Set
+ Me._item = Value
+ End Set
+ End Property
+
+
+ Public Property taricAddCode() As List(Of TInvoiceLineTaricAddCode)
+ Get
+ Return Me._taricAddCode
+ End Get
+ Set
+ Me._taricAddCode = Value
+ End Set
+ End Property
+
+
+ Public Property dangerousGoods() As List(Of TInvoiceLineDangerousGoods)
+ Get
+ Return Me._dangerousGoods
+ End Get
+ Set
+ Me._dangerousGoods = Value
+ End Set
+ End Property
+
+
+ Public Property documents() As List(Of TDocuments)
+ Get
+ Return Me._documents
+ End Get
+ Set
+ Me._documents = Value
+ End Set
+ End Property
+
+ Public Property delTerm() As TInvoiceLineDelTerm
+ Get
+ Return Me._delTerm
+ End Get
+ Set
+ Me._delTerm = Value
+ End Set
+ End Property
+
+ Public Property quantity() As Decimal
+ Get
+ Return Me._quantity
+ End Get
+ Set
+ Me._quantity = Value
+ End Set
+ End Property
+
+ Public Property unit() As String
+ Get
+ Return Me._unit
+ End Get
+ Set
+ Me._unit = Value
+ End Set
+ End Property
+
+ Public Property specialQuantity() As Decimal
+ Get
+ Return Me._specialQuantity
+ End Get
+ Set
+ Me._specialQuantity = Value
+ End Set
+ End Property
+
+ Public Property specialQuantityUnit() As String
+ Get
+ Return Me._specialQuantityUnit
+ End Get
+ Set
+ Me._specialQuantityUnit = Value
+ End Set
+ End Property
+
+ Public Property delnote() As TDelNote
+ Get
+ Return Me._delnote
+ End Get
+ Set
+ Me._delnote = Value
+ End Set
+ End Property
+
+ Public Property order() As TOrder
+ Get
+ Return Me._order
+ End Get
+ Set
+ Me._order = Value
+ End Set
+ End Property
+
+ Public Property itemRef() As String
+ Get
+ Return Me._itemRef
+ End Get
+ Set
+ Me._itemRef = Value
+ End Set
+ End Property
+
+
+ Public Property addCosts() As List(Of TAddCosts)
+ Get
+ Return Me._addCosts
+ End Get
+ Set
+ Me._addCosts = Value
+ End Set
+ End Property
+
+
+ Public Property addCode() As List(Of String)
+ Get
+ Return Me._addCode
+ End Get
+ Set
+ Me._addCode = Value
+ End Set
+ End Property
+
+
+ Public Property natCode() As List(Of String)
+ Get
+ Return Me._natCode
+ End Get
+ Set
+ Me._natCode = Value
+ End Set
+ End Property
+
+ Public Property stockTypeAdd() As String
+ Get
+ Return Me._stockTypeAdd
+ End Get
+ Set
+ Me._stockTypeAdd = Value
+ End Set
+ End Property
+
+ Public Property stockTypeDed() As String
+ Get
+ Return Me._stockTypeDed
+ End Get
+ Set
+ Me._stockTypeDed = Value
+ End Set
+ End Property
+
+ Public Property bom() As TBomNo
+ Get
+ Return Me._bom
+ End Get
+ Set
+ Me._bom = Value
+ End Set
+ End Property
+
+ Public Property accountNo() As String
+ Get
+ Return Me._accountNo
+ End Get
+ Set
+ Me._accountNo = Value
+ End Set
+ End Property
+
+ Public Property customerFields() As TCustomerFields
+ Get
+ Return Me._customerFields
+ End Get
+ Set
+ Me._customerFields = Value
+ End Set
+ End Property
+
+
+ Public Property attributes() As List(Of TAttribute)
+ Get
+ Return Me._attributes
+ End Get
+ Set
+ Me._attributes = Value
+ End Set
+ End Property
+
+
+ Public Property containers() As List(Of TContainer)
+ Get
+ Return Me._containers
+ End Get
+ Set
+ Me._containers = Value
+ End Set
+ End Property
+
+ Public Property shipmentIdentification() As String
+ Get
+ Return Me._shipmentIdentification
+ End Get
+ Set
+ Me._shipmentIdentification = Value
+ End Set
+ End Property
+
+ Public Property UNDG() As String
+ Get
+ Return Me._uNDG
+ End Get
+ Set
+ Me._uNDG = Value
+ End Set
+ End Property
+
+ Public Property consigneeEndUserFlag() As String
+ Get
+ Return Me._consigneeEndUserFlag
+ End Get
+ Set
+ Me._consigneeEndUserFlag = Value
+ End Set
+ End Property
+
+ Public Property endUserInEam() As TInvoiceLineEndUserInEam
+ Get
+ Return Me._endUserInEam
+ End Get
+ Set
+ Me._endUserInEam = Value
+ End Set
+ End Property
+
+ Public Property carriageCosts() As String
+ Get
+ Return Me._carriageCosts
+ End Get
+ Set
+ Me._carriageCosts = Value
+ End Set
+ End Property
+
+ Public Property shipTo() As TInvoiceLineShipTo
+ Get
+ Return Me._shipTo
+ End Get
+ Set
+ Me._shipTo = Value
+ End Set
+ End Property
+
+ Public Property endUser() As TInvoiceLineEndUser
+ Get
+ Return Me._endUser
+ End Get
+ Set
+ Me._endUser = Value
+ End Set
+ End Property
+
+
+ Public Property importReference() As List(Of TImportReference)
+ Get
+ Return Me._importReference
+ End Get
+ Set
+ Me._importReference = Value
+ End Set
+ End Property
+
+ Public Property registrationInfo() As TRegInfo
+ Get
+ Return Me._registrationInfo
+ End Get
+ Set
+ Me._registrationInfo = Value
+ End Set
+ End Property
+
+ Public Property serialNo() As String
+ Get
+ Return Me._serialNo
+ End Get
+ Set
+ Me._serialNo = Value
+ End Set
+ End Property
+
+ Public Property referenceValue() As Decimal
+ Get
+ Return Me._referenceValue
+ End Get
+ Set
+ Me._referenceValue = Value
+ End Set
+ End Property
+
+ Public Property model() As String
+ Get
+ Return Me._model
+ End Get
+ Set
+ Me._model = Value
+ End Set
+ End Property
+
+ Public Property brand() As String
+ Get
+ Return Me._brand
+ End Get
+ Set
+ Me._brand = Value
+ End Set
+ End Property
+
+ Public Property addedValue() As Decimal
+ Get
+ Return Me._addedValue
+ End Get
+ Set
+ Me._addedValue = Value
+ End Set
+ End Property
+
+ Public Property ctoId() As String
+ Get
+ Return Me._ctoId
+ End Get
+ Set
+ Me._ctoId = Value
+ End Set
+ End Property
+
+ Public Property infoText2() As String
+ Get
+ Return Me._infoText2
+ End Get
+ Set
+ Me._infoText2 = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+
+ Public Property additionalInformation() As List(Of TAttribute)
+ Get
+ Return Me._additionalInformation
+ End Get
+ Set
+ Me._additionalInformation = Value
+ End Set
+ End Property
+
+ Public Property trackingNumber() As String
+ Get
+ Return Me._trackingNumber
+ End Get
+ Set
+ Me._trackingNumber = Value
+ End Set
+ End Property
+
+ Public Property erpData() As TErpLineData
+ Get
+ Return Me._erpData
+ End Get
+ Set
+ Me._erpData = Value
+ End Set
+ End Property
+
+ Public Property outwardProcessing() As TInvoiceLineOutwardProcessing
+ Get
+ Return Me._outwardProcessing
+ End Get
+ Set
+ Me._outwardProcessing = Value
+ End Set
+ End Property
+
+
+ Public Property partners() As List(Of TPartner)
+ Get
+ Return Me._partners
+ End Get
+ Set
+ Me._partners = Value
+ End Set
+ End Property
+
+
+ Public Property authorisations() As List(Of TAuthorisation)
+ Get
+ Return Me._authorisations
+ End Get
+ Set
+ Me._authorisations = Value
+ End Set
+ End Property
+
+ Public Property eudr() As TInvoiceLineEudr
+ Get
+ Return Me._eudr
+ End Get
+ Set
+ Me._eudr = Value
+ End Set
+ End Property
+
+ Public Property Duties() As TMicDuties
+ Get
+ Return Me._duties
+ End Get
+ Set
+ Me._duties = Value
+ End Set
+ End Property
+
+ Public Property DutyTaxes() As TMicDutyTaxes
+ Get
+ Return Me._dutyTaxes
+ End Get
+ Set
+ Me._dutyTaxes = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLine))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLine 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()
+ 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 TInvoiceLine object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLine 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 TInvoiceLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLine)
+ 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 TInvoiceLine) 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 TInvoiceLine
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLine)
+ 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 TInvoiceLine
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLine)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLine 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 TInvoiceLine object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLine 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 TInvoiceLine, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLine)
+ 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 TInvoiceLine) 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 TInvoiceLine
+ 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 TInvoiceLineTaricAddCode
+
+#Region "Private fields"
+ Private _additionalCode As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property additionalCode() As String
+ Get
+ Return Me._additionalCode
+ End Get
+ Set
+ Me._additionalCode = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineTaricAddCode))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineTaricAddCode 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()
+ 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 TInvoiceLineTaricAddCode object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode) 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 TInvoiceLineTaricAddCode
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineTaricAddCode)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineTaricAddCode 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 TInvoiceLineTaricAddCode, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineTaricAddCode)
+ 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 TInvoiceLineTaricAddCode) 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 TInvoiceLineTaricAddCode
+ 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 TInvoiceLineDangerousGoods
+
+#Region "Private fields"
+ Private _unNumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property unNumber() As String
+ Get
+ Return Me._unNumber
+ End Get
+ Set
+ Me._unNumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineDangerousGoods))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineDangerousGoods 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()
+ 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 TInvoiceLineDangerousGoods object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods) 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 TInvoiceLineDangerousGoods
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineDangerousGoods)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineDangerousGoods 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 TInvoiceLineDangerousGoods, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDangerousGoods)
+ 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 TInvoiceLineDangerousGoods) 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 TInvoiceLineDangerousGoods
+ 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 TDocuments
+
+#Region "Private fields"
+ Private _docNo As String
+
+ Private _docDate As Date
+
+ Private _docType As String
+
+ Private _docQual As String
+
+ Private _docValidFrom As Date
+
+ Private _docValidTo As Date
+
+ Private _docAddText As String
+
+ Private _docQuantity As Decimal
+
+ Private _docUnit As String
+
+ Private _docDetail As String
+
+ Private _docValue As Decimal
+
+ Private _docUnitQual As String
+
+ Private _docStatUnit As String
+
+ Private _docDepreciateQuantity As Decimal
+
+ Private _docSupplier As String
+
+ Private _docSupplierName As String
+
+ Private _docCategory As String
+
+ Private _docCurrency As String
+
+ Private _docLineItemNo As Integer
+
+ Private _docQuantityMax As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property docNo() As String
+ Get
+ Return Me._docNo
+ End Get
+ Set
+ Me._docNo = Value
+ End Set
+ End Property
+
+
+ Public Property docDate() As Date
+ Get
+ Return Me._docDate
+ End Get
+ Set
+ Me._docDate = Value
+ End Set
+ End Property
+
+ Public Property docType() As String
+ Get
+ Return Me._docType
+ End Get
+ Set
+ Me._docType = Value
+ End Set
+ End Property
+
+ Public Property docQual() As String
+ Get
+ Return Me._docQual
+ End Get
+ Set
+ Me._docQual = Value
+ End Set
+ End Property
+
+
+ Public Property docValidFrom() As Date
+ Get
+ Return Me._docValidFrom
+ End Get
+ Set
+ Me._docValidFrom = Value
+ End Set
+ End Property
+
+
+ Public Property docValidTo() As Date
+ Get
+ Return Me._docValidTo
+ End Get
+ Set
+ Me._docValidTo = Value
+ End Set
+ End Property
+
+ Public Property docAddText() As String
+ Get
+ Return Me._docAddText
+ End Get
+ Set
+ Me._docAddText = Value
+ End Set
+ End Property
+
+ Public Property docQuantity() As Decimal
+ Get
+ Return Me._docQuantity
+ End Get
+ Set
+ Me._docQuantity = Value
+ End Set
+ End Property
+
+ Public Property docUnit() As String
+ Get
+ Return Me._docUnit
+ End Get
+ Set
+ Me._docUnit = Value
+ End Set
+ End Property
+
+ Public Property docDetail() As String
+ Get
+ Return Me._docDetail
+ End Get
+ Set
+ Me._docDetail = Value
+ End Set
+ End Property
+
+ Public Property docValue() As Decimal
+ Get
+ Return Me._docValue
+ End Get
+ Set
+ Me._docValue = Value
+ End Set
+ End Property
+
+ Public Property docUnitQual() As String
+ Get
+ Return Me._docUnitQual
+ End Get
+ Set
+ Me._docUnitQual = Value
+ End Set
+ End Property
+
+ Public Property docStatUnit() As String
+ Get
+ Return Me._docStatUnit
+ End Get
+ Set
+ Me._docStatUnit = Value
+ End Set
+ End Property
+
+ Public Property docDepreciateQuantity() As Decimal
+ Get
+ Return Me._docDepreciateQuantity
+ End Get
+ Set
+ Me._docDepreciateQuantity = Value
+ End Set
+ End Property
+
+ Public Property docSupplier() As String
+ Get
+ Return Me._docSupplier
+ End Get
+ Set
+ Me._docSupplier = Value
+ End Set
+ End Property
+
+ Public Property docSupplierName() As String
+ Get
+ Return Me._docSupplierName
+ End Get
+ Set
+ Me._docSupplierName = Value
+ End Set
+ End Property
+
+ Public Property docCategory() As String
+ Get
+ Return Me._docCategory
+ End Get
+ Set
+ Me._docCategory = Value
+ End Set
+ End Property
+
+ Public Property docCurrency() As String
+ Get
+ Return Me._docCurrency
+ End Get
+ Set
+ Me._docCurrency = Value
+ End Set
+ End Property
+
+ Public Property docLineItemNo() As Integer
+ Get
+ Return Me._docLineItemNo
+ End Get
+ Set
+ Me._docLineItemNo = Value
+ End Set
+ End Property
+
+ Public Property docQuantityMax() As Decimal
+ Get
+ Return Me._docQuantityMax
+ End Get
+ Set
+ Me._docQuantityMax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TDocuments))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TDocuments 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()
+ 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 TDocuments object
+ '''
+ ''' string to deserialize
+ ''' Output TDocuments 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 TDocuments, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDocuments)
+ 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 TDocuments) 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 TDocuments
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TDocuments)
+ 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 TDocuments
+ Return CType(SerializerXml.Deserialize(s), TDocuments)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TDocuments 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 TDocuments object
+ '''
+ ''' File to load and deserialize
+ ''' Output TDocuments 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 TDocuments, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TDocuments)
+ 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 TDocuments) 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 TDocuments
+ 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 TInvoiceLineDelTerm
+
+#Region "Private fields"
+ Private _code As String
+
+ Private _desc 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 desc() As String
+ Get
+ Return Me._desc
+ End Get
+ Set
+ Me._desc = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineDelTerm))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineDelTerm 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()
+ 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 TInvoiceLineDelTerm object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineDelTerm 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 TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm) 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 TInvoiceLineDelTerm
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineDelTerm)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineDelTerm 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 TInvoiceLineDelTerm object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineDelTerm 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 TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineDelTerm)
+ 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 TInvoiceLineDelTerm) 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 TInvoiceLineDelTerm
+ 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 TAddCosts
+
+#Region "Private fields"
+ Private _type As String
+
+ Private _flag As TAddCostsFlag
+
+ Private _amount As Decimal
+
+ Private _curr As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property type() As String
+ Get
+ Return Me._type
+ End Get
+ Set
+ Me._type = Value
+ End Set
+ End Property
+
+ Public Property flag() As TAddCostsFlag
+ Get
+ Return Me._flag
+ End Get
+ Set
+ Me._flag = Value
+ End Set
+ End Property
+
+ Public Property amount() As Decimal
+ Get
+ Return Me._amount
+ End Get
+ Set
+ Me._amount = Value
+ End Set
+ End Property
+
+ Public Property curr() As String
+ Get
+ Return Me._curr
+ End Get
+ Set
+ Me._curr = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAddCosts))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAddCosts 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()
+ 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 TAddCosts object
+ '''
+ ''' string to deserialize
+ ''' Output TAddCosts 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 TAddCosts, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddCosts)
+ 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 TAddCosts) 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 TAddCosts
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAddCosts)
+ 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 TAddCosts
+ Return CType(SerializerXml.Deserialize(s), TAddCosts)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAddCosts 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 TAddCosts object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAddCosts 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 TAddCosts, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAddCosts)
+ 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 TAddCosts) 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 TAddCosts
+ 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 TAddCostsFlag
+
+ P
+
+ V
+ End Enum
+
+
+ Partial Public Class TCustomerFields
+
+#Region "Private fields"
+ Private _texts As List(Of TCustomerText)
+
+ Private _dates As List(Of TCustomerDate)
+
+ Private _flags As List(Of TCustomerFlag)
+
+ Private _numbers As List(Of TCustomerNumber)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._numbers = New List(Of TCustomerNumber)()
+ Me._flags = New List(Of TCustomerFlag)()
+ Me._dates = New List(Of TCustomerDate)()
+ Me._texts = New List(Of TCustomerText)()
+ End Sub
+
+
+ Public Property texts() As List(Of TCustomerText)
+ Get
+ Return Me._texts
+ End Get
+ Set
+ Me._texts = Value
+ End Set
+ End Property
+
+
+ Public Property dates() As List(Of TCustomerDate)
+ Get
+ Return Me._dates
+ End Get
+ Set
+ Me._dates = Value
+ End Set
+ End Property
+
+
+ Public Property flags() As List(Of TCustomerFlag)
+ Get
+ Return Me._flags
+ End Get
+ Set
+ Me._flags = Value
+ End Set
+ End Property
+
+
+ Public Property numbers() As List(Of TCustomerNumber)
+ Get
+ Return Me._numbers
+ End Get
+ Set
+ Me._numbers = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TCustomerFields))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerFields 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()
+ 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 TCustomerFields object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerFields 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 TCustomerFields, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFields)
+ 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 TCustomerFields) 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 TCustomerFields
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerFields)
+ 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 TCustomerFields
+ Return CType(SerializerXml.Deserialize(s), TCustomerFields)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerFields 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 TCustomerFields object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerFields 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 TCustomerFields, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFields)
+ 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 TCustomerFields) 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 TCustomerFields
+ 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 TCustomerText
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = 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(TCustomerText))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerText 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()
+ 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 TCustomerText object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerText 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 TCustomerText, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerText)
+ 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 TCustomerText) 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 TCustomerText
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerText)
+ 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 TCustomerText
+ Return CType(SerializerXml.Deserialize(s), TCustomerText)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerText 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 TCustomerText object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerText 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 TCustomerText, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerText)
+ 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 TCustomerText) 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 TCustomerText
+ 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 TCustomerDate
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Date
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Date
+ 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(TCustomerDate))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerDate 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()
+ 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 TCustomerDate object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerDate 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 TCustomerDate, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerDate)
+ 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 TCustomerDate) 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 TCustomerDate
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerDate)
+ 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 TCustomerDate
+ Return CType(SerializerXml.Deserialize(s), TCustomerDate)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerDate 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 TCustomerDate object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerDate 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 TCustomerDate, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerDate)
+ 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 TCustomerDate) 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 TCustomerDate
+ 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 TCustomerFlag
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Boolean
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Boolean
+ 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(TCustomerFlag))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerFlag 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()
+ 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 TCustomerFlag object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerFlag 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 TCustomerFlag, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFlag)
+ 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 TCustomerFlag) 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 TCustomerFlag
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerFlag)
+ 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 TCustomerFlag
+ Return CType(SerializerXml.Deserialize(s), TCustomerFlag)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerFlag 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 TCustomerFlag object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerFlag 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 TCustomerFlag, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerFlag)
+ 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 TCustomerFlag) 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 TCustomerFlag
+ 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 TCustomerNumber
+
+#Region "Private fields"
+ Private _key As Integer
+
+ Private _value As Decimal
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property key() As Integer
+ Get
+ Return Me._key
+ End Get
+ Set
+ Me._key = Value
+ End Set
+ End Property
+
+ Public Property value() As Decimal
+ 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(TCustomerNumber))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TCustomerNumber 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()
+ 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 TCustomerNumber object
+ '''
+ ''' string to deserialize
+ ''' Output TCustomerNumber 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 TCustomerNumber, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerNumber)
+ 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 TCustomerNumber) 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 TCustomerNumber
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TCustomerNumber)
+ 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 TCustomerNumber
+ Return CType(SerializerXml.Deserialize(s), TCustomerNumber)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TCustomerNumber 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 TCustomerNumber object
+ '''
+ ''' File to load and deserialize
+ ''' Output TCustomerNumber 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 TCustomerNumber, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TCustomerNumber)
+ 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 TCustomerNumber) 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 TCustomerNumber
+ 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 TAttribute
+
+#Region "Private fields"
+ Private _attribType As String
+
+ Private _attribText As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property attribType() As String
+ Get
+ Return Me._attribType
+ End Get
+ Set
+ Me._attribType = Value
+ End Set
+ End Property
+
+ Public Property attribText() As String
+ Get
+ Return Me._attribText
+ End Get
+ Set
+ Me._attribText = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TAttribute))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TAttribute 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()
+ 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 TAttribute object
+ '''
+ ''' string to deserialize
+ ''' Output TAttribute 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 TAttribute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAttribute)
+ 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 TAttribute) 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 TAttribute
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TAttribute)
+ 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 TAttribute
+ Return CType(SerializerXml.Deserialize(s), TAttribute)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TAttribute 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 TAttribute object
+ '''
+ ''' File to load and deserialize
+ ''' Output TAttribute 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 TAttribute, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TAttribute)
+ 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 TAttribute) 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 TAttribute
+ 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 TContainer
+
+#Region "Private fields"
+ Private _contNo As String
+
+ Private _contType As String
+
+ Private _sealNumber As String
+
+ Private _goodsReference As List(Of TContainerGoodsReference)
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._goodsReference = New List(Of TContainerGoodsReference)()
+ End Sub
+
+ Public Property contNo() As String
+ Get
+ Return Me._contNo
+ End Get
+ Set
+ Me._contNo = Value
+ End Set
+ End Property
+
+ Public Property contType() As String
+ Get
+ Return Me._contType
+ End Get
+ Set
+ Me._contType = Value
+ End Set
+ End Property
+
+ Public Property sealNumber() As String
+ Get
+ Return Me._sealNumber
+ End Get
+ Set
+ Me._sealNumber = Value
+ End Set
+ End Property
+
+
+ Public Property goodsReference() As List(Of TContainerGoodsReference)
+ Get
+ Return Me._goodsReference
+ End Get
+ Set
+ Me._goodsReference = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContainer))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContainer 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()
+ 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 TContainer object
+ '''
+ ''' string to deserialize
+ ''' Output TContainer 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 TContainer, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainer)
+ 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 TContainer) 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 TContainer
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContainer)
+ 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 TContainer
+ Return CType(SerializerXml.Deserialize(s), TContainer)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContainer 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 TContainer object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContainer 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 TContainer, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainer)
+ 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 TContainer) 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 TContainer
+ 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 TContainerGoodsReference
+
+#Region "Private fields"
+ Private _itemNumber As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+
+ Public Property itemNumber() As String
+ Get
+ Return Me._itemNumber
+ End Get
+ Set
+ Me._itemNumber = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContainerGoodsReference))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContainerGoodsReference 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()
+ 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 TContainerGoodsReference object
+ '''
+ ''' string to deserialize
+ ''' Output TContainerGoodsReference 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 TContainerGoodsReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainerGoodsReference)
+ 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 TContainerGoodsReference) 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 TContainerGoodsReference
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContainerGoodsReference)
+ 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 TContainerGoodsReference
+ Return CType(SerializerXml.Deserialize(s), TContainerGoodsReference)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContainerGoodsReference 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 TContainerGoodsReference object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContainerGoodsReference 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 TContainerGoodsReference, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContainerGoodsReference)
+ 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 TContainerGoodsReference) 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 TContainerGoodsReference
+ 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 TInvoiceLineEndUserInEam
+
+
+ Item
+
+
+ Item0
+
+
+ Item1
+ End Enum
+
+
+ Partial Public Class TInvoiceLineShipTo
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrState As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private _addrKvb As String
+
+ Private _contactPerson As TContactPerson
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._contactPerson = New TContactPerson()
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrState() As String
+ Get
+ Return Me._addrState
+ End Get
+ Set
+ Me._addrState = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Public Property addrKvb() As String
+ Get
+ Return Me._addrKvb
+ End Get
+ Set
+ Me._addrKvb = Value
+ End Set
+ End Property
+
+ Public Property contactPerson() As TContactPerson
+ Get
+ Return Me._contactPerson
+ End Get
+ Set
+ Me._contactPerson = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineShipTo))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TInvoiceLineShipTo 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()
+ 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 TInvoiceLineShipTo object
+ '''
+ ''' string to deserialize
+ ''' Output TInvoiceLineShipTo 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 TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo) 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 TInvoiceLineShipTo
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo
+ Return CType(SerializerXml.Deserialize(s), TInvoiceLineShipTo)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TInvoiceLineShipTo 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 TInvoiceLineShipTo object
+ '''
+ ''' File to load and deserialize
+ ''' Output TInvoiceLineShipTo 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 TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TInvoiceLineShipTo)
+ 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 TInvoiceLineShipTo) 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 TInvoiceLineShipTo
+ 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 TContactPerson
+
+#Region "Private fields"
+ Private _job As String
+
+ Private _name As String
+
+ Private _email As String
+
+ Private _phone As String
+
+ Private _fax As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Property job() As String
+ Get
+ Return Me._job
+ End Get
+ Set
+ Me._job = Value
+ End Set
+ End Property
+
+ Public Property name() As String
+ Get
+ Return Me._name
+ End Get
+ Set
+ Me._name = Value
+ End Set
+ End Property
+
+ Public Property email() As String
+ Get
+ Return Me._email
+ End Get
+ Set
+ Me._email = Value
+ End Set
+ End Property
+
+ Public Property phone() As String
+ Get
+ Return Me._phone
+ End Get
+ Set
+ Me._phone = Value
+ End Set
+ End Property
+
+ Public Property fax() As String
+ Get
+ Return Me._fax
+ End Get
+ Set
+ Me._fax = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TContactPerson))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''
+ ''' Serialize TContactPerson 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()
+ 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 TContactPerson object
+ '''
+ ''' string to deserialize
+ ''' Output TContactPerson 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 TContactPerson, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContactPerson)
+ 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 TContactPerson) 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 TContactPerson
+ Dim stringReader As StringReader = Nothing
+ Try
+ stringReader = New StringReader(input)
+ Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TContactPerson)
+ 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 TContactPerson
+ Return CType(SerializerXml.Deserialize(s), TContactPerson)
+ End Function
+#End Region
+
+ '''
+ ''' Serializes current TContactPerson 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 TContactPerson object
+ '''
+ ''' File to load and deserialize
+ ''' Output TContactPerson 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 TContactPerson, ByRef exception As System.Exception) As Boolean
+ exception = Nothing
+ obj = CType(Nothing, TContactPerson)
+ 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 TContactPerson) 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 TContactPerson
+ 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 TInvoiceLineEndUser
+
+#Region "Private fields"
+ Private _addrNo As String
+
+ Private _addrName As List(Of String)
+
+ Private _addrStreet As String
+
+ Private _addrLoc As String
+
+ Private _addrCtry As String
+
+ Private _addrZip As String
+
+ Private _addrTin As String
+
+ Private _addrEori As String
+
+ Private _addrNatT As String
+
+ Private _branchNo As String
+
+ Private Shared _serializerXml As XmlSerializer
+#End Region
+
+ Public Sub New()
+ MyBase.New
+ Me._addrName = New List(Of String)()
+ End Sub
+
+ Public Property addrNo() As String
+ Get
+ Return Me._addrNo
+ End Get
+ Set
+ Me._addrNo = Value
+ End Set
+ End Property
+
+
+ Public Property addrName() As List(Of String)
+ Get
+ Return Me._addrName
+ End Get
+ Set
+ Me._addrName = Value
+ End Set
+ End Property
+
+ Public Property addrStreet() As String
+ Get
+ Return Me._addrStreet
+ End Get
+ Set
+ Me._addrStreet = Value
+ End Set
+ End Property
+
+ Public Property addrLoc() As String
+ Get
+ Return Me._addrLoc
+ End Get
+ Set
+ Me._addrLoc = Value
+ End Set
+ End Property
+
+ Public Property addrCtry() As String
+ Get
+ Return Me._addrCtry
+ End Get
+ Set
+ Me._addrCtry = Value
+ End Set
+ End Property
+
+ Public Property addrZip() As String
+ Get
+ Return Me._addrZip
+ End Get
+ Set
+ Me._addrZip = Value
+ End Set
+ End Property
+
+ Public Property addrTin() As String
+ Get
+ Return Me._addrTin
+ End Get
+ Set
+ Me._addrTin = Value
+ End Set
+ End Property
+
+ Public Property addrEori() As String
+ Get
+ Return Me._addrEori
+ End Get
+ Set
+ Me._addrEori = Value
+ End Set
+ End Property
+
+ Public Property addrNatT() As String
+ Get
+ Return Me._addrNatT
+ End Get
+ Set
+ Me._addrNatT = Value
+ End Set
+ End Property
+
+ Public Property branchNo() As String
+ Get
+ Return Me._branchNo
+ End Get
+ Set
+ Me._branchNo = Value
+ End Set
+ End Property
+
+ Private Shared ReadOnly Property SerializerXml() As XmlSerializer
+ Get
+ If (_serializerXml Is Nothing) Then
+ _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineEndUser))
+ End If
+ Return _serializerXml
+ End Get
+ End Property
+
+#Region "Serialize/Deserialize"
+ '''