From 27aaa560b5eb9253e36878d80d6904b2cb248b0f Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Wed, 23 Sep 2026 08:51:40 +0200 Subject: [PATCH] MIC XSDs --- .../MicCustExportBasicTypes.Designer.vb | 22 + .../MicCustExportBasicTypes.xsd | 69 +- .../MicCustExportComponents.Designer.vb | 22 + .../MicCustExportComponents.xsd | 893 +- .../MicCustExportInvoiceTypes.Designer.vb | 22 + .../MicCustExportInvoiceTypes.xsd | 1219 +- .../MicCustExportShipment.Designer.vb | 16692 ++++++++++++ .../MicCustExportShipment.xsd | 1026 +- .../MicErrorWarningMessage.Designer.vb | 1278 + .../MIC/MIC_EXPORT/MicErrorWarningMessage.xsd | 140 + .../MicMetaSendExportShipment.Designer.vb | 19762 ++++++++++++++ .../MIC_EXPORT/MicMetaSendExportShipment.xsd | 37 + .../MIC/MIC_EXPORT/MicMetadata.Designer.vb | 2732 ++ .../MIC/MIC_EXPORT/MicMetadata.xsd | 225 + .../MIC/MIC_EXPORT/MicSendExportShipment.wsdl | 56 + .../MIC/MIC_IMPORT/MICWebService.wsdl | 131 + .../MicCustImportInvoiceComponent.Designer.vb | 18370 +++++++++++++ .../MicCustImportInvoiceComponent.xsd | 17942 +++++++++++++ .../MicCustImportMessage.Designer.vb | 22110 ++++++++++++++++ .../MicCustImportMessage.xsd} | 1056 +- .../MIC/MIC_IMPORT/MicInterface.Designer.vb | 2300 ++ .../MIC/MIC_IMPORT/MicInterface.xsd | 295 + .../MicNctsTransitDeclarationP5.Designer.vb | 10283 +++++++ .../MIC_NCTS/MicNctsTransitDeclarationP5.wsdl | 52 + .../MIC_NCTS/MicNctsTransitDeclarationP5.xsd | 5466 ++++ .../MIC/MicCustExportBasicTypes.Designer.vb | 71 - .../MIC/MicCustExportComponents.Designer.vb | 9054 ------- .../MIC/MicCustExportInvoiceTypes.Designer.vb | 8251 ------ .../MIC/MicCustExportShipment.Designer.vb | 12959 --------- .../MIC/MicCustImportInvoiceTypes.Designer.vb | 19123 ------------- .../MIC/MicCustImportInvoiceTypes.xsd | 11393 -------- .../MIC/MicCustImportShipment.Designer.vb | 17259 ------------ .../MIC/MicErrorWarningMessage.Designer.vb | 1199 - .../MIC/MicErrorWarningMessage.xsd | 138 - .../MIC/MicMetaCustExportShipment.designer.vb | 15841 ----------- .../MIC/MicMetaCustExportShipment.xsd | 32 - .../MIC/MicMetaCustImportShipment.designer.vb | 20141 -------------- .../MIC/MicMetaCustImportShipment.xsd | 32 - .../MIC/MicMetadata.Designer.vb | 2733 -- .../Schnittstellen/MIC/MicMetadata.xsd | 215 - .../Schnittstellen/MIC/cMIC.vb | 56 +- .../VERAG_PROG_ALLGEMEIN.vbproj | 47 +- 42 files changed, 121750 insertions(+), 118994 deletions(-) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportBasicTypes.Designer.vb rename VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/{ => MIC_EXPORT}/MicCustExportBasicTypes.xsd (95%) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportComponents.Designer.vb rename VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/{ => MIC_EXPORT}/MicCustExportComponents.xsd (80%) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportInvoiceTypes.Designer.vb rename VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/{ => MIC_EXPORT}/MicCustExportInvoiceTypes.xsd (77%) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicCustExportShipment.Designer.vb rename VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/{ => MIC_EXPORT}/MicCustExportShipment.xsd (69%) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicErrorWarningMessage.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicSendExportShipment.wsdl create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MICWebService.wsdl create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.Designer.vb rename VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/{MicCustImportShipment.xsd => MIC_IMPORT/MicCustImportMessage.xsd} (66%) create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.xsd create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.Designer.vb create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.wsdl create mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.xsd delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.xsd delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.xsd delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.xsd delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.xsd delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.Designer.vb delete mode 100644 VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.xsd 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" + ''' + ''' 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 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 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 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 + + + Partial Public Class TActionCode + +#Region "Private fields" + Private _code As String + + Private _parameter As List(Of TActionCodeParameter) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._parameter = New List(Of TActionCodeParameter)() + End Sub + + Public Property code() As String + Get + Return Me._code + End Get + Set + Me._code = Value + End Set + End Property + + + Public Property parameter() As List(Of TActionCodeParameter) + Get + Return Me._parameter + End Get + Set + Me._parameter = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TActionCode)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TActionCode 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 TActionCode object + ''' + ''' string to deserialize + ''' Output TActionCode 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 TActionCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCode) + 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 TActionCode) 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 TActionCode + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TActionCode) + 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 TActionCode + Return CType(SerializerXml.Deserialize(s), TActionCode) + End Function +#End Region + + ''' + ''' Serializes current TActionCode 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 TActionCode object + ''' + ''' File to load and deserialize + ''' Output TActionCode 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 TActionCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCode) + 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 TActionCode) 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 TActionCode + 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 TActionCodeParameter + +#Region "Private fields" + Private _key As String + + Private _value As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + 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(TActionCodeParameter)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TActionCodeParameter 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 TActionCodeParameter object + ''' + ''' string to deserialize + ''' Output TActionCodeParameter 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 TActionCodeParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCodeParameter) + 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 TActionCodeParameter) 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 TActionCodeParameter + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TActionCodeParameter) + 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 TActionCodeParameter + Return CType(SerializerXml.Deserialize(s), TActionCodeParameter) + End Function +#End Region + + ''' + ''' Serializes current TActionCodeParameter 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 TActionCodeParameter object + ''' + ''' File to load and deserialize + ''' Output TActionCodeParameter 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 TActionCodeParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCodeParameter) + 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 TActionCodeParameter) 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 TActionCodeParameter + 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 TMessageDetail + +#Region "Private fields" + Private _messageId As String + + Private _partyId As String + + Private _transactionId As String + + Private _sequenceNum As String + + Private _actionCode As TActionCode + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._actionCode = New TActionCode() + End Sub + + Public Property messageId() As String + Get + Return Me._messageId + End Get + Set + Me._messageId = Value + End Set + End Property + + Public Property partyId() As String + Get + Return Me._partyId + End Get + Set + Me._partyId = Value + End Set + End Property + + Public Property transactionId() As String + Get + Return Me._transactionId + End Get + Set + Me._transactionId = Value + End Set + End Property + + + Public Property sequenceNum() As String + Get + Return Me._sequenceNum + End Get + Set + Me._sequenceNum = Value + End Set + End Property + + Public Property ActionCode() As TActionCode + Get + Return Me._actionCode + End Get + Set + Me._actionCode = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMessageDetail)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMessageDetail 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 TMessageDetail object + ''' + ''' string to deserialize + ''' Output TMessageDetail 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 TMessageDetail, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMessageDetail) + 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 TMessageDetail) 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 TMessageDetail + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMessageDetail) + 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 TMessageDetail + Return CType(SerializerXml.Deserialize(s), TMessageDetail) + End Function +#End Region + + ''' + ''' Serializes current TMessageDetail 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 TMessageDetail object + ''' + ''' File to load and deserialize + ''' Output TMessageDetail 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 TMessageDetail, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMessageDetail) + 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 TMessageDetail) 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 TMessageDetail + 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 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 TStatusResponse + +#Region "Private fields" + Private _status As TStatus + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._status = New TStatus() + End Sub + + Public Property Status() As TStatus + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TStatusResponse)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TStatusResponse 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 TStatusResponse object + ''' + ''' string to deserialize + ''' Output TStatusResponse 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 TStatusResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatusResponse) + 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 TStatusResponse) 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 TStatusResponse + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TStatusResponse) + 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 TStatusResponse + Return CType(SerializerXml.Deserialize(s), TStatusResponse) + End Function +#End Region + + ''' + ''' Serializes current TStatusResponse 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 TStatusResponse object + ''' + ''' File to load and deserialize + ''' Output TStatusResponse 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 TStatusResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatusResponse) + 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 TStatusResponse) 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 TStatusResponse + 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 TStatus + +#Region "Private fields" + Private _status As TStatusStatus + + Private _item As Object + + Private _itemElementName As ItemChoiceType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property status() As TStatusStatus + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + + Public Property Item() As Object + Get + Return Me._item + End Get + Set + Me._item = Value + End Set + End Property + + + Public Property ItemElementName() As ItemChoiceType + Get + Return Me._itemElementName + End Get + Set + Me._itemElementName = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TStatus)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TStatus 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 TStatus object + ''' + ''' string to deserialize + ''' Output TStatus 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 TStatus, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatus) + 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 TStatus) 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 TStatus + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TStatus) + 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 TStatus + Return CType(SerializerXml.Deserialize(s), TStatus) + End Function +#End Region + + ''' + ''' Serializes current TStatus 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 TStatus object + ''' + ''' File to load and deserialize + ''' Output TStatus 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 TStatus, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatus) + 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 TStatus) 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 TStatus + 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 TStatusStatus + + OK + + [ERROR] + + WARNING + End Enum + + + 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 + + + Partial Public Class TMetaReference + +#Region "Private fields" + Private _correlationId As String + + Private _company As String + + Private _plant As String + + Private _referenceType As String + + Private _referenceSid As Long + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property correlationId() As String + Get + Return Me._correlationId + End Get + Set + Me._correlationId = Value + End Set + End Property + + 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 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 + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMetaReference)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMetaReference 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 TMetaReference object + ''' + ''' string to deserialize + ''' Output TMetaReference 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 TMetaReference, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMetaReference) + 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 TMetaReference) 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 TMetaReference + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMetaReference) + 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 TMetaReference + Return CType(SerializerXml.Deserialize(s), TMetaReference) + End Function +#End Region + + ''' + ''' Serializes current TMetaReference 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 TMetaReference object + ''' + ''' File to load and deserialize + ''' Output TMetaReference 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 TMetaReference, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMetaReference) + 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 TMetaReference) 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 TMetaReference + 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 ItemChoiceType + + + ErrorMessages + + + WarningMessages + + Reference + End Enum +End Namespace +#Enable Warning diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.xsd new file mode 100644 index 00000000..48454a8a --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetaSendExportShipment.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + Message to retrieve export shipment data + + + + + + + Actual Outgoing Export Message to transmit + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.Designer.vb new file mode 100644 index 00000000..55737165 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.Designer.vb @@ -0,0 +1,2732 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"MicMetadata","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 MicMetadata + + + 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 TMessageDetail + +#Region "Private fields" + Private _messageId As String + + Private _partyId As String + + Private _transactionId As String + + Private _sequenceNum As String + + Private _actionCode As TActionCode + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._actionCode = New TActionCode() + End Sub + + Public Property messageId() As String + Get + Return Me._messageId + End Get + Set + Me._messageId = Value + End Set + End Property + + Public Property partyId() As String + Get + Return Me._partyId + End Get + Set + Me._partyId = Value + End Set + End Property + + Public Property transactionId() As String + Get + Return Me._transactionId + End Get + Set + Me._transactionId = Value + End Set + End Property + + + Public Property sequenceNum() As String + Get + Return Me._sequenceNum + End Get + Set + Me._sequenceNum = Value + End Set + End Property + + Public Property ActionCode() As TActionCode + Get + Return Me._actionCode + End Get + Set + Me._actionCode = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMessageDetail)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMessageDetail 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 TMessageDetail object + ''' + ''' string to deserialize + ''' Output TMessageDetail 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 TMessageDetail, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMessageDetail) + 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 TMessageDetail) 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 TMessageDetail + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMessageDetail) + 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 TMessageDetail + Return CType(SerializerXml.Deserialize(s), TMessageDetail) + End Function +#End Region + + ''' + ''' Serializes current TMessageDetail 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 TMessageDetail object + ''' + ''' File to load and deserialize + ''' Output TMessageDetail 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 TMessageDetail, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMessageDetail) + 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 TMessageDetail) 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 TMessageDetail + 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 TActionCode + +#Region "Private fields" + Private _code As String + + Private _parameter As List(Of TActionCodeParameter) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._parameter = New List(Of TActionCodeParameter)() + End Sub + + Public Property code() As String + Get + Return Me._code + End Get + Set + Me._code = Value + End Set + End Property + + + Public Property parameter() As List(Of TActionCodeParameter) + Get + Return Me._parameter + End Get + Set + Me._parameter = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TActionCode)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TActionCode 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 TActionCode object + ''' + ''' string to deserialize + ''' Output TActionCode 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 TActionCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCode) + 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 TActionCode) 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 TActionCode + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TActionCode) + 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 TActionCode + Return CType(SerializerXml.Deserialize(s), TActionCode) + End Function +#End Region + + ''' + ''' Serializes current TActionCode 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 TActionCode object + ''' + ''' File to load and deserialize + ''' Output TActionCode 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 TActionCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCode) + 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 TActionCode) 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 TActionCode + 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 TActionCodeParameter + +#Region "Private fields" + Private _key As String + + Private _value As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + 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(TActionCodeParameter)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TActionCodeParameter 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 TActionCodeParameter object + ''' + ''' string to deserialize + ''' Output TActionCodeParameter 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 TActionCodeParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCodeParameter) + 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 TActionCodeParameter) 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 TActionCodeParameter + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TActionCodeParameter) + 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 TActionCodeParameter + Return CType(SerializerXml.Deserialize(s), TActionCodeParameter) + End Function +#End Region + + ''' + ''' Serializes current TActionCodeParameter 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 TActionCodeParameter object + ''' + ''' File to load and deserialize + ''' Output TActionCodeParameter 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 TActionCodeParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TActionCodeParameter) + 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 TActionCodeParameter) 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 TActionCodeParameter + 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 TStatus + +#Region "Private fields" + Private _status As TStatusStatus + + Private _item As Object + + Private _itemElementName As ItemChoiceType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property status() As TStatusStatus + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + + Public Property Item() As Object + Get + Return Me._item + End Get + Set + Me._item = Value + End Set + End Property + + + Public Property ItemElementName() As ItemChoiceType + Get + Return Me._itemElementName + End Get + Set + Me._itemElementName = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TStatus)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TStatus 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 TStatus object + ''' + ''' string to deserialize + ''' Output TStatus 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 TStatus, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatus) + 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 TStatus) 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 TStatus + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TStatus) + 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 TStatus + Return CType(SerializerXml.Deserialize(s), TStatus) + End Function +#End Region + + ''' + ''' Serializes current TStatus 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 TStatus object + ''' + ''' File to load and deserialize + ''' Output TStatus 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 TStatus, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TStatus) + 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 TStatus) 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 TStatus + 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 TStatusStatus + + OK + + [ERROR] + + WARNING + End Enum + + + 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 + + + Partial Public Class TMetaReference + +#Region "Private fields" + Private _correlationId As String + + Private _company As String + + Private _plant As String + + Private _referenceType As String + + Private _referenceSid As Long + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property correlationId() As String + Get + Return Me._correlationId + End Get + Set + Me._correlationId = Value + End Set + End Property + + 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 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 + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMetaReference)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMetaReference 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 TMetaReference object + ''' + ''' string to deserialize + ''' Output TMetaReference 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 TMetaReference, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMetaReference) + 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 TMetaReference) 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 TMetaReference + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMetaReference) + 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 TMetaReference + Return CType(SerializerXml.Deserialize(s), TMetaReference) + End Function +#End Region + + ''' + ''' Serializes current TMetaReference 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 TMetaReference object + ''' + ''' File to load and deserialize + ''' Output TMetaReference 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 TMetaReference, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMetaReference) + 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 TMetaReference) 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 TMetaReference + 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 ItemChoiceType + + + ErrorMessages + + + WarningMessages + + Reference + End Enum + + + Partial Public Class StatusMessage + +#Region "Private fields" + Private _metadata As TMicMetadata + + Private _messageDetail As TMessageDetail + + Private _status As TStatus + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._status = New TStatus() + 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 Status() As TStatus + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(StatusMessage)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize StatusMessage 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 StatusMessage object + ''' + ''' string to deserialize + ''' Output StatusMessage 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 StatusMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, StatusMessage) + 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 StatusMessage) 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 StatusMessage + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), StatusMessage) + 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 StatusMessage + Return CType(SerializerXml.Deserialize(s), StatusMessage) + End Function +#End Region + + ''' + ''' Serializes current StatusMessage 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 StatusMessage object + ''' + ''' File to load and deserialize + ''' Output StatusMessage 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 StatusMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, StatusMessage) + 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 StatusMessage) 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 StatusMessage + 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/MicMetadata.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.xsd new file mode 100644 index 00000000..bca004c4 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicMetadata.xsd @@ -0,0 +1,225 @@ + + + + + + + + + Details of the connection to the ERP-System + + + + + + The partner ID is a unique ID provided by the MIC-System and classify the + ERP-System of the customer. This information is given by MIC. + + + + + + Creation date/time of the message in the ERP-System + + + + + + + Action Requested for automatic processing + + + + + Action code for automatic processing + + + + + + + + + + + additional parameters + + + + + + + + + + + MIC Interface Message Envelope: description of the single message + + + + + Unique Message ID + + + + + Party ID is used as a separations of departments or single message groups + + + + + + Unique Identifier of a transaction (declaration) e.g. MRN or LRN + + + + + + Running number of the transaction Id + + + + + The ActionCode definies the autmoatic process in the MIC-Application. + + + + + + + + Status message with Metadata and MessageDetail + + + + + + + + Set of Messages + + + + + + + + Status response message used for synchronous answers + + + + + Set of Messages + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unique reference number generated in MIC + + + + + + + + + + MIC company + + + + + MIC plant + + + + + Reference type used in MIC + + + + + Reference sid used MIC + + + + + + + Envelope:Unique transaction ID used for communication with EDIS webservice + + + + + + + + + Envelope:running count + + + + + + envelope:Unique Message ID used for communication in message envelope + + + + + + + + + Envelope: communication pary + + + + + + + + + Envelope: communication partner + + + + + + + + + Connection ID of the MIC-Webservice + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicSendExportShipment.wsdl b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicSendExportShipment.wsdl new file mode 100644 index 00000000..50325158 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_EXPORT/MicSendExportShipment.wsdl @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MICWebService.wsdl b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MICWebService.wsdl new file mode 100644 index 00000000..1534b2c4 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MICWebService.wsdl @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.Designer.vb new file mode 100644 index 00000000..c9ece5c5 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.Designer.vb @@ -0,0 +1,18370 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"MicCustImportInvoiceComponent","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 MicCustImportInvoiceComponent + + _ + Partial Public Class MicCustImportInvoiceComponent + + #Region "Private fields" + Private _invoice As List(Of TMicInvoice) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._invoice = New List(Of TMicInvoice)() + End Sub + + _ + Public Property Invoice() As List(Of TMicInvoice) + Get + Return Me._invoice + End Get + Set + Me._invoice = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MicCustImportInvoiceComponent)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent object + ''' + ''' string to deserialize + ''' Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent) 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 MicCustImportInvoiceComponent + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent + Return CType(SerializerXml.Deserialize(s),MicCustImportInvoiceComponent) + End Function + #End Region + + ''' + ''' Serializes current MicCustImportInvoiceComponent 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 Overloads Overridable 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 Overloads Overridable 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 MicCustImportInvoiceComponent object + ''' + ''' File to load and deserialize + ''' Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent) 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 MicCustImportInvoiceComponent + 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 TMicInvoice + + #Region "Private fields" + Private _invoiceNumber As String + + Private _invoiceVersion As String + + Private _invoiceDate As Date + + Private _invoiceHead As TMicInvoiceHead + + Private _attributes As TMicAttributes + + Private _documents As TMicDocuments + + Private _partners As TMicPartners + + Private _atlasCompletionSumDs As TMicAtlasCompletionSumD + + Private _intra As TMicCustIntra + + Private _invoiceLines As TMicInvoiceLines + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._invoiceLines = New TMicInvoiceLines() + Me._intra = New TMicCustIntra() + Me._atlasCompletionSumDs = New TMicAtlasCompletionSumD() + Me._partners = New TMicPartners() + Me._documents = New TMicDocuments() + Me._attributes = New TMicAttributes() + Me._invoiceHead = New TMicInvoiceHead() + End Sub + + Public Property invoiceNumber() As String + Get + Return Me._invoiceNumber + End Get + Set + Me._invoiceNumber = 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 InvoiceHead() As TMicInvoiceHead + Get + Return Me._invoiceHead + End Get + Set + Me._invoiceHead = value + End Set + End Property + + Public Property Attributes() As TMicAttributes + Get + Return Me._attributes + End Get + Set + Me._attributes = value + End Set + End Property + + Public Property Documents() As TMicDocuments + Get + Return Me._documents + End Get + Set + Me._documents = value + End Set + End Property + + Public Property Partners() As TMicPartners + Get + Return Me._partners + End Get + Set + Me._partners = value + End Set + End Property + + Public Property AtlasCompletionSumDs() As TMicAtlasCompletionSumD + Get + Return Me._atlasCompletionSumDs + End Get + Set + Me._atlasCompletionSumDs = value + End Set + End Property + + Public Property Intra() As TMicCustIntra + Get + Return Me._intra + End Get + Set + Me._intra = value + End Set + End Property + + Public Property InvoiceLines() As TMicInvoiceLines + Get + Return Me._invoiceLines + End Get + Set + Me._invoiceLines = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoice)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoice 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 TMicInvoice object + ''' + ''' string to deserialize + ''' Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoice) + 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 TMicInvoice) 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 TMicInvoice + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInvoice) + 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 TMicInvoice + Return CType(SerializerXml.Deserialize(s),TMicInvoice) + End Function + #End Region + + ''' + ''' Serializes current TMicInvoice 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 Overloads Overridable 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 Overloads Overridable 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 TMicInvoice object + ''' + ''' File to load and deserialize + ''' Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoice) + 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 TMicInvoice) 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 TMicInvoice + 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 TMicInvoiceHead + + #Region "Private fields" + Private _invoiceType As String + + Private _contractDate As Date + + Private _countryOfTrade As String + + Private _supplier As TMicAddress + + Private _grossWeight As Decimal + + Private _netWeight As Decimal + + Private _invoiceValue As Decimal + + Private _invoiceCurrency As String + + Private _deliveryTerms As TMicDelTerm + + Private _rebate As TMicRebate + + Private _discount As Decimal + + Private _additionalCost As List(Of TMicAdditionalCosts) + + Private _text As String + + Private _text2 As String + + Private _freight As TMicFreightCostsInv + + Private _insurance As TMicInsuranceCostsInv + + Private _crossingBorderDate As Date + + Private _referenceNumber As String + + Private _transportNumber As String + + Private _transportType As String + + Private _acceptanceDate As Date + + Private _disposalDate As Date + + Private _timeLimit As Date + + Private _registrationNumber As String + + Private _containerNumber As String + + Private _sealNumber As String + + Private _billOfLading As String + + Private _packageCount As Decimal + + Private _packageType As String + + Private _buyer As String + + Private _consignee As String + + Private _paymentInformation As TMicImportPaymentInfo + + Private _customerFields As TMicImportCustomerFields + + Private _seller As TMicAddress + + Private _exchangeRate As Decimal + + Private _eliUnLocationCode As String + + Private _eliCountry As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _containerInfo As TMicContainer + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._containerInfo = New TMicContainer() + Me._seller = New TMicAddress() + Me._customerFields = New TMicImportCustomerFields() + Me._paymentInformation = New TMicImportPaymentInfo() + Me._insurance = New TMicInsuranceCostsInv() + Me._freight = New TMicFreightCostsInv() + Me._additionalCost = New List(Of TMicAdditionalCosts)() + Me._rebate = New TMicRebate() + Me._deliveryTerms = New TMicDelTerm() + Me._supplier = New TMicAddress() + End Sub + + Public Property invoiceType() As String + Get + Return Me._invoiceType + End Get + Set + Me._invoiceType = value + End Set + End Property + + _ + Public Property contractDate() As Date + Get + Return Me._contractDate + End Get + Set + Me._contractDate = value + End Set + End Property + + Public Property countryOfTrade() As String + Get + Return Me._countryOfTrade + End Get + Set + Me._countryOfTrade = value + End Set + End Property + + Public Property Supplier() As TMicAddress + Get + Return Me._supplier + End Get + Set + Me._supplier = value + End Set + End Property + + Public Property grossWeight() As Decimal + Get + Return Me._grossWeight + End Get + Set + Me._grossWeight = value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = value + End Set + End Property + + Public Property invoiceValue() As Decimal + Get + Return Me._invoiceValue + End Get + Set + Me._invoiceValue = value + End Set + End Property + + Public Property invoiceCurrency() As String + Get + Return Me._invoiceCurrency + End Get + Set + Me._invoiceCurrency = value + End Set + End Property + + Public Property deliveryTerms() As TMicDelTerm + Get + Return Me._deliveryTerms + End Get + Set + Me._deliveryTerms = value + End Set + End Property + + Public Property Rebate() As TMicRebate + Get + Return Me._rebate + End Get + Set + Me._rebate = value + End Set + End Property + + Public Property discount() As Decimal + Get + Return Me._discount + End Get + Set + Me._discount = value + End Set + End Property + + _ + Public Property AdditionalCost() As List(Of TMicAdditionalCosts) + Get + Return Me._additionalCost + End Get + Set + Me._additionalCost = 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 text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = value + End Set + End Property + + Public Property Freight() As TMicFreightCostsInv + Get + Return Me._freight + End Get + Set + Me._freight = value + End Set + End Property + + Public Property Insurance() As TMicInsuranceCostsInv + Get + Return Me._insurance + End Get + Set + Me._insurance = 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 referenceNumber() As String + Get + Return Me._referenceNumber + End Get + Set + Me._referenceNumber = value + End Set + End Property + + Public Property transportNumber() As String + Get + Return Me._transportNumber + End Get + Set + Me._transportNumber = 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 acceptanceDate() As Date + Get + Return Me._acceptanceDate + End Get + Set + Me._acceptanceDate = value + End Set + End Property + + _ + Public Property disposalDate() As Date + Get + Return Me._disposalDate + End Get + Set + Me._disposalDate = value + End Set + End Property + + _ + Public Property timeLimit() As Date + Get + Return Me._timeLimit + End Get + Set + Me._timeLimit = value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = value + End Set + End Property + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = 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 billOfLading() As String + Get + Return Me._billOfLading + End Get + Set + Me._billOfLading = value + End Set + End Property + + Public Property packageCount() As Decimal + Get + Return Me._packageCount + End Get + Set + Me._packageCount = value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = value + End Set + End Property + + Public Property buyer() As String + Get + Return Me._buyer + End Get + Set + Me._buyer = value + End Set + End Property + + Public Property consignee() As String + Get + Return Me._consignee + End Get + Set + Me._consignee = value + End Set + End Property + + Public Property PaymentInformation() As TMicImportPaymentInfo + Get + Return Me._paymentInformation + End Get + Set + Me._paymentInformation = value + End Set + End Property + + Public Property CustomerFields() As TMicImportCustomerFields + Get + Return Me._customerFields + End Get + Set + Me._customerFields = value + End Set + End Property + + Public Property seller() As TMicAddress + Get + Return Me._seller + End Get + Set + Me._seller = 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 eliUnLocationCode() As String + Get + Return Me._eliUnLocationCode + End Get + Set + Me._eliUnLocationCode = value + End Set + End Property + + Public Property eliCountry() As String + Get + Return Me._eliCountry + End Get + Set + Me._eliCountry = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Public Property ContainerInfo() As TMicContainer + Get + Return Me._containerInfo + End Get + Set + Me._containerInfo = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceHead)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceHead 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 TMicInvoiceHead object + ''' + ''' string to deserialize + ''' Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceHead) + 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 TMicInvoiceHead) 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 TMicInvoiceHead + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInvoiceHead) + 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 TMicInvoiceHead + Return CType(SerializerXml.Deserialize(s),TMicInvoiceHead) + End Function + #End Region + + ''' + ''' Serializes current TMicInvoiceHead 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 Overloads Overridable 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 Overloads Overridable 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 TMicInvoiceHead object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceHead) + 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 TMicInvoiceHead) 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 TMicInvoiceHead + 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 TMicAddress + + #Region "Private fields" + Private _addrNo As String + + Private _addrNoType 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 _partnerRelation As String + + Private _addrDistrict As String + + Private _addrBranchNo As String + + Private _email As String + + Private _addrVatNumber 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 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 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 partnerRelation() As String + Get + Return Me._partnerRelation + End Get + Set + Me._partnerRelation = value + End Set + End Property + + Public Property addrDistrict() As String + Get + Return Me._addrDistrict + End Get + Set + Me._addrDistrict = value + End Set + End Property + + Public Property addrBranchNo() As String + Get + Return Me._addrBranchNo + End Get + Set + Me._addrBranchNo = 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 addrVatNumber() As String + Get + Return Me._addrVatNumber + End Get + Set + Me._addrVatNumber = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAddress)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAddress 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 TMicAddress object + ''' + ''' string to deserialize + ''' Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAddress) + 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 TMicAddress) 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 TMicAddress + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAddress) + 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 TMicAddress + Return CType(SerializerXml.Deserialize(s),TMicAddress) + End Function + #End Region + + ''' + ''' Serializes current TMicAddress 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 Overloads Overridable 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 Overloads Overridable 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 TMicAddress object + ''' + ''' File to load and deserialize + ''' Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAddress) + 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 TMicAddress) 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 TMicAddress + 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 TMicAuthHolder + + #Region "Private fields" + Private _typeCode As String + + Private _identifier As String + + Private _referenceNumber As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property typeCode() As String + Get + Return Me._typeCode + End Get + Set + Me._typeCode = value + End Set + End Property + + Public Property identifier() As String + Get + Return Me._identifier + End Get + Set + Me._identifier = value + End Set + End Property + + Public Property referenceNumber() As String + Get + Return Me._referenceNumber + End Get + Set + Me._referenceNumber = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolder)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAuthHolder 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 TMicAuthHolder object + ''' + ''' string to deserialize + ''' Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolder) + 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 TMicAuthHolder) 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 TMicAuthHolder + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAuthHolder) + 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 TMicAuthHolder + Return CType(SerializerXml.Deserialize(s),TMicAuthHolder) + End Function + #End Region + + ''' + ''' Serializes current TMicAuthHolder 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 Overloads Overridable 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 Overloads Overridable 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 TMicAuthHolder object + ''' + ''' File to load and deserialize + ''' Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolder) + 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 TMicAuthHolder) 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 TMicAuthHolder + 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 TMicAuthHolders + + #Region "Private fields" + Private _authorisationHolder As List(Of TMicAuthHolder) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._authorisationHolder = New List(Of TMicAuthHolder)() + End Sub + + _ + Public Property AuthorisationHolder() As List(Of TMicAuthHolder) + Get + Return Me._authorisationHolder + End Get + Set + Me._authorisationHolder = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolders)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAuthHolders 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 TMicAuthHolders object + ''' + ''' string to deserialize + ''' Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolders) + 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 TMicAuthHolders) 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 TMicAuthHolders + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAuthHolders) + 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 TMicAuthHolders + Return CType(SerializerXml.Deserialize(s),TMicAuthHolders) + End Function + #End Region + + ''' + ''' Serializes current TMicAuthHolders 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 Overloads Overridable 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 Overloads Overridable 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 TMicAuthHolders object + ''' + ''' File to load and deserialize + ''' Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolders) + 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 TMicAuthHolders) 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 TMicAuthHolders + 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 TMicPackageData + + #Region "Private fields" + Private _signo As String + + Private _numberOfPackages As Long + + Private _packageType As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property signo() As String + Get + Return Me._signo + End Get + Set + Me._signo = 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 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(TMicPackageData)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackageData 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 TMicPackageData object + ''' + ''' string to deserialize + ''' Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackageData) + 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 TMicPackageData) 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 TMicPackageData + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPackageData) + 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 TMicPackageData + Return CType(SerializerXml.Deserialize(s),TMicPackageData) + End Function + #End Region + + ''' + ''' Serializes current TMicPackageData 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 Overloads Overridable 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 Overloads Overridable 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 TMicPackageData object + ''' + ''' File to load and deserialize + ''' Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackageData) + 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 TMicPackageData) 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 TMicPackageData + 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 TMicPackagesData + + #Region "Private fields" + Private _packageData As List(Of TMicPackageData) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._packageData = New List(Of TMicPackageData)() + End Sub + + _ + Public Property PackageData() As List(Of TMicPackageData) + Get + Return Me._packageData + End Get + Set + Me._packageData = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackagesData)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackagesData 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 TMicPackagesData object + ''' + ''' string to deserialize + ''' Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackagesData) + 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 TMicPackagesData) 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 TMicPackagesData + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPackagesData) + 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 TMicPackagesData + Return CType(SerializerXml.Deserialize(s),TMicPackagesData) + End Function + #End Region + + ''' + ''' Serializes current TMicPackagesData 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 Overloads Overridable 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 Overloads Overridable 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 TMicPackagesData object + ''' + ''' File to load and deserialize + ''' Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackagesData) + 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 TMicPackagesData) 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 TMicPackagesData + 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 TReferencePreviousProcedure + + #Region "Private fields" + Private _referenceType As String + + Private _referenceNumber As String + + Private _authorisationNumber As String + + Private _registrationNumber As String + + Private _positionNumber As Long + + Private _partNumber As String + + Private _tariffNumber As String + + Private _tradeQuantity As Decimal + + Private _tradeUnitOfMeasurement As String + + Private _tradeQualifier As String + + Private _deductionQuantity As Decimal + + Private _deductionUnitOfMeasurement As String + + Private _deductionQualifier As String + + Private _additionalInformation As String + + Private _normalTreatmentFlag As Boolean + + Private _atlasFlag As Boolean + + Private _customsNumber As String + + Private _statisticalQuantity As Decimal + + Private _netMass As Decimal + + Private _grossMass As Decimal + + Private _packageQuantity As Decimal + + Private _simpleIprApplication As Boolean + + Private _supervisingOffice As String + + Private _packageType As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property referenceType() As String + Get + Return Me._referenceType + End Get + Set + Me._referenceType = 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 authorisationNumber() As String + Get + Return Me._authorisationNumber + End Get + Set + Me._authorisationNumber = value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = value + End Set + End Property + + Public Property positionNumber() As Long + Get + Return Me._positionNumber + End Get + Set + Me._positionNumber = value + End Set + End Property + + Public Property partNumber() As String + Get + Return Me._partNumber + End Get + Set + Me._partNumber = value + End Set + End Property + + Public Property tariffNumber() As String + Get + Return Me._tariffNumber + End Get + Set + Me._tariffNumber = value + End Set + End Property + + Public Property tradeQuantity() As Decimal + Get + Return Me._tradeQuantity + End Get + Set + Me._tradeQuantity = value + End Set + End Property + + Public Property tradeUnitOfMeasurement() As String + Get + Return Me._tradeUnitOfMeasurement + End Get + Set + Me._tradeUnitOfMeasurement = value + End Set + End Property + + Public Property tradeQualifier() As String + Get + Return Me._tradeQualifier + End Get + Set + Me._tradeQualifier = value + End Set + End Property + + Public Property deductionQuantity() As Decimal + Get + Return Me._deductionQuantity + End Get + Set + Me._deductionQuantity = value + End Set + End Property + + Public Property deductionUnitOfMeasurement() As String + Get + Return Me._deductionUnitOfMeasurement + End Get + Set + Me._deductionUnitOfMeasurement = value + End Set + End Property + + Public Property deductionQualifier() As String + Get + Return Me._deductionQualifier + End Get + Set + Me._deductionQualifier = value + End Set + End Property + + Public Property additionalInformation() As String + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = value + End Set + End Property + + Public Property normalTreatmentFlag() As Boolean + Get + Return Me._normalTreatmentFlag + End Get + Set + Me._normalTreatmentFlag = value + End Set + End Property + + Public Property atlasFlag() As Boolean + Get + Return Me._atlasFlag + End Get + Set + Me._atlasFlag = value + End Set + End Property + + Public Property customsNumber() As String + Get + Return Me._customsNumber + End Get + Set + Me._customsNumber = 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 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 packageQuantity() As Decimal + Get + Return Me._packageQuantity + End Get + Set + Me._packageQuantity = value + End Set + End Property + + Public Property simpleIprApplication() As Boolean + 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 + + 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(TReferencePreviousProcedure)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TReferencePreviousProcedure 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 TReferencePreviousProcedure object + ''' + ''' string to deserialize + ''' Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedure) + 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 TReferencePreviousProcedure) 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 TReferencePreviousProcedure + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TReferencePreviousProcedure) + 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 TReferencePreviousProcedure + Return CType(SerializerXml.Deserialize(s),TReferencePreviousProcedure) + End Function + #End Region + + ''' + ''' Serializes current TReferencePreviousProcedure 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 Overloads Overridable 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 Overloads Overridable 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 TReferencePreviousProcedure object + ''' + ''' File to load and deserialize + ''' Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedure) + 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 TReferencePreviousProcedure) 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 TReferencePreviousProcedure + 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 TReferencePreviousProcedures + + #Region "Private fields" + Private _referencePreviousProcedure As List(Of TReferencePreviousProcedure) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._referencePreviousProcedure = New List(Of TReferencePreviousProcedure)() + End Sub + + _ + Public Property ReferencePreviousProcedure() As List(Of TReferencePreviousProcedure) + Get + Return Me._referencePreviousProcedure + End Get + Set + Me._referencePreviousProcedure = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TReferencePreviousProcedures)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TReferencePreviousProcedures 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 TReferencePreviousProcedures object + ''' + ''' string to deserialize + ''' Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedures) + 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 TReferencePreviousProcedures) 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 TReferencePreviousProcedures + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TReferencePreviousProcedures) + 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 TReferencePreviousProcedures + Return CType(SerializerXml.Deserialize(s),TReferencePreviousProcedures) + End Function + #End Region + + ''' + ''' Serializes current TReferencePreviousProcedures 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 Overloads Overridable 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 Overloads Overridable 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 TReferencePreviousProcedures object + ''' + ''' File to load and deserialize + ''' Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedures) + 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 TReferencePreviousProcedures) 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 TReferencePreviousProcedures + 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 TMicPreSupplier + + #Region "Private fields" + Private _infDutyValue As Decimal + + Private _infDutyRate As Decimal + + Private _infDuty As Decimal + + Private _infDutyCurrency As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property infDutyValue() As Decimal + Get + Return Me._infDutyValue + End Get + Set + Me._infDutyValue = value + End Set + End Property + + Public Property infDutyRate() As Decimal + Get + Return Me._infDutyRate + End Get + Set + Me._infDutyRate = value + End Set + End Property + + Public Property infDuty() As Decimal + Get + Return Me._infDuty + End Get + Set + Me._infDuty = value + End Set + End Property + + Public Property infDutyCurrency() As String + Get + Return Me._infDutyCurrency + End Get + Set + Me._infDutyCurrency = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreSupplier)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreSupplier 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 TMicPreSupplier object + ''' + ''' string to deserialize + ''' Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreSupplier) + 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 TMicPreSupplier) 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 TMicPreSupplier + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPreSupplier) + 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 TMicPreSupplier + Return CType(SerializerXml.Deserialize(s),TMicPreSupplier) + End Function + #End Region + + ''' + ''' Serializes current TMicPreSupplier 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 Overloads Overridable 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 Overloads Overridable 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 TMicPreSupplier object + ''' + ''' File to load and deserialize + ''' Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreSupplier) + 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 TMicPreSupplier) 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 TMicPreSupplier + 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 TMicCustIntraLine + + #Region "Private fields" + Private _status As String + + Private _invoiceDate As Date + + Private _period As Long + + Private _region As String + + Private _statisticalProcedure As String + + Private _statisticalValue As Decimal + + Private _additionalCostsCurrency1 As String + + Private _additionalCostsType1 As String + + Private _additionalCostsCurrency2 As String + + Private _additionalCostsType2 As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property status() As String + Get + Return Me._status + End Get + Set + Me._status = 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 period() As Long + Get + Return Me._period + End Get + Set + Me._period = value + End Set + End Property + + Public Property region() As String + Get + Return Me._region + End Get + Set + Me._region = value + End Set + End Property + + Public Property statisticalProcedure() As String + Get + Return Me._statisticalProcedure + End Get + Set + Me._statisticalProcedure = value + End Set + End Property + + Public Property statisticalValue() As Decimal + Get + Return Me._statisticalValue + End Get + Set + Me._statisticalValue = value + End Set + End Property + + Public Property additionalCostsCurrency1() As String + Get + Return Me._additionalCostsCurrency1 + End Get + Set + Me._additionalCostsCurrency1 = value + End Set + End Property + + Public Property additionalCostsType1() As String + Get + Return Me._additionalCostsType1 + End Get + Set + Me._additionalCostsType1 = value + End Set + End Property + + Public Property additionalCostsCurrency2() As String + Get + Return Me._additionalCostsCurrency2 + End Get + Set + Me._additionalCostsCurrency2 = value + End Set + End Property + + Public Property additionalCostsType2() As String + Get + Return Me._additionalCostsType2 + End Get + Set + Me._additionalCostsType2 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntraLine)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCustIntraLine 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 TMicCustIntraLine object + ''' + ''' string to deserialize + ''' Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntraLine) + 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 TMicCustIntraLine) 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 TMicCustIntraLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicCustIntraLine) + 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 TMicCustIntraLine + Return CType(SerializerXml.Deserialize(s),TMicCustIntraLine) + End Function + #End Region + + ''' + ''' Serializes current TMicCustIntraLine 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 Overloads Overridable 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 Overloads Overridable 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 TMicCustIntraLine object + ''' + ''' File to load and deserialize + ''' Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntraLine) + 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 TMicCustIntraLine) 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 TMicCustIntraLine + 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 TMicImportLineAdditionalParams + + #Region "Private fields" + Private _cancel As String + + Private _codeNumber As String + + Private _countryGroup As String + + Private _condition1 As String + + Private _condition2 As String + + Private _vehicleTobaccoCode As String + + Private _specialProvision As String + + Private _relecantTime As Date + + Private _relecantTimePreference As Date + + Private _countryOfExportation As String + + Private _originCountry As String + + Private _purchaseCountry As String + + Private _defaultPrefDocType As String + + Private _defaultPrefDocSubType As String + + Private _temporarity As String + + Private _standardTreatment As String + + Private _quota1 As String + + Private _quotaNumber1 As String + + Private _quotaNumber2 As String + + Private _quota3 As String + + Private _quotaNumber3 As String + + Private _quotaAdditionalCodeFlag1 As String + + Private _quotaAdditionalCode1 As String + + Private _quotaAdditionalCodeFlag2 As String + + Private _quotaAdditionalCode2 As String + + Private _quotaAdditionalCodeFlag3 As String + + Private _quotaAdditionalCode3 As String + + Private _procedureCode As String + + Private _customsCalculationCode As String + + Private _customsCalculationZ As String + + Private _customsQuantity As Decimal + + Private _unitCustomsQuantity As String + + Private _customsValue As Decimal + + Private _levyUnit As Decimal + + Private _levyUnitUom As String + + Private _specialUnit As Decimal + + Private _specialUnitUom As String + + Private _specialValue As Decimal + + Private _salaryType1 As String + + Private _salaryShare1 As Decimal + + Private _salaryType2 As String + + Private _salaryShare2 As Decimal + + Private _salaryType3 As String + + Private _salaryShare3 As Decimal + + Private _salaryType4 As String + + Private _salaryShare4 As Decimal + + Private _salaryType5 As String + + Private _salaryShare5 As Decimal + + Private _salaryType6 As String + + Private _salaryShare6 As Decimal + + Private _exciseTax1 As String + + Private _exciseTaxQuantity1 As Decimal + + Private _exciseTaxUom1 As String + + Private _exciseTaxValue1 As Decimal + + Private _exciseTaxShare1 As Decimal + + Private _exciseTax2 As String + + Private _exciseTaxQuantity2 As Decimal + + Private _exciseTaxUom2 As String + + Private _exciseTaxValue2 As Decimal + + Private _exciseTaxShare2 As Decimal + + Private _exciseTax3 As String + + Private _exciseTaxQuantity3 As Decimal + + Private _exciseTaxUom3 As String + + Private _exciseTaxValue3 As Decimal + + Private _exciseTaxShare3 As Decimal + + Private _exciseTax4 As String + + Private _exciseTaxQuantity4 As Decimal + + Private _exciseTaxUom4 As String + + Private _exciseTaxValue4 As Decimal + + Private _exciseTaxShare4 As Decimal + + Private _exciseTax5 As String + + Private _exciseTaxQuantity5 As Decimal + + Private _exciseTaxUom5 As String + + Private _exciseTaxValue5 As Decimal + + Private _exciseTaxShare5 As Decimal + + Private _exciseTax6 As String + + Private _exciseTaxQuantity6 As Decimal + + Private _exciseTaxUom6 As String + + Private _exciseTaxValue6 As Decimal + + Private _exciseTaxShare6 As Decimal + + Private _specialCaseGroup1 As String + + Private _specialCaseType1 As String + + Private _specialCaseRate1 As Decimal + + Private _specialCaseGroup2 As String + + Private _specialCaseType2 As String + + Private _specialCaseRate2 As Decimal + + Private _specialCaseGroup3 As String + + Private _specialCaseType3 As String + + Private _specialCaseRate3 As Decimal + + Private _ivatCosts As Decimal + + Private _efagen As String + + Private _certificates As String + + Private _standards As String + + Private _importControl As String + + Private _insurance As String + + Private _establishment As String + + Private _procedure As String + + Private _licenseType As String + + Private _licenseNumber As String + + Private _exciseTaxQualificator1 As String + + Private _exciseTaxQualificator2 As String + + Private _exciseTaxQualificator3 As String + + Private _exciseTaxQualificator4 As String + + Private _exciseTaxQualificator5 As String + + Private _exciseTaxQualificator6 As String + + Private _quota As Decimal + + Private _quotaUom As String + + Private _quotaQualificator As String + + Private _location As String + + Private _taxCode1 As Long + + Private _taxCode2 As Long + + Private _taxCode3 As Long + + Private _taxCode4 As Long + + Private _taxCode5 As Long + + Private _taxCode6 As Long + + Private _tobaccoFlagNumber As String + + Private _subjectArea As String + + Private _completeInfoFlag As String + + Private _statisticStatus As String + + Private _chargeType As String + + Private _indirectPayment As Long + + Private _indirectPaymentCurrency As String + + Private _indirectPaymentFlag As String + + Private _indirectPaymentRate As Long + + Private _messageFlag22 As String + + Private _messageFlag55 As String + + Private _messageFlag77 As String + + Private _messageFlag90 As String + + Private _tariffNumber As String + + Private _shippingCountry As String + + Private _countryOfOrigin As String + + Private _netWeight As Decimal + + Private _partPrice As Long + + Private _prefRequestCode As String + + Private _positionNumber As Long + + Private _additionalCostsIVAT As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property cancel() As String + Get + Return Me._cancel + End Get + Set + Me._cancel = value + End Set + End Property + + Public Property codeNumber() As String + Get + Return Me._codeNumber + End Get + Set + Me._codeNumber = value + End Set + End Property + + Public Property countryGroup() As String + Get + Return Me._countryGroup + End Get + Set + Me._countryGroup = value + End Set + End Property + + Public Property condition1() As String + Get + Return Me._condition1 + End Get + Set + Me._condition1 = value + End Set + End Property + + Public Property condition2() As String + Get + Return Me._condition2 + End Get + Set + Me._condition2 = value + End Set + End Property + + Public Property vehicleTobaccoCode() As String + Get + Return Me._vehicleTobaccoCode + End Get + Set + Me._vehicleTobaccoCode = value + End Set + End Property + + Public Property specialProvision() As String + Get + Return Me._specialProvision + End Get + Set + Me._specialProvision = value + End Set + End Property + + _ + Public Property relecantTime() As Date + Get + Return Me._relecantTime + End Get + Set + Me._relecantTime = value + End Set + End Property + + _ + Public Property relecantTimePreference() As Date + Get + Return Me._relecantTimePreference + End Get + Set + Me._relecantTimePreference = value + End Set + End Property + + Public Property countryOfExportation() As String + Get + Return Me._countryOfExportation + End Get + Set + Me._countryOfExportation = value + End Set + End Property + + Public Property originCountry() As String + Get + Return Me._originCountry + End Get + Set + Me._originCountry = value + End Set + End Property + + Public Property purchaseCountry() As String + Get + Return Me._purchaseCountry + End Get + Set + Me._purchaseCountry = value + End Set + End Property + + Public Property defaultPrefDocType() As String + Get + Return Me._defaultPrefDocType + End Get + Set + Me._defaultPrefDocType = value + End Set + End Property + + Public Property defaultPrefDocSubType() As String + Get + Return Me._defaultPrefDocSubType + End Get + Set + Me._defaultPrefDocSubType = value + End Set + End Property + + Public Property temporarity() As String + Get + Return Me._temporarity + End Get + Set + Me._temporarity = value + End Set + End Property + + Public Property standardTreatment() As String + Get + Return Me._standardTreatment + End Get + Set + Me._standardTreatment = value + End Set + End Property + + Public Property quota1() As String + Get + Return Me._quota1 + End Get + Set + Me._quota1 = value + End Set + End Property + + Public Property quotaNumber1() As String + Get + Return Me._quotaNumber1 + End Get + Set + Me._quotaNumber1 = value + End Set + End Property + + Public Property quotaNumber2() As String + Get + Return Me._quotaNumber2 + End Get + Set + Me._quotaNumber2 = value + End Set + End Property + + Public Property quota3() As String + Get + Return Me._quota3 + End Get + Set + Me._quota3 = value + End Set + End Property + + Public Property quotaNumber3() As String + Get + Return Me._quotaNumber3 + End Get + Set + Me._quotaNumber3 = value + End Set + End Property + + Public Property quotaAdditionalCodeFlag1() As String + Get + Return Me._quotaAdditionalCodeFlag1 + End Get + Set + Me._quotaAdditionalCodeFlag1 = value + End Set + End Property + + Public Property quotaAdditionalCode1() As String + Get + Return Me._quotaAdditionalCode1 + End Get + Set + Me._quotaAdditionalCode1 = value + End Set + End Property + + Public Property quotaAdditionalCodeFlag2() As String + Get + Return Me._quotaAdditionalCodeFlag2 + End Get + Set + Me._quotaAdditionalCodeFlag2 = value + End Set + End Property + + Public Property quotaAdditionalCode2() As String + Get + Return Me._quotaAdditionalCode2 + End Get + Set + Me._quotaAdditionalCode2 = value + End Set + End Property + + Public Property quotaAdditionalCodeFlag3() As String + Get + Return Me._quotaAdditionalCodeFlag3 + End Get + Set + Me._quotaAdditionalCodeFlag3 = value + End Set + End Property + + Public Property quotaAdditionalCode3() As String + Get + Return Me._quotaAdditionalCode3 + End Get + Set + Me._quotaAdditionalCode3 = value + End Set + End Property + + Public Property procedureCode() As String + Get + Return Me._procedureCode + End Get + Set + Me._procedureCode = value + End Set + End Property + + Public Property customsCalculationCode() As String + Get + Return Me._customsCalculationCode + End Get + Set + Me._customsCalculationCode = value + End Set + End Property + + Public Property customsCalculationZ() As String + Get + Return Me._customsCalculationZ + End Get + Set + Me._customsCalculationZ = value + End Set + End Property + + Public Property customsQuantity() As Decimal + Get + Return Me._customsQuantity + End Get + Set + Me._customsQuantity = value + End Set + End Property + + Public Property unitCustomsQuantity() As String + Get + Return Me._unitCustomsQuantity + End Get + Set + Me._unitCustomsQuantity = value + End Set + End Property + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = value + End Set + End Property + + Public Property levyUnit() As Decimal + Get + Return Me._levyUnit + End Get + Set + Me._levyUnit = value + End Set + End Property + + Public Property levyUnitUom() As String + Get + Return Me._levyUnitUom + End Get + Set + Me._levyUnitUom = value + End Set + End Property + + Public Property specialUnit() As Decimal + Get + Return Me._specialUnit + End Get + Set + Me._specialUnit = value + End Set + End Property + + Public Property specialUnitUom() As String + Get + Return Me._specialUnitUom + End Get + Set + Me._specialUnitUom = value + End Set + End Property + + Public Property specialValue() As Decimal + Get + Return Me._specialValue + End Get + Set + Me._specialValue = value + End Set + End Property + + Public Property salaryType1() As String + Get + Return Me._salaryType1 + End Get + Set + Me._salaryType1 = value + End Set + End Property + + Public Property salaryShare1() As Decimal + Get + Return Me._salaryShare1 + End Get + Set + Me._salaryShare1 = value + End Set + End Property + + Public Property salaryType2() As String + Get + Return Me._salaryType2 + End Get + Set + Me._salaryType2 = value + End Set + End Property + + Public Property salaryShare2() As Decimal + Get + Return Me._salaryShare2 + End Get + Set + Me._salaryShare2 = value + End Set + End Property + + Public Property salaryType3() As String + Get + Return Me._salaryType3 + End Get + Set + Me._salaryType3 = value + End Set + End Property + + Public Property salaryShare3() As Decimal + Get + Return Me._salaryShare3 + End Get + Set + Me._salaryShare3 = value + End Set + End Property + + Public Property salaryType4() As String + Get + Return Me._salaryType4 + End Get + Set + Me._salaryType4 = value + End Set + End Property + + Public Property salaryShare4() As Decimal + Get + Return Me._salaryShare4 + End Get + Set + Me._salaryShare4 = value + End Set + End Property + + Public Property salaryType5() As String + Get + Return Me._salaryType5 + End Get + Set + Me._salaryType5 = value + End Set + End Property + + Public Property salaryShare5() As Decimal + Get + Return Me._salaryShare5 + End Get + Set + Me._salaryShare5 = value + End Set + End Property + + Public Property salaryType6() As String + Get + Return Me._salaryType6 + End Get + Set + Me._salaryType6 = value + End Set + End Property + + Public Property salaryShare6() As Decimal + Get + Return Me._salaryShare6 + End Get + Set + Me._salaryShare6 = value + End Set + End Property + + Public Property exciseTax1() As String + Get + Return Me._exciseTax1 + End Get + Set + Me._exciseTax1 = value + End Set + End Property + + Public Property exciseTaxQuantity1() As Decimal + Get + Return Me._exciseTaxQuantity1 + End Get + Set + Me._exciseTaxQuantity1 = value + End Set + End Property + + Public Property exciseTaxUom1() As String + Get + Return Me._exciseTaxUom1 + End Get + Set + Me._exciseTaxUom1 = value + End Set + End Property + + Public Property exciseTaxValue1() As Decimal + Get + Return Me._exciseTaxValue1 + End Get + Set + Me._exciseTaxValue1 = value + End Set + End Property + + Public Property exciseTaxShare1() As Decimal + Get + Return Me._exciseTaxShare1 + End Get + Set + Me._exciseTaxShare1 = value + End Set + End Property + + Public Property exciseTax2() As String + Get + Return Me._exciseTax2 + End Get + Set + Me._exciseTax2 = value + End Set + End Property + + Public Property exciseTaxQuantity2() As Decimal + Get + Return Me._exciseTaxQuantity2 + End Get + Set + Me._exciseTaxQuantity2 = value + End Set + End Property + + Public Property exciseTaxUom2() As String + Get + Return Me._exciseTaxUom2 + End Get + Set + Me._exciseTaxUom2 = value + End Set + End Property + + Public Property exciseTaxValue2() As Decimal + Get + Return Me._exciseTaxValue2 + End Get + Set + Me._exciseTaxValue2 = value + End Set + End Property + + Public Property exciseTaxShare2() As Decimal + Get + Return Me._exciseTaxShare2 + End Get + Set + Me._exciseTaxShare2 = value + End Set + End Property + + Public Property exciseTax3() As String + Get + Return Me._exciseTax3 + End Get + Set + Me._exciseTax3 = value + End Set + End Property + + Public Property exciseTaxQuantity3() As Decimal + Get + Return Me._exciseTaxQuantity3 + End Get + Set + Me._exciseTaxQuantity3 = value + End Set + End Property + + Public Property exciseTaxUom3() As String + Get + Return Me._exciseTaxUom3 + End Get + Set + Me._exciseTaxUom3 = value + End Set + End Property + + Public Property exciseTaxValue3() As Decimal + Get + Return Me._exciseTaxValue3 + End Get + Set + Me._exciseTaxValue3 = value + End Set + End Property + + Public Property exciseTaxShare3() As Decimal + Get + Return Me._exciseTaxShare3 + End Get + Set + Me._exciseTaxShare3 = value + End Set + End Property + + Public Property exciseTax4() As String + Get + Return Me._exciseTax4 + End Get + Set + Me._exciseTax4 = value + End Set + End Property + + Public Property exciseTaxQuantity4() As Decimal + Get + Return Me._exciseTaxQuantity4 + End Get + Set + Me._exciseTaxQuantity4 = value + End Set + End Property + + Public Property exciseTaxUom4() As String + Get + Return Me._exciseTaxUom4 + End Get + Set + Me._exciseTaxUom4 = value + End Set + End Property + + Public Property exciseTaxValue4() As Decimal + Get + Return Me._exciseTaxValue4 + End Get + Set + Me._exciseTaxValue4 = value + End Set + End Property + + Public Property exciseTaxShare4() As Decimal + Get + Return Me._exciseTaxShare4 + End Get + Set + Me._exciseTaxShare4 = value + End Set + End Property + + Public Property exciseTax5() As String + Get + Return Me._exciseTax5 + End Get + Set + Me._exciseTax5 = value + End Set + End Property + + Public Property exciseTaxQuantity5() As Decimal + Get + Return Me._exciseTaxQuantity5 + End Get + Set + Me._exciseTaxQuantity5 = value + End Set + End Property + + Public Property exciseTaxUom5() As String + Get + Return Me._exciseTaxUom5 + End Get + Set + Me._exciseTaxUom5 = value + End Set + End Property + + Public Property exciseTaxValue5() As Decimal + Get + Return Me._exciseTaxValue5 + End Get + Set + Me._exciseTaxValue5 = value + End Set + End Property + + Public Property exciseTaxShare5() As Decimal + Get + Return Me._exciseTaxShare5 + End Get + Set + Me._exciseTaxShare5 = value + End Set + End Property + + Public Property exciseTax6() As String + Get + Return Me._exciseTax6 + End Get + Set + Me._exciseTax6 = value + End Set + End Property + + Public Property exciseTaxQuantity6() As Decimal + Get + Return Me._exciseTaxQuantity6 + End Get + Set + Me._exciseTaxQuantity6 = value + End Set + End Property + + Public Property exciseTaxUom6() As String + Get + Return Me._exciseTaxUom6 + End Get + Set + Me._exciseTaxUom6 = value + End Set + End Property + + Public Property exciseTaxValue6() As Decimal + Get + Return Me._exciseTaxValue6 + End Get + Set + Me._exciseTaxValue6 = value + End Set + End Property + + Public Property exciseTaxShare6() As Decimal + Get + Return Me._exciseTaxShare6 + End Get + Set + Me._exciseTaxShare6 = value + End Set + End Property + + Public Property specialCaseGroup1() As String + Get + Return Me._specialCaseGroup1 + End Get + Set + Me._specialCaseGroup1 = value + End Set + End Property + + Public Property specialCaseType1() As String + Get + Return Me._specialCaseType1 + End Get + Set + Me._specialCaseType1 = value + End Set + End Property + + Public Property specialCaseRate1() As Decimal + Get + Return Me._specialCaseRate1 + End Get + Set + Me._specialCaseRate1 = value + End Set + End Property + + Public Property specialCaseGroup2() As String + Get + Return Me._specialCaseGroup2 + End Get + Set + Me._specialCaseGroup2 = value + End Set + End Property + + Public Property specialCaseType2() As String + Get + Return Me._specialCaseType2 + End Get + Set + Me._specialCaseType2 = value + End Set + End Property + + Public Property specialCaseRate2() As Decimal + Get + Return Me._specialCaseRate2 + End Get + Set + Me._specialCaseRate2 = value + End Set + End Property + + Public Property specialCaseGroup3() As String + Get + Return Me._specialCaseGroup3 + End Get + Set + Me._specialCaseGroup3 = value + End Set + End Property + + Public Property specialCaseType3() As String + Get + Return Me._specialCaseType3 + End Get + Set + Me._specialCaseType3 = value + End Set + End Property + + Public Property specialCaseRate3() As Decimal + Get + Return Me._specialCaseRate3 + End Get + Set + Me._specialCaseRate3 = value + End Set + End Property + + Public Property ivatCosts() As Decimal + Get + Return Me._ivatCosts + End Get + Set + Me._ivatCosts = value + End Set + End Property + + Public Property efagen() As String + Get + Return Me._efagen + End Get + Set + Me._efagen = value + End Set + End Property + + Public Property certificates() As String + Get + Return Me._certificates + End Get + Set + Me._certificates = value + End Set + End Property + + Public Property standards() As String + Get + Return Me._standards + End Get + Set + Me._standards = value + End Set + End Property + + Public Property importControl() As String + Get + Return Me._importControl + End Get + Set + Me._importControl = value + End Set + End Property + + Public Property insurance() As String + Get + Return Me._insurance + End Get + Set + Me._insurance = value + End Set + End Property + + Public Property establishment() As String + Get + Return Me._establishment + End Get + Set + Me._establishment = value + End Set + End Property + + Public Property procedure() As String + Get + Return Me._procedure + End Get + Set + Me._procedure = 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 exciseTaxQualificator1() As String + Get + Return Me._exciseTaxQualificator1 + End Get + Set + Me._exciseTaxQualificator1 = value + End Set + End Property + + Public Property exciseTaxQualificator2() As String + Get + Return Me._exciseTaxQualificator2 + End Get + Set + Me._exciseTaxQualificator2 = value + End Set + End Property + + Public Property exciseTaxQualificator3() As String + Get + Return Me._exciseTaxQualificator3 + End Get + Set + Me._exciseTaxQualificator3 = value + End Set + End Property + + Public Property exciseTaxQualificator4() As String + Get + Return Me._exciseTaxQualificator4 + End Get + Set + Me._exciseTaxQualificator4 = value + End Set + End Property + + Public Property exciseTaxQualificator5() As String + Get + Return Me._exciseTaxQualificator5 + End Get + Set + Me._exciseTaxQualificator5 = value + End Set + End Property + + Public Property exciseTaxQualificator6() As String + Get + Return Me._exciseTaxQualificator6 + End Get + Set + Me._exciseTaxQualificator6 = value + End Set + End Property + + Public Property quota() As Decimal + Get + Return Me._quota + End Get + Set + Me._quota = value + End Set + End Property + + Public Property quotaUom() As String + Get + Return Me._quotaUom + End Get + Set + Me._quotaUom = value + End Set + End Property + + Public Property quotaQualificator() As String + Get + Return Me._quotaQualificator + End Get + Set + Me._quotaQualificator = value + End Set + End Property + + Public Property location() As String + Get + Return Me._location + End Get + Set + Me._location = value + End Set + End Property + + Public Property taxCode1() As Long + Get + Return Me._taxCode1 + End Get + Set + Me._taxCode1 = value + End Set + End Property + + Public Property taxCode2() As Long + Get + Return Me._taxCode2 + End Get + Set + Me._taxCode2 = value + End Set + End Property + + Public Property taxCode3() As Long + Get + Return Me._taxCode3 + End Get + Set + Me._taxCode3 = value + End Set + End Property + + Public Property taxCode4() As Long + Get + Return Me._taxCode4 + End Get + Set + Me._taxCode4 = value + End Set + End Property + + Public Property taxCode5() As Long + Get + Return Me._taxCode5 + End Get + Set + Me._taxCode5 = value + End Set + End Property + + Public Property taxCode6() As Long + Get + Return Me._taxCode6 + End Get + Set + Me._taxCode6 = value + End Set + End Property + + Public Property tobaccoFlagNumber() As String + Get + Return Me._tobaccoFlagNumber + End Get + Set + Me._tobaccoFlagNumber = value + End Set + End Property + + Public Property subjectArea() As String + Get + Return Me._subjectArea + End Get + Set + Me._subjectArea = value + End Set + End Property + + Public Property completeInfoFlag() As String + Get + Return Me._completeInfoFlag + End Get + Set + Me._completeInfoFlag = value + End Set + End Property + + Public Property statisticStatus() As String + Get + Return Me._statisticStatus + End Get + Set + Me._statisticStatus = value + End Set + End Property + + Public Property chargeType() As String + Get + Return Me._chargeType + End Get + Set + Me._chargeType = value + End Set + End Property + + Public Property indirectPayment() As Long + Get + Return Me._indirectPayment + End Get + Set + Me._indirectPayment = value + End Set + End Property + + Public Property indirectPaymentCurrency() As String + Get + Return Me._indirectPaymentCurrency + End Get + Set + Me._indirectPaymentCurrency = value + End Set + End Property + + Public Property indirectPaymentFlag() As String + Get + Return Me._indirectPaymentFlag + End Get + Set + Me._indirectPaymentFlag = value + End Set + End Property + + Public Property indirectPaymentRate() As Long + Get + Return Me._indirectPaymentRate + End Get + Set + Me._indirectPaymentRate = value + End Set + End Property + + Public Property messageFlag22() As String + Get + Return Me._messageFlag22 + End Get + Set + Me._messageFlag22 = value + End Set + End Property + + Public Property messageFlag55() As String + Get + Return Me._messageFlag55 + End Get + Set + Me._messageFlag55 = value + End Set + End Property + + Public Property messageFlag77() As String + Get + Return Me._messageFlag77 + End Get + Set + Me._messageFlag77 = value + End Set + End Property + + Public Property messageFlag90() As String + Get + Return Me._messageFlag90 + End Get + Set + Me._messageFlag90 = value + End Set + End Property + + Public Property tariffNumber() As String + Get + Return Me._tariffNumber + End Get + Set + Me._tariffNumber = value + End Set + End Property + + Public Property shippingCountry() As String + Get + Return Me._shippingCountry + End Get + Set + Me._shippingCountry = value + End Set + End Property + + Public Property countryOfOrigin() As String + Get + Return Me._countryOfOrigin + End Get + Set + Me._countryOfOrigin = value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = value + End Set + End Property + + Public Property partPrice() As Long + Get + Return Me._partPrice + End Get + Set + Me._partPrice = value + End Set + End Property + + Public Property prefRequestCode() As String + Get + Return Me._prefRequestCode + End Get + Set + Me._prefRequestCode = value + End Set + End Property + + Public Property positionNumber() As Long + Get + Return Me._positionNumber + End Get + Set + Me._positionNumber = value + End Set + End Property + + Public Property additionalCostsIVAT() As Decimal + Get + Return Me._additionalCostsIVAT + End Get + Set + Me._additionalCostsIVAT = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineAdditionalParams)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams object + ''' + ''' string to deserialize + ''' Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams) 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 TMicImportLineAdditionalParams + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams + Return CType(SerializerXml.Deserialize(s),TMicImportLineAdditionalParams) + End Function + #End Region + + ''' + ''' Serializes current TMicImportLineAdditionalParams 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 Overloads Overridable 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 Overloads Overridable 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 TMicImportLineAdditionalParams object + ''' + ''' File to load and deserialize + ''' Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams) 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 TMicImportLineAdditionalParams + 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 TMicOprInfo + + #Region "Private fields" + Private _dutyGroup1 As String + + Private _reductionAmount1 As Decimal + + Private _dutyGroup2 As String + + Private _reductionAmount2 As Decimal + + Private _dutyGroup3 As String + + Private _reductionAmount3 As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property dutyGroup1() As String + Get + Return Me._dutyGroup1 + End Get + Set + Me._dutyGroup1 = value + End Set + End Property + + Public Property reductionAmount1() As Decimal + Get + Return Me._reductionAmount1 + End Get + Set + Me._reductionAmount1 = value + End Set + End Property + + Public Property dutyGroup2() As String + Get + Return Me._dutyGroup2 + End Get + Set + Me._dutyGroup2 = value + End Set + End Property + + Public Property reductionAmount2() As Decimal + Get + Return Me._reductionAmount2 + End Get + Set + Me._reductionAmount2 = value + End Set + End Property + + Public Property dutyGroup3() As String + Get + Return Me._dutyGroup3 + End Get + Set + Me._dutyGroup3 = value + End Set + End Property + + Public Property reductionAmount3() As Decimal + Get + Return Me._reductionAmount3 + End Get + Set + Me._reductionAmount3 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicOprInfo)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicOprInfo 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 TMicOprInfo object + ''' + ''' string to deserialize + ''' Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicOprInfo) + 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 TMicOprInfo) 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 TMicOprInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicOprInfo) + 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 TMicOprInfo + Return CType(SerializerXml.Deserialize(s),TMicOprInfo) + End Function + #End Region + + ''' + ''' Serializes current TMicOprInfo 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 Overloads Overridable 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 Overloads Overridable 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 TMicOprInfo object + ''' + ''' File to load and deserialize + ''' Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicOprInfo) + 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 TMicOprInfo) 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 TMicOprInfo + 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 TMicDutySaving + + #Region "Private fields" + Private _additionalCostsType As String + + Private _code As String + + Private _calculatedCustDuties As Decimal + + Private _amount As Decimal + + Private _creationFlag As String + + Private _unitOfMeasurment As String + + Private _calculationBase As Decimal + + Private _countryOfDuties As String + + Private _calculatedDuties As Decimal + + Private _calculatedAssessmentBasis As Decimal + + Private _measuresType As String + + Private _dutyRate As Decimal + + Private _addition As Decimal + + Private _preferentialFlag As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property additionalCostsType() As String + Get + Return Me._additionalCostsType + End Get + Set + Me._additionalCostsType = 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 calculatedCustDuties() As Decimal + Get + Return Me._calculatedCustDuties + End Get + Set + Me._calculatedCustDuties = 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 creationFlag() As String + Get + Return Me._creationFlag + End Get + Set + Me._creationFlag = value + End Set + End Property + + Public Property unitOfMeasurment() As String + Get + Return Me._unitOfMeasurment + End Get + Set + Me._unitOfMeasurment = 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 countryOfDuties() As String + Get + Return Me._countryOfDuties + End Get + Set + Me._countryOfDuties = 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 calculatedAssessmentBasis() As Decimal + Get + Return Me._calculatedAssessmentBasis + End Get + Set + Me._calculatedAssessmentBasis = value + End Set + End Property + + Public Property measuresType() As String + Get + Return Me._measuresType + End Get + Set + Me._measuresType = value + End Set + End Property + + Public Property dutyRate() As Decimal + Get + Return Me._dutyRate + End Get + Set + Me._dutyRate = value + End Set + End Property + + Public Property addition() As Decimal + Get + Return Me._addition + End Get + Set + Me._addition = value + End Set + End Property + + Public Property preferentialFlag() As String + Get + Return Me._preferentialFlag + End Get + Set + Me._preferentialFlag = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySaving)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDutySaving 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 TMicDutySaving object + ''' + ''' string to deserialize + ''' Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySaving) + 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 TMicDutySaving) 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 TMicDutySaving + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDutySaving) + 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 TMicDutySaving + Return CType(SerializerXml.Deserialize(s),TMicDutySaving) + End Function + #End Region + + ''' + ''' Serializes current TMicDutySaving 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 Overloads Overridable 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 Overloads Overridable 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 TMicDutySaving object + ''' + ''' File to load and deserialize + ''' Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySaving) + 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 TMicDutySaving) 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 TMicDutySaving + 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 TMicDutySavings + + #Region "Private fields" + Private _dutySaving As List(Of TMicDutySaving) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._dutySaving = New List(Of TMicDutySaving)() + End Sub + + _ + Public Property DutySaving() As List(Of TMicDutySaving) + Get + Return Me._dutySaving + End Get + Set + Me._dutySaving = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySavings)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDutySavings 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 TMicDutySavings object + ''' + ''' string to deserialize + ''' Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySavings) + 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 TMicDutySavings) 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 TMicDutySavings + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDutySavings) + 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 TMicDutySavings + Return CType(SerializerXml.Deserialize(s),TMicDutySavings) + End Function + #End Region + + ''' + ''' Serializes current TMicDutySavings 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 Overloads Overridable 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 Overloads Overridable 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 TMicDutySavings object + ''' + ''' File to load and deserialize + ''' Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySavings) + 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 TMicDutySavings) 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 TMicDutySavings + 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 _additionalCostsType As String + + Private _code As String + + Private _calculatedCustDuties As Decimal + + Private _amount As Decimal + + Private _creationFlag As String + + Private _unitOfMeasurment As String + + Private _calculationBase As Decimal + + Private _countryOfDuties As String + + Private _calculatedDuties As Decimal + + Private _calculatedAssessmentBasis As Decimal + + Private _areaCode As String + + Private _measuresType As String + + Private _dutyCodeCustomsOffice As String + + Private _indentureNumber As String + + Private _dutyRate As Decimal + + Private _stornoFlag As String + + Private _dutyAmountIncreaseOrDecrease As Decimal + + Private _typeOfAdditionalCode As String + + Private _noOfAdditionalCode As String + + Private _calculatedDutyRate As Decimal + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property additionalCostsType() As String + Get + Return Me._additionalCostsType + End Get + Set + Me._additionalCostsType = 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 calculatedCustDuties() As Decimal + Get + Return Me._calculatedCustDuties + End Get + Set + Me._calculatedCustDuties = 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 creationFlag() As String + Get + Return Me._creationFlag + End Get + Set + Me._creationFlag = value + End Set + End Property + + Public Property unitOfMeasurment() As String + Get + Return Me._unitOfMeasurment + End Get + Set + Me._unitOfMeasurment = 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 countryOfDuties() As String + Get + Return Me._countryOfDuties + End Get + Set + Me._countryOfDuties = 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 calculatedAssessmentBasis() As Decimal + Get + Return Me._calculatedAssessmentBasis + End Get + Set + Me._calculatedAssessmentBasis = value + End Set + End Property + + Public Property areaCode() As String + Get + Return Me._areaCode + End Get + Set + Me._areaCode = value + End Set + End Property + + Public Property measuresType() As String + Get + Return Me._measuresType + End Get + Set + Me._measuresType = value + End Set + End Property + + Public Property dutyCodeCustomsOffice() As String + Get + Return Me._dutyCodeCustomsOffice + End Get + Set + Me._dutyCodeCustomsOffice = value + End Set + End Property + + Public Property indentureNumber() As String + Get + Return Me._indentureNumber + End Get + Set + Me._indentureNumber = value + End Set + End Property + + Public Property dutyRate() As Decimal + Get + Return Me._dutyRate + End Get + Set + Me._dutyRate = value + End Set + End Property + + Public Property stornoFlag() As String + Get + Return Me._stornoFlag + End Get + Set + Me._stornoFlag = value + End Set + End Property + + Public Property dutyAmountIncreaseOrDecrease() As Decimal + Get + Return Me._dutyAmountIncreaseOrDecrease + End Get + Set + Me._dutyAmountIncreaseOrDecrease = value + End Set + End Property + + Public Property typeOfAdditionalCode() As String + Get + Return Me._typeOfAdditionalCode + End Get + Set + Me._typeOfAdditionalCode = value + End Set + End Property + + Public Property noOfAdditionalCode() As String + Get + Return Me._noOfAdditionalCode + End Get + Set + Me._noOfAdditionalCode = value + End Set + End Property + + Public Property calculatedDutyRate() As Decimal + Get + Return Me._calculatedDutyRate + End Get + Set + Me._calculatedDutyRate = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = 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 Overloads Overridable 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 Overloads Overridable 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 Overloads Overridable 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 Overloads Overridable 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 _calcDutyBase As Decimal + + Private _currency As String + + Private _code As String + + Private _rate As Decimal + + Private _amount As Decimal + + Private _addDeduct As Decimal + + Private _calcDuty 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 _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + 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 calcDutyBase() As Decimal + Get + Return Me._calcDutyBase + End Get + Set + Me._calcDutyBase = 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 calcDuty() As Decimal + Get + Return Me._calcDuty + End Get + Set + Me._calcDuty = 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 + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = 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 Overloads Overridable 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 Overloads Overridable 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 Overloads Overridable 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 Overloads Overridable 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 TMicCalculatedValuesCust + + #Region "Private fields" + Private _customsValue As Decimal + + Private _netValue As Decimal + + Private _additionalStatisticalValue As Decimal + + Private _additionalCostsVat As Decimal + + Private _addStatisticValue As Decimal + + Private _freightCostsCommunity As Decimal + + Private _freightCostsInternational As Decimal + + Private _oprIngredientsValue As Decimal + + Private _additionalCosts1 As Decimal + + Private _additionalCosts2 As Decimal + + Private _additionalCosts3 As Decimal + + Private _additionalCosts4 As Decimal + + Private _additionalCosts5 As Decimal + + Private _additionalCosts6 As Decimal + + Private _additionalCosts7 As Decimal + + Private _additionalCosts8 As Decimal + + Private _additionalCosts9 As Decimal + + Private _additionalCosts10 As Decimal + + Private _additionalCosts11 As Decimal + + Private _additionalCosts12 As Decimal + + Private _additionalCosts13 As Decimal + + Private _additionalCosts14 As Decimal + + Private _additionalCosts15 As Decimal + + Private _additionalCosts16 As Decimal + + Private _additionalCosts17 As Decimal + + Private _additionalCosts18 As Decimal + + Private _additionalCosts19 As Decimal + + Private _additionalCosts20 As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = value + End Set + End Property + + Public Property netValue() As Decimal + Get + Return Me._netValue + End Get + Set + Me._netValue = value + End Set + End Property + + Public Property additionalStatisticalValue() As Decimal + Get + Return Me._additionalStatisticalValue + End Get + Set + Me._additionalStatisticalValue = value + End Set + End Property + + Public Property additionalCostsVat() As Decimal + Get + Return Me._additionalCostsVat + End Get + Set + Me._additionalCostsVat = value + End Set + End Property + + Public Property addStatisticValue() As Decimal + Get + Return Me._addStatisticValue + End Get + Set + Me._addStatisticValue = value + End Set + End Property + + Public Property freightCostsCommunity() As Decimal + Get + Return Me._freightCostsCommunity + End Get + Set + Me._freightCostsCommunity = value + End Set + End Property + + Public Property freightCostsInternational() As Decimal + Get + Return Me._freightCostsInternational + End Get + Set + Me._freightCostsInternational = value + End Set + End Property + + Public Property oprIngredientsValue() As Decimal + Get + Return Me._oprIngredientsValue + End Get + Set + Me._oprIngredientsValue = value + End Set + End Property + + Public Property additionalCosts1() As Decimal + Get + Return Me._additionalCosts1 + End Get + Set + Me._additionalCosts1 = value + End Set + End Property + + Public Property additionalCosts2() As Decimal + Get + Return Me._additionalCosts2 + End Get + Set + Me._additionalCosts2 = value + End Set + End Property + + Public Property additionalCosts3() As Decimal + Get + Return Me._additionalCosts3 + End Get + Set + Me._additionalCosts3 = value + End Set + End Property + + Public Property additionalCosts4() As Decimal + Get + Return Me._additionalCosts4 + End Get + Set + Me._additionalCosts4 = value + End Set + End Property + + Public Property additionalCosts5() As Decimal + Get + Return Me._additionalCosts5 + End Get + Set + Me._additionalCosts5 = value + End Set + End Property + + Public Property additionalCosts6() As Decimal + Get + Return Me._additionalCosts6 + End Get + Set + Me._additionalCosts6 = value + End Set + End Property + + Public Property additionalCosts7() As Decimal + Get + Return Me._additionalCosts7 + End Get + Set + Me._additionalCosts7 = value + End Set + End Property + + Public Property additionalCosts8() As Decimal + Get + Return Me._additionalCosts8 + End Get + Set + Me._additionalCosts8 = value + End Set + End Property + + Public Property additionalCosts9() As Decimal + Get + Return Me._additionalCosts9 + End Get + Set + Me._additionalCosts9 = value + End Set + End Property + + Public Property additionalCosts10() As Decimal + Get + Return Me._additionalCosts10 + End Get + Set + Me._additionalCosts10 = value + End Set + End Property + + Public Property additionalCosts11() As Decimal + Get + Return Me._additionalCosts11 + End Get + Set + Me._additionalCosts11 = value + End Set + End Property + + Public Property additionalCosts12() As Decimal + Get + Return Me._additionalCosts12 + End Get + Set + Me._additionalCosts12 = value + End Set + End Property + + Public Property additionalCosts13() As Decimal + Get + Return Me._additionalCosts13 + End Get + Set + Me._additionalCosts13 = value + End Set + End Property + + Public Property additionalCosts14() As Decimal + Get + Return Me._additionalCosts14 + End Get + Set + Me._additionalCosts14 = value + End Set + End Property + + Public Property additionalCosts15() As Decimal + Get + Return Me._additionalCosts15 + End Get + Set + Me._additionalCosts15 = value + End Set + End Property + + Public Property additionalCosts16() As Decimal + Get + Return Me._additionalCosts16 + End Get + Set + Me._additionalCosts16 = value + End Set + End Property + + Public Property additionalCosts17() As Decimal + Get + Return Me._additionalCosts17 + End Get + Set + Me._additionalCosts17 = value + End Set + End Property + + Public Property additionalCosts18() As Decimal + Get + Return Me._additionalCosts18 + End Get + Set + Me._additionalCosts18 = value + End Set + End Property + + Public Property additionalCosts19() As Decimal + Get + Return Me._additionalCosts19 + End Get + Set + Me._additionalCosts19 = value + End Set + End Property + + Public Property additionalCosts20() As Decimal + Get + Return Me._additionalCosts20 + End Get + Set + Me._additionalCosts20 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValuesCust)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCalculatedValuesCust 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 TMicCalculatedValuesCust object + ''' + ''' string to deserialize + ''' Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust) 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 TMicCalculatedValuesCust + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust + Return CType(SerializerXml.Deserialize(s),TMicCalculatedValuesCust) + End Function + #End Region + + ''' + ''' Serializes current TMicCalculatedValuesCust 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 Overloads Overridable 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 Overloads Overridable 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 TMicCalculatedValuesCust object + ''' + ''' File to load and deserialize + ''' Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust) 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 TMicCalculatedValuesCust + 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 TMicCalculatedValues + + #Region "Private fields" + Private _customsValue As Decimal + + Private _netValue As Decimal + + Private _statValue As Decimal + + Private _freightStatVal As Decimal + + Private _freightInternational As Decimal + + Private _freightEU As Decimal + + Private _freightNational As Decimal + + Private _insurance As Decimal + + Private _shipAddCosts As List(Of Decimal) + + Private _invAddCosts As List(Of Decimal) + + Private _lineAddCosts As List(Of Decimal) + + Private _custValue As Decimal + + Private _assistValue As Decimal + + Private _vatAddCosts As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._lineAddCosts = New List(Of Decimal)() + Me._invAddCosts = New List(Of Decimal)() + Me._shipAddCosts = New List(Of Decimal)() + End Sub + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = value + End Set + End Property + + Public Property netValue() As Decimal + Get + Return Me._netValue + End Get + Set + Me._netValue = value + End Set + End Property + + Public Property statValue() As Decimal + Get + Return Me._statValue + End Get + Set + Me._statValue = value + End Set + End Property + + Public Property freightStatVal() As Decimal + Get + Return Me._freightStatVal + End Get + Set + Me._freightStatVal = value + End Set + End Property + + Public Property freightInternational() As Decimal + Get + Return Me._freightInternational + End Get + Set + Me._freightInternational = value + End Set + End Property + + Public Property freightEU() As Decimal + Get + Return Me._freightEU + End Get + Set + Me._freightEU = value + End Set + End Property + + Public Property freightNational() As Decimal + Get + Return Me._freightNational + End Get + Set + Me._freightNational = value + End Set + End Property + + Public Property insurance() As Decimal + Get + Return Me._insurance + End Get + Set + Me._insurance = value + End Set + End Property + + _ + Public Property shipAddCosts() As List(Of Decimal) + Get + Return Me._shipAddCosts + End Get + Set + Me._shipAddCosts = value + End Set + End Property + + _ + Public Property invAddCosts() As List(Of Decimal) + Get + Return Me._invAddCosts + End Get + Set + Me._invAddCosts = value + End Set + End Property + + _ + Public Property lineAddCosts() As List(Of Decimal) + Get + Return Me._lineAddCosts + End Get + Set + Me._lineAddCosts = value + End Set + End Property + + Public Property custValue() As Decimal + Get + Return Me._custValue + End Get + Set + Me._custValue = value + End Set + End Property + + Public Property assistValue() As Decimal + Get + Return Me._assistValue + End Get + Set + Me._assistValue = value + End Set + End Property + + Public Property vatAddCosts() As Decimal + Get + Return Me._vatAddCosts + End Get + Set + Me._vatAddCosts = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValues)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCalculatedValues 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 TMicCalculatedValues object + ''' + ''' string to deserialize + ''' Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValues) + 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 TMicCalculatedValues) 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 TMicCalculatedValues + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicCalculatedValues) + 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 TMicCalculatedValues + Return CType(SerializerXml.Deserialize(s),TMicCalculatedValues) + End Function + #End Region + + ''' + ''' Serializes current TMicCalculatedValues 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 Overloads Overridable 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 Overloads Overridable 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 TMicCalculatedValues object + ''' + ''' File to load and deserialize + ''' Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValues) + 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 TMicCalculatedValues) 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 TMicCalculatedValues + 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 TMicDetailContainerInfo + + #Region "Private fields" + Private _containerNumber As String + + Private _containerSealNumber As String + + Private _containerPackages As Decimal + + Private _containerGrossWeight As Decimal + + Private _containerNetWeight As Decimal + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = value + End Set + End Property + + Public Property containerSealNumber() As String + Get + Return Me._containerSealNumber + End Get + Set + Me._containerSealNumber = value + End Set + End Property + + Public Property containerPackages() As Decimal + Get + Return Me._containerPackages + End Get + Set + Me._containerPackages = value + End Set + End Property + + Public Property containerGrossWeight() As Decimal + Get + Return Me._containerGrossWeight + End Get + Set + Me._containerGrossWeight = value + End Set + End Property + + Public Property containerNetWeight() As Decimal + Get + Return Me._containerNetWeight + End Get + Set + Me._containerNetWeight = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDetailContainerInfo)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDetailContainerInfo 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 TMicDetailContainerInfo object + ''' + ''' string to deserialize + ''' Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDetailContainerInfo) + 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 TMicDetailContainerInfo) 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 TMicDetailContainerInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDetailContainerInfo) + 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 TMicDetailContainerInfo + Return CType(SerializerXml.Deserialize(s),TMicDetailContainerInfo) + End Function + #End Region + + ''' + ''' Serializes current TMicDetailContainerInfo 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 Overloads Overridable 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 Overloads Overridable 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 TMicDetailContainerInfo object + ''' + ''' File to load and deserialize + ''' Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDetailContainerInfo) + 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 TMicDetailContainerInfo) 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 TMicDetailContainerInfo + 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 TMicContainerInfo + + #Region "Private fields" + Private _detailContainerInfo As List(Of TMicDetailContainerInfo) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._detailContainerInfo = New List(Of TMicDetailContainerInfo)() + End Sub + + _ + Public Property DetailContainerInfo() As List(Of TMicDetailContainerInfo) + Get + Return Me._detailContainerInfo + End Get + Set + Me._detailContainerInfo = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainerInfo)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicContainerInfo 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 TMicContainerInfo object + ''' + ''' string to deserialize + ''' Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainerInfo) + 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 TMicContainerInfo) 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 TMicContainerInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicContainerInfo) + 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 TMicContainerInfo + Return CType(SerializerXml.Deserialize(s),TMicContainerInfo) + End Function + #End Region + + ''' + ''' Serializes current TMicContainerInfo 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 Overloads Overridable 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 Overloads Overridable 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 TMicContainerInfo object + ''' + ''' File to load and deserialize + ''' Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainerInfo) + 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 TMicContainerInfo) 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 TMicContainerInfo + 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 TMicLinesCustomerFields + + #Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _text11 As String + + Private _text12 As String + + Private _text13 As String + + Private _text14 As String + + Private _text15 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _date11 As Date + + Private _date12 As Date + + Private _date13 As Date + + Private _date14 As Date + + Private _date15 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _flag11 As Boolean + + Private _flag12 As Boolean + + Private _flag13 As Boolean + + Private _flag14 As Boolean + + Private _flag15 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private _number11 As Decimal + + Private _number12 As Decimal + + Private _number13 As Decimal + + Private _number14 As Decimal + + Private _number15 As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = value + End Set + End Property + + Public Property text11() As String + Get + Return Me._text11 + End Get + Set + Me._text11 = value + End Set + End Property + + Public Property text12() As String + Get + Return Me._text12 + End Get + Set + Me._text12 = value + End Set + End Property + + Public Property text13() As String + Get + Return Me._text13 + End Get + Set + Me._text13 = value + End Set + End Property + + Public Property text14() As String + Get + Return Me._text14 + End Get + Set + Me._text14 = value + End Set + End Property + + Public Property text15() As String + Get + Return Me._text15 + End Get + Set + Me._text15 = value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = value + End Set + End Property + + Public Property date11() As Date + Get + Return Me._date11 + End Get + Set + Me._date11 = value + End Set + End Property + + Public Property date12() As Date + Get + Return Me._date12 + End Get + Set + Me._date12 = value + End Set + End Property + + Public Property date13() As Date + Get + Return Me._date13 + End Get + Set + Me._date13 = value + End Set + End Property + + Public Property date14() As Date + Get + Return Me._date14 + End Get + Set + Me._date14 = value + End Set + End Property + + Public Property date15() As Date + Get + Return Me._date15 + End Get + Set + Me._date15 = value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = value + End Set + End Property + + Public Property flag11() As Boolean + Get + Return Me._flag11 + End Get + Set + Me._flag11 = value + End Set + End Property + + Public Property flag12() As Boolean + Get + Return Me._flag12 + End Get + Set + Me._flag12 = value + End Set + End Property + + Public Property flag13() As Boolean + Get + Return Me._flag13 + End Get + Set + Me._flag13 = value + End Set + End Property + + Public Property flag14() As Boolean + Get + Return Me._flag14 + End Get + Set + Me._flag14 = value + End Set + End Property + + Public Property flag15() As Boolean + Get + Return Me._flag15 + End Get + Set + Me._flag15 = value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = value + End Set + End Property + + Public Property number11() As Decimal + Get + Return Me._number11 + End Get + Set + Me._number11 = value + End Set + End Property + + Public Property number12() As Decimal + Get + Return Me._number12 + End Get + Set + Me._number12 = value + End Set + End Property + + Public Property number13() As Decimal + Get + Return Me._number13 + End Get + Set + Me._number13 = value + End Set + End Property + + Public Property number14() As Decimal + Get + Return Me._number14 + End Get + Set + Me._number14 = value + End Set + End Property + + Public Property number15() As Decimal + Get + Return Me._number15 + End Get + Set + Me._number15 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicLinesCustomerFields)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicLinesCustomerFields 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 TMicLinesCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLinesCustomerFields) + 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 TMicLinesCustomerFields) 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 TMicLinesCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicLinesCustomerFields) + 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 TMicLinesCustomerFields + Return CType(SerializerXml.Deserialize(s),TMicLinesCustomerFields) + End Function + #End Region + + ''' + ''' Serializes current TMicLinesCustomerFields 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 Overloads Overridable 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 Overloads Overridable 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 TMicLinesCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLinesCustomerFields) + 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 TMicLinesCustomerFields) 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 TMicLinesCustomerFields + 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 TMicImportRegistrationNo + + #Region "Private fields" + Private _registrationNumber1 As String + + Private _registrationNumber2 As String + + Private _registrationNumber3 As String + + Private _registrationNumber4 As String + + Private _registrationNumberOld As String + + Private _registrationNumber2Old As String + + Private _messageRefNumber1 As String + + Private _messageRefNumber2 As String + + Private _messageRefNumber3 As String + + Private _positionNumber1 As Decimal + + Private _positionNumber2 As Decimal + + 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 registrationNumber4() As String + Get + Return Me._registrationNumber4 + End Get + Set + Me._registrationNumber4 = value + End Set + End Property + + Public Property registrationNumberOld() As String + Get + Return Me._registrationNumberOld + End Get + Set + Me._registrationNumberOld = value + End Set + End Property + + Public Property registrationNumber2Old() As String + Get + Return Me._registrationNumber2Old + End Get + Set + Me._registrationNumber2Old = value + End Set + End Property + + Public Property messageRefNumber1() As String + Get + Return Me._messageRefNumber1 + End Get + Set + Me._messageRefNumber1 = value + End Set + End Property + + Public Property messageRefNumber2() As String + Get + Return Me._messageRefNumber2 + End Get + Set + Me._messageRefNumber2 = value + End Set + End Property + + Public Property messageRefNumber3() As String + Get + Return Me._messageRefNumber3 + End Get + Set + Me._messageRefNumber3 = value + End Set + End Property + + Public Property positionNumber1() As Decimal + Get + Return Me._positionNumber1 + End Get + Set + Me._positionNumber1 = value + End Set + End Property + + Public Property positionNumber2() As Decimal + Get + Return Me._positionNumber2 + End Get + Set + Me._positionNumber2 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportRegistrationNo)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportRegistrationNo 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 TMicImportRegistrationNo object + ''' + ''' string to deserialize + ''' Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportRegistrationNo) + 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 TMicImportRegistrationNo) 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 TMicImportRegistrationNo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicImportRegistrationNo) + 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 TMicImportRegistrationNo + Return CType(SerializerXml.Deserialize(s),TMicImportRegistrationNo) + End Function + #End Region + + ''' + ''' Serializes current TMicImportRegistrationNo 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 Overloads Overridable 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 Overloads Overridable 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 TMicImportRegistrationNo object + ''' + ''' File to load and deserialize + ''' Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportRegistrationNo) + 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 TMicImportRegistrationNo) 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 TMicImportRegistrationNo + 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 TMicReceipt + + #Region "Private fields" + Private _receiptNumber As String + + Private _receiptDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property receiptNumber() As String + Get + Return Me._receiptNumber + End Get + Set + Me._receiptNumber = value + End Set + End Property + + _ + Public Property receiptDate() As Date + Get + Return Me._receiptDate + End Get + Set + Me._receiptDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicReceipt)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicReceipt 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 TMicReceipt object + ''' + ''' string to deserialize + ''' Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicReceipt) + 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 TMicReceipt) 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 TMicReceipt + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicReceipt) + 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 TMicReceipt + Return CType(SerializerXml.Deserialize(s),TMicReceipt) + End Function + #End Region + + ''' + ''' Serializes current TMicReceipt 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 Overloads Overridable 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 Overloads Overridable 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 TMicReceipt object + ''' + ''' File to load and deserialize + ''' Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicReceipt) + 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 TMicReceipt) 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 TMicReceipt + 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 TMicPackage + + #Region "Private fields" + Private _packageCount As Decimal + + Private _packageType As String + + Private _packageDescription As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property packageCount() As Decimal + Get + Return Me._packageCount + End Get + Set + Me._packageCount = value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = value + End Set + End Property + + Public Property packageDescription() As String + Get + Return Me._packageDescription + End Get + Set + Me._packageDescription = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackage)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackage 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 TMicPackage object + ''' + ''' string to deserialize + ''' Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackage) + 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 TMicPackage) 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 TMicPackage + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPackage) + 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 TMicPackage + Return CType(SerializerXml.Deserialize(s),TMicPackage) + End Function + #End Region + + ''' + ''' Serializes current TMicPackage 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 Overloads Overridable 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 Overloads Overridable 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 TMicPackage object + ''' + ''' File to load and deserialize + ''' Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackage) + 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 TMicPackage) 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 TMicPackage + 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 TMicBom + + #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(TMicBom)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicBom 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 TMicBom object + ''' + ''' string to deserialize + ''' Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicBom) + 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 TMicBom) 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 TMicBom + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicBom) + 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 TMicBom + Return CType(SerializerXml.Deserialize(s),TMicBom) + End Function + #End Region + + ''' + ''' Serializes current TMicBom 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 Overloads Overridable 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 Overloads Overridable 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 TMicBom object + ''' + ''' File to load and deserialize + ''' Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicBom) + 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 TMicBom) 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 TMicBom + 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 TMicPreviousDocument + + #Region "Private fields" + Private _previousDocType As String + + Private _previousDocNumber As String + + Private _previousDocDate As Date + + Private _customsDate As Date + + Private _departureCustomsOffice As String + + Private _destinationCustomsOffice As String + + Private _type As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property previousDocType() As String + Get + Return Me._previousDocType + End Get + Set + Me._previousDocType = value + End Set + End Property + + Public Property previousDocNumber() As String + Get + Return Me._previousDocNumber + End Get + Set + Me._previousDocNumber = value + End Set + End Property + + _ + Public Property previousDocDate() As Date + Get + Return Me._previousDocDate + End Get + Set + Me._previousDocDate = value + End Set + End Property + + _ + Public Property customsDate() As Date + Get + Return Me._customsDate + End Get + Set + Me._customsDate = value + End Set + End Property + + Public Property departureCustomsOffice() As String + Get + Return Me._departureCustomsOffice + End Get + Set + Me._departureCustomsOffice = value + End Set + End Property + + Public Property destinationCustomsOffice() As String + Get + Return Me._destinationCustomsOffice + End Get + Set + Me._destinationCustomsOffice = 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 creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocument)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreviousDocument 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 TMicPreviousDocument object + ''' + ''' string to deserialize + ''' Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocument) + 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 TMicPreviousDocument) 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 TMicPreviousDocument + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPreviousDocument) + 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 TMicPreviousDocument + Return CType(SerializerXml.Deserialize(s),TMicPreviousDocument) + End Function + #End Region + + ''' + ''' Serializes current TMicPreviousDocument 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 Overloads Overridable 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 Overloads Overridable 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 TMicPreviousDocument object + ''' + ''' File to load and deserialize + ''' Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocument) + 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 TMicPreviousDocument) 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 TMicPreviousDocument + 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 TMicPreviousDocuments + + #Region "Private fields" + Private _previousDocument As List(Of TMicPreviousDocument) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._previousDocument = New List(Of TMicPreviousDocument)() + End Sub + + _ + Public Property PreviousDocument() As List(Of TMicPreviousDocument) + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocuments)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreviousDocuments 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 TMicPreviousDocuments object + ''' + ''' string to deserialize + ''' Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocuments) + 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 TMicPreviousDocuments) 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 TMicPreviousDocuments + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPreviousDocuments) + 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 TMicPreviousDocuments + Return CType(SerializerXml.Deserialize(s),TMicPreviousDocuments) + End Function + #End Region + + ''' + ''' Serializes current TMicPreviousDocuments 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 Overloads Overridable 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 Overloads Overridable 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 TMicPreviousDocuments object + ''' + ''' File to load and deserialize + ''' Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocuments) + 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 TMicPreviousDocuments) 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 TMicPreviousDocuments + 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 TMicAdditionalCostsVAT + + #Region "Private fields" + Private _addAmountVAT As Decimal + + Private _addCurrencyVAT As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property addAmountVAT() As Decimal + Get + Return Me._addAmountVAT + End Get + Set + Me._addAmountVAT = value + End Set + End Property + + Public Property addCurrencyVAT() As String + Get + Return Me._addCurrencyVAT + End Get + Set + Me._addCurrencyVAT = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCostsVAT)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT object + ''' + ''' string to deserialize + ''' Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT) 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 TMicAdditionalCostsVAT + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT + Return CType(SerializerXml.Deserialize(s),TMicAdditionalCostsVAT) + End Function + #End Region + + ''' + ''' Serializes current TMicAdditionalCostsVAT 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 Overloads Overridable 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 Overloads Overridable 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 TMicAdditionalCostsVAT object + ''' + ''' File to load and deserialize + ''' Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT) 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 TMicAdditionalCostsVAT + 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 TMicRebateLine + + #Region "Private fields" + Private _rebAmount As Decimal + + Private _rebCurrency As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property rebAmount() As Decimal + Get + Return Me._rebAmount + End Get + Set + Me._rebAmount = value + End Set + End Property + + Public Property rebCurrency() As String + Get + Return Me._rebCurrency + End Get + Set + Me._rebCurrency = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebateLine)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicRebateLine 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 TMicRebateLine object + ''' + ''' string to deserialize + ''' Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebateLine) + 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 TMicRebateLine) 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 TMicRebateLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicRebateLine) + 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 TMicRebateLine + Return CType(SerializerXml.Deserialize(s),TMicRebateLine) + End Function + #End Region + + ''' + ''' Serializes current TMicRebateLine 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 Overloads Overridable 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 Overloads Overridable 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 TMicRebateLine object + ''' + ''' File to load and deserialize + ''' Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebateLine) + 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 TMicRebateLine) 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 TMicRebateLine + 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 TMicInsuranceCostsLine + + #Region "Private fields" + Private _insAmount As Decimal + + Private _insCurrency As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property insAmount() As Decimal + Get + Return Me._insAmount + End Get + Set + Me._insAmount = value + End Set + End Property + + Public Property insCurrency() As String + Get + Return Me._insCurrency + End Get + Set + Me._insCurrency = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsLine)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInsuranceCostsLine 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 TMicInsuranceCostsLine object + ''' + ''' string to deserialize + ''' Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine) 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 TMicInsuranceCostsLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine + Return CType(SerializerXml.Deserialize(s),TMicInsuranceCostsLine) + End Function + #End Region + + ''' + ''' Serializes current TMicInsuranceCostsLine 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 Overloads Overridable 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 Overloads Overridable 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 TMicInsuranceCostsLine object + ''' + ''' File to load and deserialize + ''' Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine) 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 TMicInsuranceCostsLine + 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 TMicFreightCostsLine + + #Region "Private fields" + Private _frtAmount As Decimal + + Private _frtCurrency As String + + Private _frtInternational As Decimal + + Private _frtEuNational As Decimal + + Private _frtInland As Decimal + + Private _frtFlagPercentOrValue As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._frtFlagPercentOrValue = "P" + End Sub + + Public Property frtAmount() As Decimal + Get + Return Me._frtAmount + End Get + Set + Me._frtAmount = value + End Set + End Property + + Public Property frtCurrency() As String + Get + Return Me._frtCurrency + End Get + Set + Me._frtCurrency = value + End Set + End Property + + Public Property frtInternational() As Decimal + Get + Return Me._frtInternational + End Get + Set + Me._frtInternational = value + End Set + End Property + + Public Property frtEuNational() As Decimal + Get + Return Me._frtEuNational + End Get + Set + Me._frtEuNational = value + End Set + End Property + + Public Property frtInland() As Decimal + Get + Return Me._frtInland + End Get + Set + Me._frtInland = value + End Set + End Property + + _ + Public Property frtFlagPercentOrValue() As String + Get + Return Me._frtFlagPercentOrValue + End Get + Set + Me._frtFlagPercentOrValue = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsLine)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicFreightCostsLine 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 TMicFreightCostsLine object + ''' + ''' string to deserialize + ''' Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsLine) + 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 TMicFreightCostsLine) 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 TMicFreightCostsLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicFreightCostsLine) + 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 TMicFreightCostsLine + Return CType(SerializerXml.Deserialize(s),TMicFreightCostsLine) + End Function + #End Region + + ''' + ''' Serializes current TMicFreightCostsLine 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 Overloads Overridable 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 Overloads Overridable 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 TMicFreightCostsLine object + ''' + ''' File to load and deserialize + ''' Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsLine) + 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 TMicFreightCostsLine) 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 TMicFreightCostsLine + 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 TMicPricing + + #Region "Private fields" + Private _prcType As String + + Private _prcReference As String + + Private _prcDate As Date + + Private _prcSystem As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property prcType() As String + Get + Return Me._prcType + End Get + Set + Me._prcType = value + End Set + End Property + + Public Property prcReference() As String + Get + Return Me._prcReference + End Get + Set + Me._prcReference = value + End Set + End Property + + _ + Public Property prcDate() As Date + Get + Return Me._prcDate + End Get + Set + Me._prcDate = value + End Set + End Property + + Public Property prcSystem() As String + Get + Return Me._prcSystem + End Get + Set + Me._prcSystem = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPricing)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPricing 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 TMicPricing object + ''' + ''' string to deserialize + ''' Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPricing) + 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 TMicPricing) 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 TMicPricing + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPricing) + 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 TMicPricing + Return CType(SerializerXml.Deserialize(s),TMicPricing) + End Function + #End Region + + ''' + ''' Serializes current TMicPricing 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 Overloads Overridable 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 Overloads Overridable 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 TMicPricing object + ''' + ''' File to load and deserialize + ''' Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPricing) + 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 TMicPricing) 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 TMicPricing + 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 TMicImportLineLicense + + #Region "Private fields" + Private _type As String + + Private _code As String + + Private _number As String + + Private _date As Date + + Private _notRequired As Boolean + + 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 code() As String + Get + Return Me._code + End Get + Set + Me._code = value + End Set + End Property + + Public Property number() As String + Get + Return Me._number + End Get + Set + Me._number = value + End Set + End Property + + _ + Public Property [date]() As Date + Get + Return Me._date + End Get + Set + Me._date = value + End Set + End Property + + Public Property notRequired() As Boolean + Get + Return Me._notRequired + End Get + Set + Me._notRequired = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineLicense)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportLineLicense 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 TMicImportLineLicense object + ''' + ''' string to deserialize + ''' Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineLicense) + 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 TMicImportLineLicense) 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 TMicImportLineLicense + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicImportLineLicense) + 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 TMicImportLineLicense + Return CType(SerializerXml.Deserialize(s),TMicImportLineLicense) + End Function + #End Region + + ''' + ''' Serializes current TMicImportLineLicense 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 Overloads Overridable 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 Overloads Overridable 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 TMicImportLineLicense object + ''' + ''' File to load and deserialize + ''' Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineLicense) + 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 TMicImportLineLicense) 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 TMicImportLineLicense + 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 TMicTariffCode + + #Region "Private fields" + Private _hsCode As String + + Private _vatCode As String + + Private _exciseTaxCode As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property hsCode() As String + Get + Return Me._hsCode + End Get + Set + Me._hsCode = value + End Set + End Property + + Public Property vatCode() As String + Get + Return Me._vatCode + End Get + Set + Me._vatCode = value + End Set + End Property + + Public Property exciseTaxCode() As String + Get + Return Me._exciseTaxCode + End Get + Set + Me._exciseTaxCode = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicTariffCode)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicTariffCode 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 TMicTariffCode object + ''' + ''' string to deserialize + ''' Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicTariffCode) + 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 TMicTariffCode) 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 TMicTariffCode + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicTariffCode) + 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 TMicTariffCode + Return CType(SerializerXml.Deserialize(s),TMicTariffCode) + End Function + #End Region + + ''' + ''' Serializes current TMicTariffCode 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 Overloads Overridable 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 Overloads Overridable 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 TMicTariffCode object + ''' + ''' File to load and deserialize + ''' Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicTariffCode) + 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 TMicTariffCode) 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 TMicTariffCode + 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 TMicItem + + #Region "Private fields" + Private _partNumber As String + + Private _partDescription As String + + Private _serialNumber As String + + Private _productGroup As String + + Private _model As String + + Private _brand As String + + Private _manufacturerNumber As String + + Private _ctoNumber As String + + Private _confidenceLevel As Long + + Private _productCategory As String + + Private _usage As String + + Private _usageType As String + + Private _tariffCode As TMicTariffCode + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._tariffCode = New TMicTariffCode() + End Sub + + Public Property partNumber() As String + Get + Return Me._partNumber + End Get + Set + Me._partNumber = value + End Set + End Property + + Public Property partDescription() As String + Get + Return Me._partDescription + End Get + Set + Me._partDescription = value + End Set + End Property + + Public Property serialNumber() As String + Get + Return Me._serialNumber + End Get + Set + Me._serialNumber = value + End Set + End Property + + Public Property productGroup() As String + Get + Return Me._productGroup + End Get + Set + Me._productGroup = 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 manufacturerNumber() As String + Get + Return Me._manufacturerNumber + End Get + Set + Me._manufacturerNumber = value + End Set + End Property + + Public Property ctoNumber() As String + Get + Return Me._ctoNumber + End Get + Set + Me._ctoNumber = value + End Set + End Property + + Public Property confidenceLevel() As Long + Get + Return Me._confidenceLevel + End Get + Set + Me._confidenceLevel = value + End Set + End Property + + Public Property productCategory() As String + Get + Return Me._productCategory + End Get + Set + Me._productCategory = value + End Set + End Property + + Public Property usage() As String + Get + Return Me._usage + End Get + Set + Me._usage = value + End Set + End Property + + Public Property usageType() As String + Get + Return Me._usageType + End Get + Set + Me._usageType = value + End Set + End Property + + Public Property TariffCode() As TMicTariffCode + Get + Return Me._tariffCode + End Get + Set + Me._tariffCode = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicItem)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicItem 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 TMicItem object + ''' + ''' string to deserialize + ''' Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicItem) + 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 TMicItem) 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 TMicItem + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicItem) + 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 TMicItem + Return CType(SerializerXml.Deserialize(s),TMicItem) + End Function + #End Region + + ''' + ''' Serializes current TMicItem 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 Overloads Overridable 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 Overloads Overridable 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 TMicItem object + ''' + ''' File to load and deserialize + ''' Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicItem) + 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 TMicItem) 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 TMicItem + 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 TMicInvoiceLine + + #Region "Private fields" + Private _lineNumber As Decimal + + Private _item As TMicItem + + Private _quantity As Decimal + + Private _quantityUom As String + + Private _netWeight As Decimal + + Private _grossWeight As Decimal + + Private _reportingQuantity As Decimal + + Private _reportingQuantityUom As String + + Private _price As Decimal + + Private _lineValue As Decimal + + Private _license As TMicImportLineLicense + + Private _pricing As TMicPricing + + Private _freightCosts As TMicFreightCostsLine + + Private _insuranceCosts As TMicInsuranceCostsLine + + Private _additionalCost As List(Of TMicAdditionalCosts) + + Private _rebate As TMicRebateLine + + Private _additionalCostsVAT As TMicAdditionalCostsVAT + + Private _countryOfOrigin As String + + Private _prefCountryOfOrigin As String + + Private _locationOfGoods As String + + Private _importQuota As String + + Private _importQuotaKey As String + + Private _importQuotaQuantity As Decimal + + Private _importQuotaUnitOfMeasurement As String + + Private _importQuotaQualifier As String + + Private _customsProcedure As String + + Private _statisticalCode As String + + Private _endUseIndicator As String + + Private _transactionType As String + + Private _valuationMethod As String + + Private _addCode As List(Of String) + + Private _prefRequestCode As String + + Private _documents As TMicDocuments + + Private _previousDocument As TMicPreviousDocuments + + Private _bOM As TMicBom + + Private _stockType As String + + Private _stockType2 As String + + Private _stockExpiryDate As Date + + Private _package As TMicPackage + + Private _accountNumber As String + + Private _deliveryNote As String + + Private _orderNumber As String + + Private _orderPosition As Long + + Private _receipt As TMicReceipt + + Private _asnNumber As String + + Private _referenceValue As Decimal + + Private _referenceCurrency As String + + Private _text As String + + Private _text2 As String + + Private _registrationNumbers As TMicImportRegistrationNo + + Private _customerFields As TMicLinesCustomerFields + + Private _attributes As TMicAttributes + + Private _containerInfo As TMicContainerInfo + + Private _partners As TMicPartners + + Private _calculatedValues As TMicCalculatedValues + + Private _calculatedValuesCust As TMicCalculatedValuesCust + + Private _duties As TMicDuties + + Private _dutyTaxes As TMicDutyTaxes + + Private _dutySavings As TMicDutySavings + + Private _oprDetails As TMicOprInfo + + Private _additionalParams As TMicImportLineAdditionalParams + + Private _uniqueId As Decimal + + Private _externalProcessing As String + + Private _additionalInformation As TMicAttributes + + Private _intra As TMicCustIntraLine + + Private _preSupplier As TMicPreSupplier + + Private _ucr As String + + Private _cusCode As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _valuationIndicator As String + + Private _trackingNumber As String + + Private _referencePreviousProcedures As TReferencePreviousProcedures + + Private _packagesData As TMicPackagesData + + Private _authorisationHolders As TMicAuthHolders + + Private _acceptanceDate As Date + + Private _noCertOrigin As Boolean + + Private _manualContribution As Decimal + + Private _manualContributionCurrency As String + + Private _eudr As TMicInvoiceLineEudr + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._eudr = New TMicInvoiceLineEudr() + Me._authorisationHolders = New TMicAuthHolders() + Me._packagesData = New TMicPackagesData() + Me._referencePreviousProcedures = New TReferencePreviousProcedures() + Me._preSupplier = New TMicPreSupplier() + Me._intra = New TMicCustIntraLine() + Me._additionalInformation = New TMicAttributes() + Me._additionalParams = New TMicImportLineAdditionalParams() + Me._oprDetails = New TMicOprInfo() + Me._dutySavings = New TMicDutySavings() + Me._dutyTaxes = New TMicDutyTaxes() + Me._duties = New TMicDuties() + Me._calculatedValuesCust = New TMicCalculatedValuesCust() + Me._calculatedValues = New TMicCalculatedValues() + Me._partners = New TMicPartners() + Me._containerInfo = New TMicContainerInfo() + Me._attributes = New TMicAttributes() + Me._customerFields = New TMicLinesCustomerFields() + Me._registrationNumbers = New TMicImportRegistrationNo() + Me._receipt = New TMicReceipt() + Me._package = New TMicPackage() + Me._bOM = New TMicBom() + Me._previousDocument = New TMicPreviousDocuments() + Me._documents = New TMicDocuments() + Me._addCode = New List(Of String)() + Me._additionalCostsVAT = New TMicAdditionalCostsVAT() + Me._rebate = New TMicRebateLine() + Me._additionalCost = New List(Of TMicAdditionalCosts)() + Me._insuranceCosts = New TMicInsuranceCostsLine() + Me._freightCosts = New TMicFreightCostsLine() + Me._pricing = New TMicPricing() + Me._license = New TMicImportLineLicense() + Me._item = New TMicItem() + End Sub + + Public Property lineNumber() As Decimal + Get + Return Me._lineNumber + End Get + Set + Me._lineNumber = value + End Set + End Property + + Public Property Item() As TMicItem + Get + Return Me._item + End Get + Set + Me._item = 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 quantityUom() As String + Get + Return Me._quantityUom + End Get + Set + Me._quantityUom = value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = value + End Set + End Property + + Public Property grossWeight() As Decimal + Get + Return Me._grossWeight + End Get + Set + Me._grossWeight = value + End Set + End Property + + Public Property reportingQuantity() As Decimal + Get + Return Me._reportingQuantity + End Get + Set + Me._reportingQuantity = value + End Set + End Property + + Public Property reportingQuantityUom() As String + Get + Return Me._reportingQuantityUom + End Get + Set + Me._reportingQuantityUom = value + End Set + End Property + + Public Property price() As Decimal + Get + Return Me._price + End Get + Set + Me._price = value + End Set + End Property + + Public Property lineValue() As Decimal + Get + Return Me._lineValue + End Get + Set + Me._lineValue = value + End Set + End Property + + Public Property License() As TMicImportLineLicense + Get + Return Me._license + End Get + Set + Me._license = value + End Set + End Property + + Public Property Pricing() As TMicPricing + Get + Return Me._pricing + End Get + Set + Me._pricing = value + End Set + End Property + + Public Property FreightCosts() As TMicFreightCostsLine + Get + Return Me._freightCosts + End Get + Set + Me._freightCosts = value + End Set + End Property + + Public Property InsuranceCosts() As TMicInsuranceCostsLine + Get + Return Me._insuranceCosts + End Get + Set + Me._insuranceCosts = value + End Set + End Property + + _ + Public Property AdditionalCost() As List(Of TMicAdditionalCosts) + Get + Return Me._additionalCost + End Get + Set + Me._additionalCost = value + End Set + End Property + + Public Property Rebate() As TMicRebateLine + Get + Return Me._rebate + End Get + Set + Me._rebate = value + End Set + End Property + + Public Property AdditionalCostsVAT() As TMicAdditionalCostsVAT + Get + Return Me._additionalCostsVAT + End Get + Set + Me._additionalCostsVAT = value + End Set + End Property + + Public Property countryOfOrigin() As String + Get + Return Me._countryOfOrigin + End Get + Set + Me._countryOfOrigin = value + End Set + End Property + + Public Property prefCountryOfOrigin() As String + Get + Return Me._prefCountryOfOrigin + End Get + Set + Me._prefCountryOfOrigin = value + End Set + End Property + + Public Property locationOfGoods() As String + Get + Return Me._locationOfGoods + End Get + Set + Me._locationOfGoods = value + End Set + End Property + + Public Property importQuota() As String + Get + Return Me._importQuota + End Get + Set + Me._importQuota = value + End Set + End Property + + Public Property importQuotaKey() As String + Get + Return Me._importQuotaKey + End Get + Set + Me._importQuotaKey = value + End Set + End Property + + Public Property importQuotaQuantity() As Decimal + Get + Return Me._importQuotaQuantity + End Get + Set + Me._importQuotaQuantity = value + End Set + End Property + + Public Property importQuotaUnitOfMeasurement() As String + Get + Return Me._importQuotaUnitOfMeasurement + End Get + Set + Me._importQuotaUnitOfMeasurement = value + End Set + End Property + + Public Property importQuotaQualifier() As String + Get + Return Me._importQuotaQualifier + End Get + Set + Me._importQuotaQualifier = value + End Set + End Property + + Public Property customsProcedure() As String + Get + Return Me._customsProcedure + End Get + Set + Me._customsProcedure = value + End Set + End Property + + Public Property statisticalCode() As String + Get + Return Me._statisticalCode + End Get + Set + Me._statisticalCode = value + End Set + End Property + + Public Property endUseIndicator() As String + Get + Return Me._endUseIndicator + End Get + Set + Me._endUseIndicator = value + End Set + End Property + + Public Property transactionType() As String + Get + Return Me._transactionType + End Get + Set + Me._transactionType = value + End Set + End Property + + Public Property valuationMethod() As String + Get + Return Me._valuationMethod + End Get + Set + Me._valuationMethod = 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 prefRequestCode() As String + Get + Return Me._prefRequestCode + End Get + Set + Me._prefRequestCode = value + End Set + End Property + + Public Property Documents() As TMicDocuments + Get + Return Me._documents + End Get + Set + Me._documents = value + End Set + End Property + + Public Property PreviousDocument() As TMicPreviousDocuments + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = value + End Set + End Property + + Public Property BOM() As TMicBom + Get + Return Me._bOM + End Get + Set + Me._bOM = value + End Set + End Property + + Public Property stockType() As String + Get + Return Me._stockType + End Get + Set + Me._stockType = value + End Set + End Property + + Public Property stockType2() As String + Get + Return Me._stockType2 + End Get + Set + Me._stockType2 = value + End Set + End Property + + _ + Public Property stockExpiryDate() As Date + Get + Return Me._stockExpiryDate + End Get + Set + Me._stockExpiryDate = value + End Set + End Property + + Public Property Package() As TMicPackage + Get + Return Me._package + End Get + Set + Me._package = value + End Set + End Property + + Public Property accountNumber() As String + Get + Return Me._accountNumber + End Get + Set + Me._accountNumber = value + End Set + End Property + + Public Property deliveryNote() As String + Get + Return Me._deliveryNote + End Get + Set + Me._deliveryNote = value + End Set + End Property + + Public Property orderNumber() As String + Get + Return Me._orderNumber + End Get + Set + Me._orderNumber = value + End Set + End Property + + Public Property orderPosition() As Long + Get + Return Me._orderPosition + End Get + Set + Me._orderPosition = value + End Set + End Property + + Public Property Receipt() As TMicReceipt + Get + Return Me._receipt + End Get + Set + Me._receipt = value + End Set + End Property + + Public Property asnNumber() As String + Get + Return Me._asnNumber + End Get + Set + Me._asnNumber = 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 referenceCurrency() As String + Get + Return Me._referenceCurrency + End Get + Set + Me._referenceCurrency = 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 text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = value + End Set + End Property + + Public Property RegistrationNumbers() As TMicImportRegistrationNo + Get + Return Me._registrationNumbers + End Get + Set + Me._registrationNumbers = value + End Set + End Property + + Public Property CustomerFields() As TMicLinesCustomerFields + Get + Return Me._customerFields + End Get + Set + Me._customerFields = value + End Set + End Property + + Public Property Attributes() As TMicAttributes + Get + Return Me._attributes + End Get + Set + Me._attributes = value + End Set + End Property + + Public Property ContainerInfo() As TMicContainerInfo + Get + Return Me._containerInfo + End Get + Set + Me._containerInfo = value + End Set + End Property + + Public Property Partners() As TMicPartners + Get + Return Me._partners + End Get + Set + Me._partners = value + End Set + End Property + + Public Property CalculatedValues() As TMicCalculatedValues + Get + Return Me._calculatedValues + End Get + Set + Me._calculatedValues = value + End Set + End Property + + Public Property CalculatedValuesCust() As TMicCalculatedValuesCust + Get + Return Me._calculatedValuesCust + End Get + Set + Me._calculatedValuesCust = 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 + + Public Property DutySavings() As TMicDutySavings + Get + Return Me._dutySavings + End Get + Set + Me._dutySavings = value + End Set + End Property + + Public Property OprDetails() As TMicOprInfo + Get + Return Me._oprDetails + End Get + Set + Me._oprDetails = value + End Set + End Property + + Public Property AdditionalParams() As TMicImportLineAdditionalParams + Get + Return Me._additionalParams + End Get + Set + Me._additionalParams = value + End Set + End Property + + Public Property uniqueId() As Decimal + Get + Return Me._uniqueId + End Get + Set + Me._uniqueId = value + End Set + End Property + + Public Property externalProcessing() As String + Get + Return Me._externalProcessing + End Get + Set + Me._externalProcessing = value + End Set + End Property + + Public Property AdditionalInformation() As TMicAttributes + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = value + End Set + End Property + + Public Property Intra() As TMicCustIntraLine + Get + Return Me._intra + End Get + Set + Me._intra = value + End Set + End Property + + Public Property PreSupplier() As TMicPreSupplier + Get + Return Me._preSupplier + End Get + Set + Me._preSupplier = value + End Set + End Property + + Public Property ucr() As String + Get + Return Me._ucr + End Get + Set + Me._ucr = value + End Set + End Property + + Public Property cusCode() As String + Get + Return Me._cusCode + End Get + Set + Me._cusCode = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Public Property valuationIndicator() As String + Get + Return Me._valuationIndicator + End Get + Set + Me._valuationIndicator = 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 ReferencePreviousProcedures() As TReferencePreviousProcedures + Get + Return Me._referencePreviousProcedures + End Get + Set + Me._referencePreviousProcedures = value + End Set + End Property + + Public Property PackagesData() As TMicPackagesData + Get + Return Me._packagesData + End Get + Set + Me._packagesData = value + End Set + End Property + + Public Property AuthorisationHolders() As TMicAuthHolders + Get + Return Me._authorisationHolders + End Get + Set + Me._authorisationHolders = 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 noCertOrigin() As Boolean + Get + Return Me._noCertOrigin + End Get + Set + Me._noCertOrigin = value + End Set + End Property + + Public Property manualContribution() As Decimal + Get + Return Me._manualContribution + End Get + Set + Me._manualContribution = value + End Set + End Property + + Public Property manualContributionCurrency() As String + Get + Return Me._manualContributionCurrency + End Get + Set + Me._manualContributionCurrency = value + End Set + End Property + + Public Property eudr() As TMicInvoiceLineEudr + Get + Return Me._eudr + End Get + Set + Me._eudr = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLine)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLine 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 TMicInvoiceLine object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLine) + 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 TMicInvoiceLine) 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 TMicInvoiceLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInvoiceLine) + 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 TMicInvoiceLine + Return CType(SerializerXml.Deserialize(s),TMicInvoiceLine) + End Function + #End Region + + ''' + ''' Serializes current TMicInvoiceLine 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 Overloads Overridable 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 Overloads Overridable 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 TMicInvoiceLine object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLine) + 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 TMicInvoiceLine) 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 TMicInvoiceLine + 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 TMicAdditionalCosts + + #Region "Private fields" + Private _addType As String + + Private _addAmount As Decimal + + Private _addCurrency As String + + Private _addProRating As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property addType() As String + Get + Return Me._addType + End Get + Set + Me._addType = value + End Set + End Property + + Public Property addAmount() As Decimal + Get + Return Me._addAmount + End Get + Set + Me._addAmount = value + End Set + End Property + + Public Property addCurrency() As String + Get + Return Me._addCurrency + End Get + Set + Me._addCurrency = value + End Set + End Property + + Public Property addProRating() As String + Get + Return Me._addProRating + End Get + Set + Me._addProRating = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCosts)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAdditionalCosts 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 TMicAdditionalCosts object + ''' + ''' string to deserialize + ''' Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCosts) + 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 TMicAdditionalCosts) 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 TMicAdditionalCosts + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAdditionalCosts) + 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 TMicAdditionalCosts + Return CType(SerializerXml.Deserialize(s),TMicAdditionalCosts) + End Function + #End Region + + ''' + ''' Serializes current TMicAdditionalCosts 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 Overloads Overridable 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 Overloads Overridable 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 TMicAdditionalCosts object + ''' + ''' File to load and deserialize + ''' Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCosts) + 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 TMicAdditionalCosts) 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 TMicAdditionalCosts + 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 TMicDocuments + + #Region "Private fields" + Private _document As List(Of TMicDocument) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._document = New List(Of TMicDocument)() + End Sub + + _ + Public Property Document() As List(Of TMicDocument) + Get + Return Me._document + End Get + Set + Me._document = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocuments)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDocuments 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 TMicDocuments object + ''' + ''' string to deserialize + ''' Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocuments) + 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 TMicDocuments) 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 TMicDocuments + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDocuments) + 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 TMicDocuments + Return CType(SerializerXml.Deserialize(s),TMicDocuments) + End Function + #End Region + + ''' + ''' Serializes current TMicDocuments 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 Overloads Overridable 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 Overloads Overridable 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 TMicDocuments object + ''' + ''' File to load and deserialize + ''' Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocuments) + 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 TMicDocuments) 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 TMicDocuments + 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 TMicDocument + + #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 _docValue As Decimal + + Private _docStatUnit As String + + Private _docMeasurementUnitWriteOff As String + + Private _docAdditionalCostsCurrency As String + + Private _docCurrency As String + + Private _docCategory As String + + Private _docWriteOffQuantity As Decimal + + Private _docIssuerCountry As String + + Private _docAvailableFlag As Boolean + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + 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 docValue() As Decimal + Get + Return Me._docValue + End Get + Set + Me._docValue = 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 docMeasurementUnitWriteOff() As String + Get + Return Me._docMeasurementUnitWriteOff + End Get + Set + Me._docMeasurementUnitWriteOff = value + End Set + End Property + + Public Property docAdditionalCostsCurrency() As String + Get + Return Me._docAdditionalCostsCurrency + End Get + Set + Me._docAdditionalCostsCurrency = 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 docCategory() As String + Get + Return Me._docCategory + End Get + Set + Me._docCategory = value + End Set + End Property + + Public Property docWriteOffQuantity() As Decimal + Get + Return Me._docWriteOffQuantity + End Get + Set + Me._docWriteOffQuantity = value + End Set + End Property + + Public Property docIssuerCountry() As String + Get + Return Me._docIssuerCountry + End Get + Set + Me._docIssuerCountry = value + End Set + End Property + + Public Property docAvailableFlag() As Boolean + Get + Return Me._docAvailableFlag + End Get + Set + Me._docAvailableFlag = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocument)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDocument 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 TMicDocument object + ''' + ''' string to deserialize + ''' Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocument) + 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 TMicDocument) 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 TMicDocument + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDocument) + 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 TMicDocument + Return CType(SerializerXml.Deserialize(s),TMicDocument) + End Function + #End Region + + ''' + ''' Serializes current TMicDocument 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 Overloads Overridable 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 Overloads Overridable 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 TMicDocument object + ''' + ''' File to load and deserialize + ''' Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocument) + 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 TMicDocument) 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 TMicDocument + 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 TMicAttributes + + #Region "Private fields" + Private _attribute As List(Of TMicAttribute) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._attribute = New List(Of TMicAttribute)() + End Sub + + _ + Public Property Attribute() As List(Of TMicAttribute) + Get + Return Me._attribute + End Get + Set + Me._attribute = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttributes)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAttributes 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 TMicAttributes object + ''' + ''' string to deserialize + ''' Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttributes) + 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 TMicAttributes) 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 TMicAttributes + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAttributes) + 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 TMicAttributes + Return CType(SerializerXml.Deserialize(s),TMicAttributes) + End Function + #End Region + + ''' + ''' Serializes current TMicAttributes 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 Overloads Overridable 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 Overloads Overridable 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 TMicAttributes object + ''' + ''' File to load and deserialize + ''' Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttributes) + 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 TMicAttributes) 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 TMicAttributes + 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 TMicAttribute + + #Region "Private fields" + Private _attrType As String + + Private _attrText As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property attrType() As String + Get + Return Me._attrType + End Get + Set + Me._attrType = value + End Set + End Property + + Public Property attrText() As String + Get + Return Me._attrText + End Get + Set + Me._attrText = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttribute)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAttribute 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 TMicAttribute object + ''' + ''' string to deserialize + ''' Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttribute) + 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 TMicAttribute) 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 TMicAttribute + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAttribute) + 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 TMicAttribute + Return CType(SerializerXml.Deserialize(s),TMicAttribute) + End Function + #End Region + + ''' + ''' Serializes current TMicAttribute 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 Overloads Overridable 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 Overloads Overridable 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 TMicAttribute object + ''' + ''' File to load and deserialize + ''' Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttribute) + 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 TMicAttribute) 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 TMicAttribute + 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 TMicPartners + + #Region "Private fields" + Private _partner As List(Of TMicPartner) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._partner = New List(Of TMicPartner)() + End Sub + + _ + Public Property Partner() As List(Of TMicPartner) + Get + Return Me._partner + End Get + Set + Me._partner = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartners)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartners 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 TMicPartners object + ''' + ''' string to deserialize + ''' Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartners) + 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 TMicPartners) 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 TMicPartners + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPartners) + 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 TMicPartners + Return CType(SerializerXml.Deserialize(s),TMicPartners) + End Function + #End Region + + ''' + ''' Serializes current TMicPartners 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 Overloads Overridable 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 Overloads Overridable 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 TMicPartners object + ''' + ''' File to load and deserialize + ''' Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartners) + 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 TMicPartners) 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 TMicPartners + 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 TMicPartner + + #Region "Private fields" + Private _partnerType As String + + Private _partnerAddress As TMicAddress + + Private _partnerRelation As String + + Private _partnerInfo As String + + Private _partnerTelephone As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _partnerRole As String + + Private _customerFields As TMicPartnerCustomerFields + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._customerFields = New TMicPartnerCustomerFields() + Me._partnerAddress = New TMicAddress() + End Sub + + Public Property partnerType() As String + Get + Return Me._partnerType + End Get + Set + Me._partnerType = value + End Set + End Property + + Public Property PartnerAddress() As TMicAddress + 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 partnerInfo() As String + Get + Return Me._partnerInfo + End Get + Set + Me._partnerInfo = value + End Set + End Property + + Public Property partnerTelephone() As String + Get + Return Me._partnerTelephone + End Get + Set + Me._partnerTelephone = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Public Property partnerRole() As String + Get + Return Me._partnerRole + End Get + Set + Me._partnerRole = value + End Set + End Property + + Public Property CustomerFields() As TMicPartnerCustomerFields + 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(TMicPartner)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartner 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 TMicPartner object + ''' + ''' string to deserialize + ''' Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartner) + 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 TMicPartner) 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 TMicPartner + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPartner) + 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 TMicPartner + Return CType(SerializerXml.Deserialize(s),TMicPartner) + End Function + #End Region + + ''' + ''' Serializes current TMicPartner 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 Overloads Overridable 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 Overloads Overridable 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 TMicPartner object + ''' + ''' File to load and deserialize + ''' Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartner) + 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 TMicPartner) 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 TMicPartner + 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 TMicPartnerCustomerFields + + #Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartnerCustomerFields)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartnerCustomerFields 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 TMicPartnerCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields) 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 TMicPartnerCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields + Return CType(SerializerXml.Deserialize(s),TMicPartnerCustomerFields) + End Function + #End Region + + ''' + ''' Serializes current TMicPartnerCustomerFields 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 Overloads Overridable 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 Overloads Overridable 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 TMicPartnerCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields) 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 TMicPartnerCustomerFields + 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 TMicInvoiceLineEudr + + #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(TMicInvoiceLineEudr)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLineEudr 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 TMicInvoiceLineEudr object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr) 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 TMicInvoiceLineEudr + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr + Return CType(SerializerXml.Deserialize(s),TMicInvoiceLineEudr) + End Function + #End Region + + ''' + ''' Serializes current TMicInvoiceLineEudr 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 Overloads Overridable 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 Overloads Overridable 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 TMicInvoiceLineEudr object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr) 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 TMicInvoiceLineEudr + 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 TMicInvoiceLines + + #Region "Private fields" + Private _line As List(Of TMicInvoiceLine) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._line = New List(Of TMicInvoiceLine)() + End Sub + + _ + Public Property Line() As List(Of TMicInvoiceLine) + Get + Return Me._line + End Get + Set + Me._line = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLines)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLines 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 TMicInvoiceLines object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLines) + 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 TMicInvoiceLines) 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 TMicInvoiceLines + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInvoiceLines) + 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 TMicInvoiceLines + Return CType(SerializerXml.Deserialize(s),TMicInvoiceLines) + End Function + #End Region + + ''' + ''' Serializes current TMicInvoiceLines 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 Overloads Overridable 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 Overloads Overridable 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 TMicInvoiceLines object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLines) + 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 TMicInvoiceLines) 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 TMicInvoiceLines + 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 TMicCustIntra + + #Region "Private fields" + Private _vendorVatId As String + + Private _statisticalProcedure As String + + Private _internalReference As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property vendorVatId() As String + Get + Return Me._vendorVatId + End Get + Set + Me._vendorVatId = value + End Set + End Property + + Public Property statisticalProcedure() As String + Get + Return Me._statisticalProcedure + End Get + Set + Me._statisticalProcedure = value + End Set + End Property + + Public Property internalReference() As String + Get + Return Me._internalReference + End Get + Set + Me._internalReference = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntra)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCustIntra 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 TMicCustIntra object + ''' + ''' string to deserialize + ''' Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntra) + 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 TMicCustIntra) 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 TMicCustIntra + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicCustIntra) + 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 TMicCustIntra + Return CType(SerializerXml.Deserialize(s),TMicCustIntra) + End Function + #End Region + + ''' + ''' Serializes current TMicCustIntra 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 Overloads Overridable 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 Overloads Overridable 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 TMicCustIntra object + ''' + ''' File to load and deserialize + ''' Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntra) + 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 TMicCustIntra) 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 TMicCustIntra + 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 TMicAtlasCompletionSumDEntry + + #Region "Private fields" + Private _idType As String + + Private _quantity As Long + + Private _packageType As String + + Private _registrationNumber As String + + Private _lineNumber As Long + + Private _depositor As String + + Private _spoType As String + + Private _spo As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property idType() As String + Get + Return Me._idType + End Get + Set + Me._idType = value + End Set + End Property + + Public Property quantity() As Long + Get + Return Me._quantity + End Get + Set + Me._quantity = value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = value + End Set + End Property + + Public Property lineNumber() As Long + Get + Return Me._lineNumber + End Get + Set + Me._lineNumber = value + End Set + End Property + + Public Property depositor() As String + Get + Return Me._depositor + End Get + Set + Me._depositor = value + End Set + End Property + + Public Property spoType() As String + Get + Return Me._spoType + End Get + Set + Me._spoType = value + End Set + End Property + + Public Property spo() As String + Get + Return Me._spo + End Get + Set + Me._spo = value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumDEntry)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry object + ''' + ''' string to deserialize + ''' Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry) 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 TMicAtlasCompletionSumDEntry + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry + Return CType(SerializerXml.Deserialize(s),TMicAtlasCompletionSumDEntry) + End Function + #End Region + + ''' + ''' Serializes current TMicAtlasCompletionSumDEntry 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 Overloads Overridable 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 Overloads Overridable 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 TMicAtlasCompletionSumDEntry object + ''' + ''' File to load and deserialize + ''' Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry) 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 TMicAtlasCompletionSumDEntry + 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 TMicAtlasCompletionSumD + + #Region "Private fields" + Private _atlasCompletionSumD As List(Of TMicAtlasCompletionSumDEntry) + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Sub New() + MyBase.New + Me._atlasCompletionSumD = New List(Of TMicAtlasCompletionSumDEntry)() + End Sub + + _ + Public Property AtlasCompletionSumD() As List(Of TMicAtlasCompletionSumDEntry) + Get + Return Me._atlasCompletionSumD + End Get + Set + Me._atlasCompletionSumD = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumD)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD object + ''' + ''' string to deserialize + ''' Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD) 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 TMicAtlasCompletionSumD + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD + Return CType(SerializerXml.Deserialize(s),TMicAtlasCompletionSumD) + End Function + #End Region + + ''' + ''' Serializes current TMicAtlasCompletionSumD 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 Overloads Overridable 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 Overloads Overridable 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 TMicAtlasCompletionSumD object + ''' + ''' File to load and deserialize + ''' Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD) 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 TMicAtlasCompletionSumD + 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 TMicContainer + + #Region "Private fields" + Private _containerIndicator As String + + Private _containerNumber As String + + Private _containerType As String + + Private _containerLCLIndicator As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property containerIndicator() As String + Get + Return Me._containerIndicator + End Get + Set + Me._containerIndicator = value + End Set + End Property + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = value + End Set + End Property + + Public Property containerType() As String + Get + Return Me._containerType + End Get + Set + Me._containerType = value + End Set + End Property + + Public Property containerLCLIndicator() As String + Get + Return Me._containerLCLIndicator + End Get + Set + Me._containerLCLIndicator = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainer)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicContainer 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 TMicContainer object + ''' + ''' string to deserialize + ''' Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainer) + 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 TMicContainer) 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 TMicContainer + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicContainer) + 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 TMicContainer + Return CType(SerializerXml.Deserialize(s),TMicContainer) + End Function + #End Region + + ''' + ''' Serializes current TMicContainer 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 Overloads Overridable 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 Overloads Overridable 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 TMicContainer object + ''' + ''' File to load and deserialize + ''' Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainer) + 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 TMicContainer) 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 TMicContainer + 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 TMicImportCustomerFields + + #Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportCustomerFields)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportCustomerFields 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 TMicImportCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportCustomerFields) + 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 TMicImportCustomerFields) 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 TMicImportCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicImportCustomerFields) + 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 TMicImportCustomerFields + Return CType(SerializerXml.Deserialize(s),TMicImportCustomerFields) + End Function + #End Region + + ''' + ''' Serializes current TMicImportCustomerFields 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 Overloads Overridable 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 Overloads Overridable 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 TMicImportCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportCustomerFields) + 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 TMicImportCustomerFields) 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 TMicImportCustomerFields + 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 TMicImportPaymentInfo + + #Region "Private fields" + Private _paymentType As String + + Private _paymentDate As Date + + Private _paymentBankCode As String + + Private _paymentBankBranchCode As String + + Private _paymentCurrency As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property paymentType() As String + Get + Return Me._paymentType + End Get + Set + Me._paymentType = value + End Set + End Property + + Public Property paymentDate() As Date + Get + Return Me._paymentDate + End Get + Set + Me._paymentDate = value + End Set + End Property + + Public Property paymentBankCode() As String + Get + Return Me._paymentBankCode + End Get + Set + Me._paymentBankCode = value + End Set + End Property + + Public Property paymentBankBranchCode() As String + Get + Return Me._paymentBankBranchCode + End Get + Set + Me._paymentBankBranchCode = value + End Set + End Property + + Public Property paymentCurrency() As String + Get + Return Me._paymentCurrency + End Get + Set + Me._paymentCurrency = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportPaymentInfo)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportPaymentInfo 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 TMicImportPaymentInfo object + ''' + ''' string to deserialize + ''' Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportPaymentInfo) + 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 TMicImportPaymentInfo) 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 TMicImportPaymentInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicImportPaymentInfo) + 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 TMicImportPaymentInfo + Return CType(SerializerXml.Deserialize(s),TMicImportPaymentInfo) + End Function + #End Region + + ''' + ''' Serializes current TMicImportPaymentInfo 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 Overloads Overridable 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 Overloads Overridable 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 TMicImportPaymentInfo object + ''' + ''' File to load and deserialize + ''' Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportPaymentInfo) + 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 TMicImportPaymentInfo) 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 TMicImportPaymentInfo + 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 TMicInsuranceCostsInv + + #Region "Private fields" + Private _insAmount As Decimal + + Private _insCurrency As String + + Private _insProRating As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property insAmount() As Decimal + Get + Return Me._insAmount + End Get + Set + Me._insAmount = value + End Set + End Property + + Public Property insCurrency() As String + Get + Return Me._insCurrency + End Get + Set + Me._insCurrency = value + End Set + End Property + + Public Property insProRating() As String + Get + Return Me._insProRating + End Get + Set + Me._insProRating = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsInv)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInsuranceCostsInv 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 TMicInsuranceCostsInv object + ''' + ''' string to deserialize + ''' Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv) 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 TMicInsuranceCostsInv + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv + Return CType(SerializerXml.Deserialize(s),TMicInsuranceCostsInv) + End Function + #End Region + + ''' + ''' Serializes current TMicInsuranceCostsInv 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 Overloads Overridable 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 Overloads Overridable 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 TMicInsuranceCostsInv object + ''' + ''' File to load and deserialize + ''' Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv) 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 TMicInsuranceCostsInv + 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 TMicFreightCostsInv + + #Region "Private fields" + Private _frtAmount As Decimal + + Private _frtCurrency As String + + Private _frtInternational As Decimal + + Private _frtEuNational As Decimal + + Private _frtInland As Decimal + + Private _frtProRating As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property frtAmount() As Decimal + Get + Return Me._frtAmount + End Get + Set + Me._frtAmount = value + End Set + End Property + + Public Property frtCurrency() As String + Get + Return Me._frtCurrency + End Get + Set + Me._frtCurrency = value + End Set + End Property + + Public Property frtInternational() As Decimal + Get + Return Me._frtInternational + End Get + Set + Me._frtInternational = value + End Set + End Property + + Public Property frtEuNational() As Decimal + Get + Return Me._frtEuNational + End Get + Set + Me._frtEuNational = value + End Set + End Property + + Public Property frtInland() As Decimal + Get + Return Me._frtInland + End Get + Set + Me._frtInland = value + End Set + End Property + + Public Property frtProRating() As String + Get + Return Me._frtProRating + End Get + Set + Me._frtProRating = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsInv)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicFreightCostsInv 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 TMicFreightCostsInv object + ''' + ''' string to deserialize + ''' Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsInv) + 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 TMicFreightCostsInv) 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 TMicFreightCostsInv + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicFreightCostsInv) + 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 TMicFreightCostsInv + Return CType(SerializerXml.Deserialize(s),TMicFreightCostsInv) + End Function + #End Region + + ''' + ''' Serializes current TMicFreightCostsInv 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 Overloads Overridable 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 Overloads Overridable 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 TMicFreightCostsInv object + ''' + ''' File to load and deserialize + ''' Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsInv) + 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 TMicFreightCostsInv) 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 TMicFreightCostsInv + 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 TMicRebate + + #Region "Private fields" + Private _rebAmount As Decimal + + Private _rebCurrency As String + + Private _rebProRating As String + + Private Shared _serializerXml As XmlSerializer + #End Region + + Public Property rebAmount() As Decimal + Get + Return Me._rebAmount + End Get + Set + Me._rebAmount = value + End Set + End Property + + Public Property rebCurrency() As String + Get + Return Me._rebCurrency + End Get + Set + Me._rebCurrency = value + End Set + End Property + + Public Property rebProRating() As String + Get + Return Me._rebProRating + End Get + Set + Me._rebProRating = value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebate)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicRebate 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 TMicRebate object + ''' + ''' string to deserialize + ''' Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebate) + 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 TMicRebate) 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 TMicRebate + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicRebate) + 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 TMicRebate + Return CType(SerializerXml.Deserialize(s),TMicRebate) + End Function + #End Region + + ''' + ''' Serializes current TMicRebate 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 Overloads Overridable 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 Overloads Overridable 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 TMicRebate object + ''' + ''' File to load and deserialize + ''' Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebate) + 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 TMicRebate) 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 TMicRebate + 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 TMicDelTerm + + #Region "Private fields" + Private _code As String + + Private _desc As String + + Private _calculationOfFreightCosts As String + + Private _code2 As String + + Private _text 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 + + Public Property calculationOfFreightCosts() As String + Get + Return Me._calculationOfFreightCosts + End Get + Set + Me._calculationOfFreightCosts = value + End Set + End Property + + Public Property code2() As String + Get + Return Me._code2 + End Get + Set + Me._code2 = 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(TMicDelTerm)) + End If + Return _serializerXml + End Get + End Property + + #Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDelTerm 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 TMicDelTerm object + ''' + ''' string to deserialize + ''' Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDelTerm) + 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 TMicDelTerm) 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 TMicDelTerm + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)),TMicDelTerm) + 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 TMicDelTerm + Return CType(SerializerXml.Deserialize(s),TMicDelTerm) + End Function + #End Region + + ''' + ''' Serializes current TMicDelTerm 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 Overloads Overridable 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 Overloads Overridable 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 TMicDelTerm object + ''' + ''' File to load and deserialize + ''' Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDelTerm) + 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 TMicDelTerm) 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 TMicDelTerm + 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_IMPORT/MicCustImportInvoiceComponent.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.xsd new file mode 100644 index 00000000..c69e47ab --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportInvoiceComponent.xsd @@ -0,0 +1,17942 @@ + + + + + + + + Root element of the import message + + + + true + + + + + + + + + + + + + + + + + + Import invoice type + + + + + + Invoice Number + Rechnungsnummer + + + true + String1..30 + + MIC_ALL_EAVKOP + EAKFAKTNR + MIC_EINKOP + EFKFAKTNR + + + + + + + + + + + + + + An unique version id. + Versionsnummer + + + false + String1..50 + + MIC_ALL_EAVKOP + EAKVERSION + MIC_EINKOP + EFKLOCKVERSION + + + + + + + + + + + + + Date of invoice + Rechnungsdatum + + + false + xs:date + + MIC_ALL_EAVKOP + EAKFAKTDAT + MIC_EINKOP + EFKFAKTDAT + + + + + + + + + + + + true + + + + + + + + + + + + + + Invoice attributes + Rechnungsattribute + + + false + + 1-n + + + + + + + + + + + + Invoice documents + Rechnungsunterlagen + + + false + + 1-n + + + + + + + + + + + + Invoice business partner + Rechnungsgeschäftspartner + + + false + + 1-n + + + MIC_EINSDGDOC + + + + + + + + + Invoice completion parts of summary declaration + Rechnungsbeendigungsanteile der Summarischen Anmeldung (SumA) + + + false + + 1-n + + + + + + + + + + + + Intrastat information on invoice level + Intrastatdaten auf Rechnungsebene + + + false + + + + + + + + + + + + + + Invoice lines + Rechnungspositionen + + + true + + 1-n + + + + + + + + + + + + + + + Einfuhrposition + + + true + + 1-n + + + + + + + + + + + + Invoice line + Rechnungsposition + + + true + + + + + + + + + + + + + + + Import invoice line type + + + + + + Invoice Line + Rechnungsposition + + + true + Decimal(4) + + MIC_ALL_EAVPOS + EAPFAKTPOS + MIC_EINPOS + EFPFAKTPOS + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + Quantity + Abgangsmenge + + + false + Decimal(13,3) + + MIC_ALL_EAVPOS + EAPMENGE + MIC_EINPOS + EFPMENGE + + + + + + + + + + + + + + Unit of Measurement + Mengeneinheit + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPMEH + MIC_EINPOS + EFPMEH + + + + + + + + + + + + + Net Weight (kg) + Eigenmasse (kg) + + + false + Decimal(14,6) + + MIC_ALL_EAVPOS + EAPEIGMAS + MIC_EINPOS + EFPEIGMAS + + + + + + + + + + + + + + Gross Weight (kg) + Rohmasse (kg) + + + false + Decimal(14,6) + + MIC_ALL_EAVPOS + EAPROHMAS + MIC_EINPOS + EFPROHMAS + + + + + + + + + + + + + + Statistical Quantity + Statistische Menge + + + false + Decimal(13,3) + + MIC_ALL_EAVPOS + EAPBESM + MIC_EINPOS + EFPBESM + + + + + + + + + + + + + + Quantity Unit + Mengeneinheit + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPBESMEH + MIC_EINPOS + EFPBESMEH + + + + + + + + + + + + + Unit Price + Stückpreis + + + false + Decimal(18,6) + + MIC_ALL_EAVPOS + EAPPREIS + MIC_EINPOS + EFPPREIS + + + + + + + + + + + + + + Line Value + Wert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPWERT + MIC_EINPOS + EFPWERT + + + + + + + + + + + + + + License information + + + + + + + Pricing information to document how the invoice line was priced + + + + false + + + + + + + + + + + + + + Line freight costs + Positionsfrachtkosten + + + false + + + + + + + + + + + + + + Line insurance costs + Positionsversicherungskosten + + + false + + + + + + + + + + + + + + Line additional costs + Positionsnebenkosten + + + false + + 0-8 + MIC_ALL_EAVPOS + EAP___ + MIC_EINPOS + EFP___ + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + Country of Origin + Ursprungsland + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPURLD + MIC_EINPOS + EFPURLD + + + + + + + + + + + + + Preferential country of origin + Präferenz Ursprungsland + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPPRAEFURLD + MIC_EINPOS + EFPPRAEFURLD + + + + + + + + + + + + + Location of Goods + Warenort + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPLOCATIONOFGOODS + MIC_EINPOS + EFPLOCATIONOFGOODS + + + + + + + + + + + + + Contingent Number + Kontingentnummer + + + false + String1..8 + + MIC_ALL_EAVPOS + EAPKONTGT + MIC_EINPOS + EFPKONTGT + + + + + + + + + + + + + Contingent Key + Schlüssel des Kontingents + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKKA2 + MIC_EINBPARA + EFAKKA2 + + + + + + + + + + + + + Contingent Quantity + Begünstigungsmenge + + + false + Decimal(38,0) + + MIC_ALL_EAVPOS + EAPEFABEGMENGE + MIC_EINBPARA + EFABEGMENGE + + + + + + + + + + + + + + Contingent Quantity UoM + Mengeneinheit der Begünstigungsmenge + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFABEGMEH + MIC_EINBPARA + EFABEGMEH + + + + + + + + + + + + + Contingent Quantity Qualifier + Qualifikator der Begünstigungsmenge + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFABEGMEHQ + MIC_EINBPARA + EFABEGMEHQ + + + + + + + + + + + + + Import Customs Procedure + Zollverfahren + + + false + String1..6 + + MIC_ALL_EAVPOS + EAPEVCASE + MIC_EINPOS + EFPEVCASE + + + + + + + + + + + + + The statistical code of the customs procedure. + Einfuhr Verfahrenscode + + + false + String1..6 + + MIC_ALL_EAVPOS + EAPEVKZ + MIC_EINPOS + EFPEVKZ + + + + + + + + + + + + + Special Use + Besondere Verwendung + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPBESVERWKZ + MIC_EINPOS + EFPBESVERWKZ + + + + + + + + + + + + + Nature of Transaction + Geschäftsart + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPGSART + MIC_EINPOS + EFPGSART + + + + + + + + + + + + + Valuation Method + B.M.Code + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPBMCODE + MIC_EINPOS + EFPBMCODE + + + + + + + + + + + + + + Additonal Code 1, Additonal Code 2, Additonal Code 3 + Zusatzcode 1, Zusatzcode 2, Zusatzcode 3 + + + false + String1..4 + 0-3 + MIC_ALL_EAVPOS + EAPZUSCD1, EAPZUSCD2, EAPZUSCD3 + MIC_EINPOS + EFPZUSCD1, EFPZUSCD2, EFPZUSCD3 + + + + + + + + + + + + + PAC/The preference request code that indicates if a preferential duty rate should be applied. + Beantragte Begünstigung + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPPAC + MIC_EINPOS + EFPPAC + + + + + + + + + + + + + Documents + Unterlagen + + + false + + 1-n + + + + + + + + + + + + Invoice line previous documents + Positionsvorpapiere + + + false + + 1-n + + + + + + + + + + + + Bill of material + + + + false + + + + + + + + + + + + + + Stock Type 1/The stock type for duty regimes with additions to the inventory. + Bestandsart 1 + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPBESTART1 + MIC_EINPOS + EFPBESTART1 + + + + + + + + + + + + + Stock Type 2/The stock type for duty regimes with additions to the inventory. + Bestandsart 2 + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPBESTART2 + MIC_EINPOS + EFPBESTART2 + + + + + + + + + + + + + Expiry date/date on which the stock expires + Ablaufdatum + + + false + Date + + MIC_ALL_EAVPOS + EAPSTOCKEXPDAT + MIC_EINPOS + EFPSTOCKEXPDAT + + + + + + + + Package + + + + false + + + + + + + + + + + + + + Account/The account number for the transaction. + Konto + + + false + String1..50 + + MIC_ALL_EAVPOS + EAPKONTO + MIC_EINPOS + EFPKONTO + + + + + + + + + + + + + Del. Note Number + Lieferscheinnr. + + + false + String1..15 + + MIC_ALL_EAVPOS + EAPLSNR + MIC_EINPOS + EFPLSNR + + + + + + + + + + + + + Order Note Number + Bestellschein. + + + false + String1..22 + + MIC_ALL_EAVPOS + EAPBSNR + MIC_EINPOS + EFPBSNR + + + + + + + + + + + + + Order Positoin + Bestellposition. + + + false + Long 5 + + MIC_ALL_EAVPOS + EAPORDERPOSITION + MIC_EINPOS + EFPORDERPOSITION + + + + + + + + + + + + + + Receipt + + + + false + + + + + + + + + + + + + + ASN Number/Advanced shipping notice Number(ASN). + Lieferantragsnummer. + + + false + String1..30 + + MIC_ALL_EAVPOS + EAPLANR + MIC_EINPOS + EFPLANR + + + + + + + + + + + + + Reference Value/The reference value. This can be used to store the invoice line value in original currency. + Referenzwert. + + + false + Decimal(18,6) + + MIC_ALL_EAVPOS + EAPREFWERT + MIC_EINPOS + EFPREFWERT + + + + + + + + + + + + + + Reference Currency + Referenzwährung. + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPREFWAE + MIC_EINPOS + EFPREFWAE + + + + + + + + + + + + + Remarks + Zusätzliche Angaben. + + + false + String1..80 + + MIC_ALL_EAVPOS + EAPINFO + MIC_EINPOS + EFPINFO + + + + + + + + + + + + + Remarks + Zusätzliche Angaben. + + + false + String1..80 + + MIC_ALL_EAVPOS + EAPINFO2 + MIC_EINPOS + EFPINFO + + + + + + + + + + + + + Registration numbers + + + + false + + + + + + + + + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + + + + + + + + + + + + Invoice line attributes + Positionsattribute + + + false + + 1-n + + + + + + + + + + + + Invoice line containers + Positionscontainer + + + false + + + + + + + + + + + + + + Invoice line business partner + Positionsgeschäftspartner + + + false + + 1-n + + + + + + + + + + + + Calculated values - calculated by external system + + + + false + + + + + + + + + + + + + + Custom relevant values in MIC + + + + false + + + + + + + + + + + + + + Duties - calculated by external system + + + + false + + 0-n + + + + + + + + + + + + Duties - calculated by MIC and customs FT (MIC_EINABG) AV (MIC_EAVABG) + + + + false + + 0-n + + + + + + + + + + + + Duties - calculated by MIC and customs FT (MIC_EINABG) AV (MIC_EAVABG) + + + + false + + 0-n + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + Additional import line parameters (mic_einbpara fields) + Zusätzliche Zeilenparameter (mic_einbpara Felder) + + + false + + + + + + + + + + + + + + SID + Nachrichten-SID + + + false + Decimal(10) + + MIC_ALL_EAVPOS + EAPSID + MIC_EINPOS + EFPSID + + + + + + + + + + + + + External processing + Externe Verarbeitung + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEXTERNALPROCESSING + MIC_EINPOS + EFPEXTERNALPROCESSING + + + + + + + + + + + + + Invoice line additional information + Zusätzliche Information auf Positionsebene + + + false + + 1-n + + + + + + + + + + + + Intrastat information on line level + Intrastatdaten auf Positionsebene + + + + + + + Pre-Supplier + Vorveredler + + + false + + + + + + + + + + + + + + UCR + UCR + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPSDGKENNNR + MIC_EINPOS + EFPSDGKENNNR + + + + + + + + + + + + + CUS code + CUS code + + + false + String1..9 + + MIC_ALL_EAVPOS + EAPCUSCODE + MIC_EINPOS + EFPCUSCODE + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_ALL_EAVPOS + EAPCREUSER + MIC_EINPOS + EFPCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPCREDAT + MIC_EINPOS + EFPCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_ALL_EAVPOS + EAPUSE + MIC_EINPOS + EFPUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPUSEDAT + MIC_EINPOS + EFPUSEDAT + + + + + + + + Valuation Indicators + Bewertungskennzeichen + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPVALUATIONINDICATOR + MIC_EINPOS + EFPVALUATIONINDICATOR + + + + + + + + + + + Tracking Number + Nachverfolgungsnummer + + + false + String1..50 + + MIC_ALL_EAVPOS + EAPTRACKINGNUMBER + MIC_EINPOS + EFPTRACKINGNUMBER + + + + + + + + + + + + + + Invoice line previous document references + Positionsbeendigungsanteile Vorpapiere + + + + + + + Invoice line packages + Positionspackstücke + + + false + + 0-n + + + + + + + + + + + + + + + + false + + 0-n + + + + + + + + + + + + Acceptance Date + Datum der Annahme (ZiA) + + + false + xs:date + + + + MIC_EINPOS + EFPANNAHMEDAT + + + + + + + + Cert Origin not required flag. + Einfuhrerl. + + + false + Boolean + + MIC_ALL_EAVPOS + EAPNOZEUGKZ + MIC_EINPOS + EFPNOZEUGKZ + + + + + + + + Manual Contribution + Manueller Beistellwert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPBEISTELLWERT + MIC_EINPOS + EFPBEISTELLWERT + + + + + + + + + + + + + + Manual Contribution Currency + Währung Manueller Beistellwert + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPBEISTELLWAER + MIC_EINPOS + EFPBEISTELLWAER + + + + + + + + + + + + + + EUDR + false + 0..1 + + + + + + + + EUDR Supplier Number + EUDR Lieferant + false + String1..30 + mic_eavpos + eapeudrnr + mic_einpos + efpeudrnr + + + + + + + EUDR Country + EUDR Land + false + String1..3 + mic_eavpos + eapeudrctryofprod + mic_einpos + efpeudrctryofprod + + + + + + + + + + + + + + External Customs Value + Externer Zollwert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPCUSTOMSVALUE_EXT + MIC_EINPOS + EFPCUSTOMSVALUE_EXT + + + + + + + + + + + + + + External Net Value + Externer Nettowert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPNETVALUE_EXT + MIC_EINPOS + EFPNETVALUE_EXT + + + + + + + + + + + + + + External Net Value + Externer Nettowert + + + false + Decimal(16,4) + + MIC_EINPOS + EFPCALCSTATWERT + MIC_EINPOS + EFPCALCSTATWERT + + + + + + + + + + + + + + External Freight Statistical Value + Externer statistischer Wert für Fracht + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFREIGHTSTATVAL_EXT + MIC_EINPOS + EFPFREIGHTSTATVAL_EXT + + + + + + + + + + + + + + External Freight International + Externe internationale Fracht + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFREIGHTINTERNATIONAL_EXT + MIC_EINPOS + EFPFREIGHTINTERNATIONAL_EXT + + + + + + + + + + + + + + External Freight Community + Externe Fracht Gemeinschaft + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFREIGHTEU_EXT + MIC_EINPOS + EFPFREIGHTEU_EXT + + + + + + + + + + + + + + External Freight National + Externe nationale Fracht + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFREIGHTNATIONAL_EXT + MIC_EINPOS + EFPFREIGHTNATIONAL_EXT + + + + + + + + + + + + + + External Insurance + Externe Versicherung + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPINSURANCE_EXT + MIC_EINPOS + EFPINSURANCE_EXT + + + + + + + + + + + + + + External Insurance + Externe Versicherung + + + false + Decimal(16,4) + 0-2 + MIC_ALL_EAVPOS + EAPSHIPADDCOSTS1/2_EXT + MIC_EINPOS + EFPSHIPADDCOSTS1/2_EXT + + + + + + + + + + + + + + External Insurance + Externe Versicherung + + + false + Decimal(16,4) + 0-2 + MIC_ALL_EAVPOS + EAPINVADDCOSTS1/2_EXT + MIC_EINPOS + EFPINVADDCOSTS1/2_EXT + + + + + + + + + + + + + + External Insurance + Externe Versicherung + + + false + Decimal(16,4) + 0-8 + MIC_ALL_EAVPOS + EAPLINEADDCOSTS1/8_EXT + MIC_EINPOS + EFPLINEADDCOSTS1/8_EXT + + + + + + + + + + + + + + External Cust Value + Externer Cust Value + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPCUSTVALUE_EXT + MIC_EINPOS + EFPCUSTVALUE_EXT + + + + + + + + + + + + + + External Assist Value + Externer Beistellwert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPASSISTVALUE_EXT + MIC_EINPOS + EFPASSISTVALUE_EXT + + + + + + + + + + + + + + External VAT Additional Costs + Externe UST Nebenkosten + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPVATADDCOSTS_EXT + MIC_EINPOS + EFPVATADDCOSTS_EXT + + + + + + + + + + + + + + + + + + Customs value + Externe UST Nebenkosten + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPGRWERT + MIC_EINPOS + EFPGRWERT + + + + + + + + + + + + + + Net Value + Externe UST Nebenkosten + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPWERTNTO + + + + + + + + + + + + + + Additional statistical value + Zuschlag stat. Wert + + + false + Decimal(17,4) + + + + MIC_EINPOS + EFPADDITIONALSTATISTICALVALUE + + + + + + + + + + + + + + Additoinal cost VAT + Zuschlag EUSt. + + + false + Decimal(17,4) + + + + MIC_EINPOS + EFPZUEUST + + + + + + + + + + + + + + Customs value added + Grenzwert Zu/Ab + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPGRWERTZUAB1 + + + + + + + + + + + + + + EU Costs + EU-Kosten + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPFRAEU + + + + + + + + + + + + + + Non EU Costs + Kosten ausserhalb der EU + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPFRANONEU + + + + + + + + + + + + + + OPR ingredients value + Beistellwert + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBEISTELL + + + + + + + + + + + + + + Additional costs 1 + Fracht f. Grenzw. + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB1 + + + + + + + + + + + + + + Additional costs 2 + Versicherung + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB2 + + + + + + + + + + + + + + Additional costs 3 + Sdg. Nebenk. 1 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB3 + + + + + + + + + + + + + + Additional costs 4 + Sdg. Nebenk. 2 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB4 + + + + + + + + + + + + + + Additional costs 5 + Fakt. Nebenk. 1 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB5 + + + + + + + + + + + + + + Additional costs 6 + Fakt. Nebenk. 2 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB6 + + + + + + + + + + + + + + Additional costs 7 + Pos. Nebenk. 1 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB7 + + + + + + + + + + + + + + Additional costs 8 + Pos. Nebenk. 2 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB8 + + + + + + + + + + + + + + Additional costs 9 + Pos. Nebenk. 3 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB9 + + + + + + + + + + + + + + Additional costs 10 + Pos. Nebenk. 4 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB10 + + + + + + + + + + + + + + Additional costs 11 + Pos. Nebenk. 5 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB11 + + + + + + + + + + + + + + Additional costs 12 + Pos. Nebenk. 6 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB12 + + + + + + + + + + + + + + Additional costs 13 + Pos. Nebenk. 7 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB13 + + + + + + + + + + + + + + Additional costs 14 + Pos. Nebenk. 8 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB14 + + + + + + + + + + + + + + Additional costs 15 + Pos. Nebenk. 9 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB15 + + + + + + + + + + + + + + Additional costs 16 + Pos. Nebenk. 10 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB16 + + + + + + + + + + + + + + Additional costs 17 + Pos. Nebenk. 11 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB17 + + + + + + + + + + + + + + Additional costs 18 + Pos. Nebenk. 12 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB18 + + + + + + + + + + + + + + Additional costs 19 + Pos. Nebenk. 13 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB19 + + + + + + + + + + + + + + Additional costs 20 + Pos. Nebenk. 14 + + + false + Decimal(16,4) + + + + MIC_EINPOS + EFPBZUAB20 + + + + + + + + + + + + + + + Additional parameters (generic) + + + + + Key + + + + + Value + + + + + + + This element allows to send attached documents. The format allows to send multiple files in one message + + + + + This entity allows to send attachments, e.g. pdf, jpg, xml, or other binary formats + + + + Attachment (eg. pdf, xml, EDIFACT) + + + + + description of attachment + + + + + Attached file in base64 binary encoding + + + + + Additional parameters as key-value pairs + + + + + + + + + + Description of attachement eg. Name of file, creation date/time etc. + + + + + Mime type of attached document + + + + + + + + + + Creation timestamp of the attached document + + + + + Creation user of the attached document + + + + + + + + + + + + Generic message detail + + + + + Mode of transportation information + + + + + + Mode of transportation + Art des Verkehrszweigs + String1..2 + + + + + + + + + + + + + Means of transport + Art des aktiven Beförderungsmittels + String1..2 + + + + + + + + + + + + Means of transportation country + Staatszugehörigkeit des Beförderungsmittels + String1..3 + + + + + + + + + + + + Means of transportation vehicle + Kennzeichen des Beförderungsmittels + String1..30 + + + + + + + + + + + + Mode of Transfer Name + Name Verkehrsmittel + String1..100 + + + + + + + + + + + + Means of transportation description + Beschreibung des Beförderungsmittels + String1..17 + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + Tariff Number + Tarifnummer + + + true + String1..13 + + MIC_ALL_EAVPOS + EAPTARNR + MIC_EINPOS + EFPTARNR + + + + + + + + + + + + + + VAT code + Einfuhrumsatzsteuercode + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEUSTCD + MIC_EINPOS + EFPEUSTCD + + + + + + + + + + + + + + Excise tax code + Verbrauchssteuercode + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPVSTCD + MIC_EINPOS + EFPVSTCD + + + + + + + + + + + + + + + License on import invoice line. + + + + + + License type. + Typ der Menge / Wert + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEGART + MIC_EINPOS + EFPEGART + + + + + + + + + + + + + + License code. + Einfuhrrechtliches Papier + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEGEAW + MIC_EINPOS + EFPEGEAW + + + + + + + + + + + + + + License number. + Nummer + + + false + String1..16 + + MIC_ALL_EAVPOS + EAPEGNR + MIC_EINPOS + EFPEGNR + + + + + + + + + + + + + + License date. + Datum + + + false + xs:date + + MIC_ALL_EAVPOS + EAPEGDAT + MIC_EINPOS + EFPEGDAT + + + + + + + + License not required flag. If used the other fields are not needed. + Einfuhrerl. nicht benötigt + + + false + Boolean + + MIC_ALL_EAVPOS + EAPNOEGKZ + MIC_EINPOS + EFPNOEGKZ + + + + + + + + + + Pricing information to document how the invoice line was priced + + + + false + + + + + + + + + + + + + + The pricing type + Preistyp + + + false + String1..10 + + MIC_ALL_EAVPOS + EAPPREISTYP + MIC_EINPOS + EFPPREISTYP + + + + + + + + + + + + + The pricing reference, e.g. the contract number. + Preisreferenz + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPPREISREFNO + MIC_EINPOS + EFPPREISREFNO + + + + + + + + + + + + + The pricing date. + Preidatum + + + false + xs:date + + MIC_ALL_EAVPOS + EAPPREISDAT + MIC_EINPOS + EFPPREISDAT + + + + + + + + The pricing system, e.g. SAP. + Preissystem + + + false + String1..10 + + MIC_ALL_EAVPOS + EAPPREISSYS + MIC_EINPOS + EFPPREISSYS + + + + + + + + + + + + + + + Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + false + + + + + + + + + + + + + + Freight cost amount. + Frachtkosten + + + true + Decimal(17,4) + + MIC_EAVSDG + EASFRAWRT + MIC_EINSDG + EFSFRAWRT + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_EAVSDG + EASFRAWAE + MIC_EINSDG + EFSFRAWAE + + + + + + + + + + + + + + Freight International/(Percentage OR Value) of international freight costs of total freight costs. + Frachtkosten International + + + false + Decimal(5,2) + + MIC_EAVSDG + EASNONEU + MIC_EINSDG + EFSNONEU + + + + + + + + + + + + + + Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. + Frachtkosten EU + + + false + Decimal(5,2) + + MIC_EAVSDG + EASEUNAT + MIC_EINSDG + EFSEUNAT + + + + + + + + + + + + + + Freight National/(Percentage OR Value) of inland freight of total freight costs. + Frachtkosten National + + + false + Decimal(5,2) + + MIC_EAVSDG + EASNAT + MIC_EINSDG + EFSNAT + + + + + + + + + + + + + + Calculation Type of Freight Costs/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. + Berechnungsart der Frachtkosten + + + false + String1..1 + + MIC_EAVSDG + EASFRAKZ + MIC_EINSDG + EFSFRAKZ + + + + + + + + + + + + + Absolute international freight cost amount + Frachtwert + + + true + Decimal(17,4) + + MIC_EAVSDG + EASABSNONEUFREIGHT + MIC_EINSDG + EFSFRAWRTNONEUABS + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_EAVSDG + EASABSNONEUFREIGHTCURRENCY + MIC_EINSDG + EFSFRAWAENONEUABS + + + + + + + + + + + + + + Absolute community freight cost amount + Frachtwert + + + true + Decimal(17,4) + + MIC_EAVSDG + EASABSEUFREIGHT + MIC_EINSDG + EFSFRAWRTNEUABS + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_EAVSDG + EASABSEUFREIGHTCURRENCY + MIC_EINSDG + EFSFRAWAENEUABS + + + + + + + + + + + + + + Absolute national freight cost amount + Frachtwert + + + true + Decimal(17,4) + + MIC_EAVSDG + EASABSNATFREIGHT + MIC_EINSDG + EFSFRAWRTNATABS + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_EAVSDG + EASABSNATFREIGHTCURRENCY + MIC_EINSDG + EFSFRAWAENATABS + + + + + + + + + + + + + + + + Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + + + Freight Costs + Frachtkosten + + + true + Decimal(16,4) + + MIC_ALL_EAVKOP + EAKFRAWRT + MIC_EINKOP + EFKFRAWRT + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_ALL_EAVKOP + EAKFRAWAE + MIC_EINKOP + EFKFRAWAE + + + + + + + + + + + + + + Freight International/(Percentage OR Value) of international freight costs of total freight costs. + Frachtkosten International + + + false + Decimal(5,2) + + MIC_ALL_EAVKOP + EAKFRANONEU + MIC_EINKOP + EFKFRANONEU + + + + + + + + + + + + + + Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. + Frachtkosten EU + + + false + Decimal(5,2) + + MIC_ALL_EAVKOP + EAKFRAEUNAT + MIC_EINKOP + EFKFRAEUNAT + + + + + + + + + + + + + + Freight National/(Percentage OR Value) of inland freight of total freight costs. + Frachtkosten National + + + false + Decimal(5,2) + + MIC_ALL_EAVKOP + EAKNAT + MIC_EINKOP + EFKNAT + + + + + + + + + + + + + + Calculation Type of Freight Costs/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. + Berechnungsart der Frachtkosten + + + false + String1..1 + + MIC_ALL_EAVKOP + EAKFRAKZ + MIC_EINKOP + EFKFRAKZ + + + + + + + + + + + + + + Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + + + Freight Costs + Frachtkosten + + + true + Decimal(17,4) + + MIC_ALL_EAVPOS + EAPFAMOUNT + MIC_EINPOS + EFPFAMOUNT + + + + + + + + + + + + + + Currency Freight Costs + Währung Frachtkosten + + + true + String1..3 + + MIC_ALL_EAVPOS + EAPFWAE + MIC_EINPOS + EFPFWAE + + + + + + + + + + + + + + Freight International/(Percentage OR Value) of international freight costs of total freight costs. + Frachtkosten International + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFNONEU + MIC_EINPOS + EFPFNONEU + + + + + + + + + + + + + + Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. + Frachtkosten EU + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFEU + MIC_EINPOS + EFPFEU + + + + + + + + + + + + + + Freight National/(Percentage OR Value) of inland freight of total freight costs. + Frachtkosten National + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPFNAT + MIC_EINPOS + EFPFNAT + + + + + + + + + + + + + + + Attribut from FreightCosts, P Percentage OR V Value, decides in which form the Freightcosts would be split. + + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPFFLAG + MIC_EINPOS + FIX VALUE "V" + + + + + + + + + + + + + Intra specific fields. + + + + + + Vendor VAT ID + Umsatzsteuernummer des Lieferanten + + + false + String1..20 + + EAVKOP + EAKVATNR + + + + + + + + + + + + + + + Statistical procedure + Statistisches Verfahren + + + false + String1..5 + + EAVKOP + EAKCCTR + + + + + + + + + + + + + + + Internal reference + Interne Referenz + + + false + String1..30 + + EAVKOP + EAKREFI + + + + + + + + + + + + + + + + Intra specific fields. + + + + + + Status + Status + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPSTATUS + + + + + + + + + + + + + + + Invoice date + Rechnungsdatum + + + false + xs:date + + MIC_ALL_EAVPOS + EAPDATUM + + + + + + + + + + Period + Periode + + + false + Long 6 + + MIC_ALL_EAVPOS + EAPPERIODE + + + + + + + + + + + + + + + + Region + Region + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPREGION + + + + + + + + + + + + + + + Statistical procedure + Statistisches Verfahren + + + false + String1..5 + + MIC_ALL_EAVPOS + EAPCCTR + + + + + + + + + + + + + + + Statistical value + Statistischer Wert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPGRWERT + + + + + + + + + + + + + + + + Additional costs currency 1 + Nebenkostenwährung 1 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPPBK1WAE + + + + + + + + + + + + + + + Additional costs type 1 + Nebenkostenart 1 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPPBK1TYP + + + + + + + + + + + + + + + Additional costs currency 2 + Nebenkostenwährung 2 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPPBK2WAE + + + + + + + + + + + + + + + Additional costs type 2 + Nebenkostenart 2 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPPBK2TYP + + + + + + + + + + + + + + + + Fields for pre-supplier. + + + + + + INF Duty Value + INF Zollwert + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPINFZOBAS + + + + + + + + + + + + + + + + INF Duty Rate + INF Zollsatz + + + false + Decimal(6,3) + + MIC_ALL_EAVPOS + EAPINFZOBET1 + + + + + + + + + + + + + + + + INF Duty + INF Abgabe + + + false + Decimal(16,4) + + MIC_ALL_EAVPOS + EAPINFZO + + + + + + + + + + + + + + + + INF Duty Currency + INF Abgabenwährung + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPINFZOW + + + + + + + + + + + + + + + + Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + + + Insurance Costs + Versicherungskosten + + + true + Decimal(19,6) + + MIC_EAVSDG + EASVERSWRT + MIC_EINSDG + EFSVERSWRT + + + + + + + + + + + + + + Currency Insurance + Währung Versicherungskosten + + + true + String1..3 + + MIC_EAVSDG + EASVERSWAE + MIC_EINSDG + EFSVERSWAE + + + + + + + + + + + + + + Calculation Type of Insurance + Berechnungsart der Versicherung + + + false + String1..1 + + MIC_EAVSDG + EASVERSKZ + MIC_EINSDG + EFSVERSKZ + + + + + + + + + + + + + + Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + + + Insurance Costs + Versicherungskosten + + + true + Decimal(19,6) + + MIC_ALL_EAVKOP + EAKVERSWRT + MIC_EINKOP + EFKVERSWRT + + + + + + + + + + + + + + Currency Insurance + Währung Versicherungskosten + + + true + String1..3 + + MIC_ALL_EAVKOP + EAKVERSWAE + MIC_EINKOP + EFKVERSWAE + + + + + + + + + + + + + + Calculation Type of Insurance + Berechnungsart der Versicherung + + + false + String1..1 + + MIC_ALL_EAVKOP + EAKVERSKZ + MIC_EINKOP + EFKVERSKZ + + + + + + + + + + + + + + Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. + + + + + + Insurance Costs + Versicherungskosten + + + true + Decimal(17,4) + + MIC_ALL_EAVPOS + EAPVERSWERT + MIC_EINPOS + EFPVERSWERT + + + + + + + + + + + + + + Currency Insurance + Währung Versicherungskosten + + + true + String1..3 + + MIC_ALL_EAVPOS + EAPVERSWAE + MIC_EINPOS + EFPVERSWAE + + + + + + + + + + + + + + + Rebates can be added on invoice level . They are pro-rated to the invoice lines as indicated. + + + + + + Discount + Rabatt + + + true + Decimal(17,4) + + MIC_ALL_EAVKOP + EAKRABATTWERT + MIC_EINKOP + EFKRABATTWERT + + + + + + + + + + + + + + Currency Discount/ISO currency code + Währung Rabatt + + + true + String1..3 + + MIC_ALL_EAVKOP + EAKRABATTWAE + MIC_EINKOP + EFKRABATTWAE + + + + + + + + + + + + + + Calculation Type of Discount/Indicator for how the rebate is pro-rated to the invoice lines. V=value based, Q=quantity based. + Berechnungsart Rabatt + + + false + String1..1 + + MIC_ALL_EAVKOP + EAKRABATTKZ + MIC_EINKOP + EFKRABATTKZ + + + + + + + + + + + + + + Rebates can be added on invoice level . They are pro-rated to the invoice lines as indicated. + + + + + + Discount + Rabatt + + + true + Decimal(17,4) + + MIC_ALL_EAVPOS + EAPRABATTWERT + MIC_EINPOS + EFPRABATTWERT + + + + + + + + + + + + + + Currency Discount + Währung Rabatt + + + true + String1..3 + + MIC_ALL_EAVPOS + EAPRABATTWAE + MIC_EINPOS + EFPRABATTWAE + + + + + + + + + + + + + + + + Addition IVAT/AdditionalCostsVAT can be added on invoice level + Zuschlag EUSt. + + + false + + + + + + + + + + + + + + Manual Addition IVAT + Manueller Zuschlag EUSt. + + + true + Decimal(17,4) + + MIC_ALL_EAVPOS + EAPMANZUEUST + MIC_EINPOS + EFPMANZUEUST + + + + + + + + + + + + + + Currency Manual Addition IVAT + Währung Manueller Zuschlag EUSt. + + + true + String1..3 + + MIC_ALL_EAVPOS + EAPMANZUEUSTWAE + MIC_EINPOS + EFPMANZUEUSTWAE + + + + + + + + + + + + + + + + Additional costs can be added on all levels as additional part value components. They are pro-rated to the invoice lines as indicated. + + + + false + + 0-2 + + + + + + + + + + + + Add. Costs Type 1, Add. Costs Type 2/Additional cost type. The type is a description like ASSIST, REBATE, etc. + Art der Nebenkosten1, Art der Nebenkosten 2 + + + true + String1..10 + + + ___ABART1, ___ABART2 + + ___ABART1, ___ABART2 + + + + + + + + + + + + + + Value Additional Costs 1, Value Additional Costs 2/Additional cost amount. (negative amounts are possible for deductions). + Wert der Nebenkosten 1, Wert der Nebenkosten 2 + + + true + Decimal(17,4) + + + ___ABWRT1, ___ABWRT2 + + ___ABWRT1, ___ABWRT2 + + + + + + + + + + + + + + Currency Additional Costs 1,Currency Additional Costs 1/Iso currency code. + Währung Nebenkosten 1, Währung Nebenkosten 2 + + + true + String1..3 + + + ___ABWAE1, ___ABWAE2 + + ___ABWAE1, ___ABWAE2 + + + + + + + + + + + + + + Calculation Type of Insurance/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. + Berechnungsart der Versicherung + + + false + String1..1 + + + ___VERSKZ + + ___VERSKZ + + + + + + + + + + + + + + + + + + Additional cost type. The type is a description like ASSIST, REBATE, etc. + + + + true + String1..10 + + + ___ABART1 - ___ABART14 + + ___ABART1 - ___ABART14 + + + + + + + + + + + + + + Additional cost amount. (negative amounts are possible for deductions). + + + + true + Decimal(17,4) + + + ___ABWRT1 - ___ABWRT14 + + ___ABWRT1 - ___ABWRT14 + + + + + + + + + + + + + + Iso currency code. + + + + true + String1..3 + + + ___ABWAE1 - ___ABWAE14 + + ___ABWAE1 - ___ABWAE14 + + + + + + + + + + + + + + Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. + + + + false + String1..1 + + + ___ABKZ1 - ___ABKZ14 + + ___ABKZ1 - ___ABKZ14 + + + + + + + + + + + + + + + Additional attributes can be used to add customer specific fields to the module as customization. + + + + + + Attribute + Attribut + + + + + + + + + Attribute + Attribut + + + + + + + Attribute type + Adresstyp + + + true + String1..20 + + MIC_AVATTRIBUTE + AVATYP + MIC_ATTRIBUTE + ATRTYP + + + + + + + + + + + + + + Attribute text + Text + + + true + String1..2000 + + MIC_AVATTRIBUTE + AVATEXT + MIC_ATTRIBUTE + ATRTEXT + + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_AVATTRIBUTE + AVACREUSER + MIC_ATTRIBUTE + ATRCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_AVATTRIBUTE + AVACREDAT + MIC_ATTRIBUTE + ATRCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_AVATTRIBUTE + AVAUSER + MIC_ATTRIBUTE + ATRUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_AVATTRIBUTE + AVAUSEDAT + MIC_ATTRIBUTE + ATRUSEDAT + + + + + + + + + Business partner information + + + + + + Business partner + Geschäftspartner + + + true + + + + + MIC_CUST_PARTNER + + + + + + + + + + Partner as address number, type and optional address details + + + + + + Address type + Adresstyp + + + true + String1..2 + + MIC_CUST_AVPARTNER + AVPTYP + MIC_CUST_PARTNER + PARTYP + + + + + + + + + + + + + + Address details + Adressdetails + + + true + + + MIC_CUST_AVPARTNER + addrNo:AVPNR, addrNoType:AVPNRTYP, addrName:AVPNAME1,AVPNAME2, addrStreet:AVPSTR1, addrLoc:AVPORT, addrCtry:AVPLD, addrState:AVPREGION, addrZip:AVPPLZ, addrTin:AVPTIN, addrEori:AVPEORI, partnerRelation:AVPKVB, addrDistrict:AVPORTSTEIL, addrBranchNo:AVPBRANCHNO, email:AVPSACHMAIL, addrVatNumber:AVPVATNUMBER + MIC_CUST_PARTNER + addrNo:PARNR, addrNoType:PARNRTYP, addrName:PARNAME1,PARNAME2, addrStreet:PARSTR1, addrLoc:PARORT, addrCtry:PARLD, addrState:PARREGION, addrZip:PARPLZ, addrTin:PARTIN, addrEori:PAREORI, partnerRelation:PARKVB, addrDistrict:PARORTSTEIL, addrBranchNo:PARBRANCHNO, email:PARSACHMAIL, addrVatNumber:PARVATNUMBER + + + + + + + + Related party indicator + Verbundenheit + + + false + String1..1 + + MIC_CUST_AVPARTNER + AVPKVB + MIC_CUST_PARTNER + PARKVB + + + + + + + + + + + + + Additional information + Zusätzliche Angaben + + + false + String1..50 + + MIC_CUST_AVPARTNER + AVPINFO + MIC_CUST_PARTNER + PARINFO + + + + + + + + + + + + + Contact Phone Number + Kontakt Telefonnummer + + + false + String1..40 + + MIC_CUST_AVPARTNER + AVPTELNR + MIC_CUST_PARTNER + PARTELNR + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_CUST_AVPARTNER + AVPCREUSER + MIC_CUST_PARTNER + PARCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_CUST_AVPARTNER + AVPCREDAT + MIC_CUST_PARTNER + PARCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_CUST_AVPARTNER + AVPUSEDAT + MIC_CUST_PARTNER + PARUSEDAT + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_AVPARTNER + AVPUSER + MIC_CUST_PARTNER + PARUSER + + + + + + + + Partner role + Partnerrolle + + + false + String1..3 + + MIC_CUST_AVPARTNER + AVPROLE + MIC_CUST_PARTNER + PARROLE + + + + + + + + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + MIC_CUST_AVPARTNER + avp___ + MIC_CUST_PARTNER + PAR___ + + + + + + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + + + + + + + + + + + + Customer text field 1 + Kundenspezifisches Textfeld 1 + + + false + String1..400 + + + ___TEXT1 + + ___TEXT1 + ABC + + + + + + + Customer text field 2 + Kundenspezifisches Textfeld 2 + + + false + String1..400 + + + ___TEXT2 + + ___TEXT2 + ABC + + + + + + + Customer text field 3 + Kundenspezifisches Textfeld 3 + + + false + String1..400 + + + ___TEXT3 + + ___TEXT3 + ABC + + + + + + + Customer text field 4 + Kundenspezifisches Textfeld 4 + + + false + String1..400 + + + ___TEXT4 + + ___TEXT4 + ABC + + + + + + + Customer text field 5 + Kundenspezifisches Textfeld 5 + + + false + String1..400 + + + ___TEXT5 + + ___TEXT5 + ABC + + + + + + + Customer text field 6 + Kundenspezifisches Textfeld 6 + + + false + String1..400 + + + ___TEXT6 + + ___TEXT6 + ABC + + + + + + + Customer text field 7 + Kundenspezifisches Textfeld 7 + + + false + String1..400 + + + ___TEXT7 + + ___TEXT7 + ABC + + + + + + + Customer text field 8 + Kundenspezifisches Textfeld 8 + + + false + String1..400 + + + ___TEXT8 + + ___TEXT8 + ABC + + + + + + + Customer text field 9 + Kundenspezifisches Textfeld 9 + + + false + String1..400 + + + ___TEXT9 + + ___TEXT9 + ABC + + + + + + + Customer text field 10 + Kundenspezifisches Textfeld 10 + + + false + String1..400 + + + ___TEXT10 + + ___TEXT10 + ABC + + + + + + + Customer date 1 + Kundenspezifisches Datumsfeld 1 + + + false + Xs:datetime + + + ___DATE1 + + ___DATE1 + 01.01.2010 + + + + + + + + + + Customer date 2 + Kundenspezifisches Datumsfeld 2 + + + false + Xs:datetime + + + ___DATE2 + + ___DATE2 + 01.01.2010 + + + + + + + + + + Customer date 3 + Kundenspezifisches Datumsfeld 3 + + + false + Xs:datetime + + + ___DATE3 + + ___DATE3 + 01.01.2010 + + + + + + + + + + Customer date 4 + Kundenspezifisches Datumsfeld 4 + + + false + Xs:datetime + + + ___DATE4 + + ___DATE4 + 01.01.2010 + + + + + + + + + + Customer date 5 + Kundenspezifisches Datumsfeld 5 + + + false + Xs:datetime + + + ___DATE5 + + ___DATE5 + 01.01.2010 + + + + + + + + + + Customer date 6 + Kundenspezifisches Datumsfeld 6 + + + false + Xs:datetime + + + ___DATE6 + + ___DATE6 + 01.01.2010 + + + + + + + + + + Customer date 7 + Kundenspezifisches Datumsfeld 7 + + + false + Xs:datetime + + + ___DATE7 + + ___DATE7 + 01.01.2010 + + + + + + + + + + Customer date 8 + Kundenspezifisches Datumsfeld 8 + + + false + Xs:datetime + + + ___DATE8 + + ___DATE8 + 01.01.2010 + + + + + + + + + + Customer date 9 + Kundenspezifisches Datumsfeld 9 + + + false + Xs:datetime + + + ___DATE9 + + ___DATE9 + 01.01.2010 + + + + + + + + + + Customer date 10 + Kundenspezifisches Datumsfeld 10 + + + false + Xs:datetime + + + ___DATE10 + + ___DATE10 + 01.01.2010 + + + + + + + + + + Customer flag 1 + Kundenspezifisches Ja/Nein Feld 1 + + + false + Boolean + + + ___FLAG1 + + ___FLAG1 + 0 + + + + + + + Customer flag 2 + Kundenspezifisches Ja/Nein Feld 2 + + + false + Boolean + + + ___FLAG2 + + ___FLAG2 + 0 + + + + + + + Customer flag 3 + Kundenspezifisches Ja/Nein Feld 3 + + + false + Boolean + + + ___FLAG3 + + ___FLAG3 + 0 + + + + + + + Customer flag 4 + Kundenspezifisches Ja/Nein Feld 4 + + + false + Boolean + + + ___FLAG4 + + ___FLAG4 + 0 + + + + + + + Customer flag 5 + Kundenspezifisches Ja/Nein Feld 5 + + + false + Boolean + + + ___FLAG5 + + ___FLAG5 + 0 + + + + + + + Customer flag 6 + Kundenspezifisches Ja/Nein Feld 6 + + + false + Boolean + + + ___FLAG6 + + ___FLAG6 + 0 + + + + + + + Customer flag 7 + Kundenspezifisches Ja/Nein Feld 7 + + + false + Boolean + + + ___FLAG7 + + ___FLAG7 + 0 + + + + + + + Customer flag 8 + Kundenspezifisches Ja/Nein Feld 8 + + + false + Boolean + + + ___FLAG8 + + ___FLAG8 + 0 + + + + + + + Customer flag 9 + Kundenspezifisches Ja/Nein Feld 9 + + + false + Boolean + + + ___FLAG9 + + ___FLAG9 + 0 + + + + + + + Customer flag 10 + Kundenspezifisches Ja/Nein Feld 10 + + + false + Boolean + + + ___FLAG10 + + ___FLAG10 + 0 + + + + + + + Customer number 1 + Kundenspezifisches Nummernfeld 1 + + + false + Number(15,4) + + + ___NUMBER1 + + ___NUMBER1 + 10 + + + + + + + Customer number 2 + Kundenspezifisches Nummernfeld 2 + + + false + Number(15,4) + + + ___NUMBER2 + + ___NUMBER2 + 10 + + + + + + + Customer number 3 + Kundenspezifisches Nummernfeld 3 + + + false + Number(15,4) + + + ___NUMBER3 + + ___NUMBER3 + 10 + + + + + + + Customer number 4 + Kundenspezifisches Nummernfeld 4 + + + false + Number(15,4) + + + ___NUMBER4 + + ___NUMBER4 + 10 + + + + + + + Customer number 5 + Kundenspezifisches Nummernfeld 5 + + + false + Number(15,4) + + + ___NUMBER5 + + ___NUMBER5 + 10 + + + + + + + Customer number 6 + Kundenspezifisches Nummernfeld 6 + + + false + Number(15,4) + + + ___NUMBER6 + + ___NUMBER6 + 10 + + + + + + + Customer number 7 + Kundenspezifisches Nummernfeld 7 + + + false + Number(15,4) + + + ___NUMBER7 + + ___NUMBER7 + 10 + + + + + + + Customer number 8 + Kundenspezifisches Nummernfeld 8 + + + false + Number(15,4) + + + ___NUMBER8 + + ___NUMBER8 + 10 + + + + + + + Customer number 9 + Kundenspezifisches Nummernfeld 9 + + + false + Number(15,4) + + + ___NUMBER9 + + ___NUMBER9 + 10 + + + + + + + Customer number 10 + Kundenspezifisches Nummernfeld 10 + + + false + Number(15,4) + + + ___NUMBER10 + + ___NUMBER10 + 10 + + + + + + + + Container + + + + + + This is not mapped for shipment. Container/Indicator whether this is a containerized shipment. 1=yes, 0=no. + Container + + + false + String1..1 + + + ___CON + + ___CON + + + + + + + + + + + + + Number of Containers + Containernummern + + + false + String1..20 + + + ___CONTNO + + ___CONTNR + + + + + + + + + + + + + Container type + Containertyp + + + false + String1..10 + + + ___CONTTYP + + ___REFTYP + + + + + + + + + + + + + This is not mapped for shipment. Container/Indicator whether this is a containerized shipment. 1=yes, 0=no. + Container + + + false + String1..1 + + + ___CONTLCL + + ___CONTLCL + + + + + + + + + + + + + + List of Detail container infos + + + + + + Container information + Containerdaten + + + true + + + + + MIC_CUST_CONT + + + + + + + + + + Detail container info + + + + + + Number of Containers + Containernummern + + + true + String1..17 + + MIC_CUST_AVCONT + COACONTNR + MIC_CUST_CONT + CONCONTNR + + + + + + + + + + + + + Number of seal container + Siegelnummer + + + true + String1..20 + + MIC_CUST_AVCONT + COASEALNR + MIC_CUST_CONT + CONSEALNR + + + + + + + + + + + + + Container packages + Anzahl Packstücke im Container + + + false + Decimal(6) + + not mapped + + + + + + + + + + + + + + + + + Container gross weight + Bruttogewicht ds Containers + + + false + Decimal(14,6) + + not mapped + + + + + + + + + + + + + + + + + Container net weight + Nettogewicht des Containers + + + false + Decimal(14,6) + + not mapped + + + + + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_CUST_AVCONT + COACREUSER + MIC_CUST_CONT + CONCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_CUST_AVCONT + COACREDAT + MIC_CUST_CONT + CONCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_CUST_AVCONT + COAUSER + MIC_CUST_CONT + CONUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_AVCONT + COAUSEDAT + MIC_CUST_CONT + CONUSEDAT + + + + + + + + + Address + + + + + + Address number + Adressnummer + String1..15 + + + + + + + + + + + + + Address number type + Adressnummerntyp + String1..10 + + + + + + + + + + + + Address name + Name + String1..40 + + + + + + + + + + Address street + Straße + String1..80 + + + + + + + + + + Address location + Ort + String1..80 + + + + + + + + + + Address country + Land + String1..3 + + + + + + + + + + Address state + Region + String1..10 + + + + + + + + + + Address zip code + Postleitzahl + String1..10 + + + + + + + + + + Trader identification number (TIN) + Zollnummer (TIN) + String1..17 + + + + + + + + + + Economic operator's registration and identification number (EORI) + Identifizierung des Wirtschaftsbeteiligten (EORI) + String1..17 + + + + + + + + + + + + Related party indicator + Verbundenheit + String1..1 + + + + + + + + + + + + Address district + Ortsteil + String1..35 + + + + + + + + + + + + Branch number + Niederlassungsnummer + String1..4 + + + + + + + + + + + + E-Mail + E-Mail + String1..256 + + + + + + + + + + + + VAT registration number + Umsatzsteuernummer + String1..20 + + + + + + + + + + + + + + Address number + + + + + + + + Address name + + + + + + + + Address street + + + + + + + + Address postal code + + + + + + + + Address location + + + + + + + + Address country + + + + + + + + + Address state + + + + + + + + Address TIN + + + + + + + + Address national tin flag + + + + + + + + + Documents + + + + false + 1-n + + MIC_EINSDGDOC + + + + + + + + + + + Document + Unterlage + + + true + + + MIC_EINSDGDOC + + + + + + + + + + + + + + + Document number + Unterlagennummer + + + true + String1..35 + + MIC_EINSDGDOC + ESDNR + MIC_EINSDGDOC + ESDNR + + + + + + + + + + + + + + Document date + Datum der Unterlage + + + true + xs:date + + MIC_EINSDGDOC + ESDDAT + MIC_EINSDGDOC + ESDDAT + + + + + + + + Type of identification + Art der Identifikation + + + true + String1..6 + + MIC_EINSDGDOC + ESDART + MIC_EINSDGDOC + ESDART + + + + + + + + + + + + + + Document qualification + Qualifikation + + + false + String1..3 + + MIC_EINSDGDOC + ESDQUAL + MIC_EINSDGDOC + ESDQUAL + + + + + + + + + + + + + Document vaid from date + Gültig von + + + false + xs:date + + MIC_EINSDGDOC + ESDAVAILDAT + MIC_EINSDGDOC + ESDAVAILDAT + + + + + + + + Document valid to date + Gültig bis + + + false + xs:date + + MIC_EINSDGDOC + ESDENDDAT + MIC_EINSDGDOC + ESDENDDAT + + + + + + + + Additional text of document + Zusatzinformation + + + false + String1..35 + + MIC_EINSDGDOC + ESDINFO + MIC_EINSDGDOC + ESDINFO + + + + + + + + + + + + + Quantity + Menge + + + false + Decimal(13,4) + + MIC_EINSDGDOC + ESDMENGE + MIC_EINSDGDOC + ESDMENGE + + + + + + + + + + + + + + Unit of Measurement Document + Dokumentenmengeneinheit + + + false + String1..4 + + MIC_EINSDGDOC + ESDMEH + MIC_EINSDGDOC + ESDMEH + + + + + + + + + + + + + Value + Wert + + + false + Number(16,6) + + MIC_EINSDGDOC + ESDWERT + MIC_EINSDGDOC + ESDWERT + + + + + + + + + + + + + + Unit of Measurement + Mengeneinheit + Mengeneinheit für die Abschreibungsmenge + Unit of measurement of the deduction quantity + false + String1..10 + + MIC_EINSDGDOC + ESDABMEH + MIC_EINSDGDOC + ESDABMEH + + + + + + + + + + + + + + Unit of Measurement Write-off Quantity + Abschreibung Mengeneinheit + false + String1..4 + + MIC_EINSDGDOC + ESDABMEH2 + MIC_EINSDGDOC + ESDABMEH2 + + + + + + + + + + + + + Additional costs currency + Zusätzliche Kosten Währung + false + String1..3 + + MIC_EINSDGDOC + ESDABWAE + MIC_EINSDGDOC + ESDABWAE + + + + + + + + + + + + + Currency + Währung + + + false + String1..3 + + MIC_EINSDGDOC + ESDWAE + MIC_EINSDGDOC + ESDWAE + + + + + + + + + + + + + Category + Bereich + + + false + String1..8 + + MIC_EINSDGDOC + ESDBEREICH + MIC_EINSDGDOC + ESDBEREICH + + + + + + + + + + + + + Write-off Quantity + Abschreibungsmenge + + + false + Decimal(16,7) + + MIC_EINSDGDOC + ESDABMENGE + MIC_EINSDGDOC + ESDABMENGE + + + + + + + + + + + + + + Issuer country + Ausstellerland + + + false + String1..3 + + MIC_EINSDGDOC + ESDAUSSTELLERLD + MIC_EINSDGDOC + ESDAUSSTELLERLD + + + + + + + + + + + + + Availability Flag + Verfügbarkeitskennzeichen + + + false + Boolean + + MIC_EINSDGDOC + ESDUNTLKZ + MIC_EINSDGDOC + ESDUNTLKZ + 0 + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_EINSDGDOC + ESDCREUSER + MIC_EINSDGDOC + ESDCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_EINSDGDOC + ESDCREDAT + MIC_EINSDGDOC + ESDCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_EINSDGDOC + ESDUSER + MIC_EINSDGDOC + ESDUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_EINSDGDOC + ESDUSEDAT + MIC_EINSDGDOC + ESDUSEDAT + + + + + + + + + + Delivery terms + + + + false + + + + + + + + + + + + + + Term of Delivery + Lieferbedingung + + + true + String1..4 + + MIC_ALL_EAVKOP + EAKELICODE + MIC_EINKOP + EFKELICODE + + + + + + + + + + + + + + Place of the Terms of Delivery + Ort der Lieferbedingung + + + false + String1..35 + + MIC_ALL_EAVKOP + EAKELIBEZ + MIC_EINKOP + EFKELIBEZ + + + + + + + + + + + + + Calculation of Freight Costs + Frachtkostenberechnung + + + false + String1..4 + + MIC_ALL_EAVKOP + EAKELIFORMULA + MIC_EINKOP + EFKELIFORMULA + + + + + + + + + + + + + The terms of delivery code 2 + Lieferbedingung 2 + + + false + String1..2 + + MIC_ALL_EAVKOP + EAKELICOD2 + MIC_EINKOP + EFKELICOD2 + + + + + + + + + + + + + Delivery term description + Lieferbedingungsbeschreibung + + + false + String1..512 + + MIC_ALL_EAVKOP + EAKELIDELIVERYTERMSTEXT + MIC_EINKOP + EFKELIDELIVERYTERMSTEXT + + + + + + + + + + + + + + + Item + + + + true + + + + + + + + + + + + + + Part Number + Artikelnummer + + + false + String1..30 + + EAVPOS + EAPARTNR + EINPOS + EFPARTNR + + + + + + + + + + + + + + Part Description + Warenbezeichnung + + + false + String1..240 + + EAVPOS + EAPARTBEZ + EINPOS + EFPARTBEZ + + + + + + + + + + + + + + Serial Number + Seriennummer + + + false + String1..30 + + EAVPOS + EAPSERNR + EINPOS + EFPSERNR + + + + + + + + + + + + + + Product Family + Produktgruppe + + + false + String1..10 + + EAVPOS + EAPPRODGR + EINPOS + EFPPRODGR + + + + + + + + + + + + + + Model + Modell + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPMODEL + MIC_EINPOS + EFPMODEL + + + + + + + + + + + + + + Brand + Marke + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPBRAND + MIC_EINPOS + EFPBRAND + + + + + + + + + + + + + + Manufacturer + Hersteller + + + false + String1..15 + + MIC_ALL_EAVPOS + EAPMFRNR + MIC_EINPOS + EFPMFRNR + + + + + + + + + + + + + + CTO Number + CTO Nummer + + + false + String1..41 + + MIC_ALL_EAVPOS + EAPGTCTOID + MIC_EINPOS + EFPGTCTOID + + + + + + + + + + + + + + Confidence Level + Tariffierungskennzeichen + + + false + Long 5 + + MIC_ALL_EAVPOS + EAPCONFIDENCELEVEL + MIC_EINPOS + EFPCONFIDENCELEVEL + + + + + + + + + + + Product Category + Warengruppe + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPWG + MIC_EINPOS + EFPWG + + + + + + + + + + + + + + Usage + Verwendung + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPVERW + MIC_EINPOS + EFPVERW + + + + + + + + + + + + + + UsageType + Verwendung Typ + + + false + String1..10 + + MIC_ALL_EAVPOS + EAPARTVERW + MIC_EINPOS + EFPARTVERW + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + Package + + + + false + + + + + + + + + + + + + + Number of Packages + Anzahl Packstücke + + + true + Decimal(6) + + MIC_ALL_EAVPOS + EAPKOLANZ + MIC_EINPOS + EFPKOLANZ + + + + + + + + + + + + + + Package Description + Packstückbezeichnung + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPKOLLIART + MIC_EINPOS + EFPKOLLIART + + + + + + + + + + + + + Package Type + Packstückart + + + false + String1..25 + + MIC_ALL_EAVPOS + EAPKOLART + MIC_EINPOS + EFPKOLART + + + + + + + + + + + + + + + Receipt + + + + false + + + + + + + + + + + + + + Goods Receipt Number + Wareneingangsnummer + + + false + String1..15 + + MIC_ALL_EAVPOS + EAPWENR + MIC_EINPOS + EFPWENR + + + + + + + + + + + + + The goods receipt date. + Wareneingangsdatum + + + false + xs:date + + MIC_ALL_EAVPOS + EAPWEDAT + MIC_EINPOS + EFPWEDAT + + + + + + + + + + Bill of material + + + + false + + + + + + + + + + + + + + Bill of Materials + Stückliste + + + false + String1..40 + + MIC_ALL_EAVPOS + EAPREZNR + MIC_EINPOS + EFPREZNR + + + + + + + + + + + + + + BoM Variant + Stücklistenvariante + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPREZVAR + MIC_EINPOS + EFPREZVAR + + + + + + + + + + + + + + + + Bill of material + + + + false + + + + + + + + + + + + + + Due Group 1 + Abgabengruppe 1 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGRPVV1 + MIC_EINPOS + EFPEFAAGRPVV1 + + + + + + + + + + + + + Reduction Amount 1 + Minderungsbetrag 1 + + + false + Decimal(11,2) + + MIC_ALL_EAVPOS + EAPEFAMBPV1 + MIC_EINPOS + EFPEFAMBPV1 + + + + + + + + + + + + + + Due Group 2 + Abgabengruppe 2 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGRPVV2 + MIC_EINPOS + EFPEFAAGRPVV2 + + + + + + + + + + + + + Reduction Amount 2 + Minderungsbetrag 2 + + + false + Decimal(11,2) + + MIC_ALL_EAVPOS + EAPEFAMBPV2 + MIC_EINPOS + EFPEFAMBPV2 + + + + + + + + + + + + + + Due Group 3 + Abgabengruppe 3 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGRPVV3 + MIC_EINPOS + EFPEFAAGRPVV3 + + + + + + + + + + + + + Reduction Amount 3 + Minderungsbetrag 3 + + + false + Decimal(11,2) + + MIC_ALL_EAVPOS + EAPEFAMBPV3 + MIC_EINPOS + EFPEFAMBPV3 + + + + + + + + + + + + + + + + Additional import line parameters (mic_einbpara fields) + Zusätzliche Zeilenparameter (mic_einbpara Felder) + + + false + + + + + + + + + + + + + + Cancellation status + Stornierungsstatus + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFASTATUS + MIC_EINBPARA + EFASTATUS + + + + + + + + + + + + + Commodity code (10-digit combined nomenclature) + Warennummer (10-stellige KN) + + + false + String1..13 + + MIC_ALL_EAVPOS + EAPEFACNR1 + MIC_EINBPARA + EFACNR1 + + + + + + + + + + + + + Country group code + Ländergruppencode + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFALGS + MIC_EINBPARA + EFALGS + + + + + + + + + + + + + Goods condition code 1 + Warenzustandscode 1 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFABDM1 + MIC_EINBPARA + EFABDM1 + + + + + + + + + + + + + Goods condition code 2 + Warenzustandscode 2 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFABDM2 + MIC_EINBPARA + EFABDM2 + + + + + + + + + + + + + Vehicle/tobacco manufacturer code + Fahrzeug-/Tabakhersteller-Code + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMANSKZ + MIC_EINBPARA + EFAMANSKZ + + + + + + + + + + + + + Special provision code + Sonderbestimmungscode + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFASRG + MIC_EINBPARA + EFASRG + + + + + + + + + + + + + Relevant time - clearance + Relevanzdatum - Abfertigung + + + false + Date + + MIC_ALL_EAVPOS + EAPEFADATMGZ + MIC_EINBPARA + EFADATMGZ + + + + + + + + + + + Relevant time - preference + Relevanzdatum - Praeferenz + + + false + Date + + MIC_ALL_EAVPOS + EAPEFADATMPZ + MIC_EINBPARA + EFADATMPZ + + + + + + + + + + + Country of exportation code + Ausfuhrerland-Code + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAVSL + MIC_EINBPARA + EFAVSL + + + + + + + + + + + + + Country of origin code + Ursprungsland-Code + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAURL + MIC_EINBPARA + EFAURL + + + + + + + + + + + + + Country of purchase code + Erwerbsland-Code + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAEKL + MIC_EINBPARA + EFAEKL + + + + + + + + + + + + + Default preference document type + Standard-Praefelenzdokumenttyp + + + false + String1..6 + + MIC_ALL_EAVPOS + EAPEFAWPN + MIC_EINBPARA + EFAWPN + + + + + + + + + + + + + Default preference document subtype + Standard-Praefenzdokumentuntertyp + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAWPZ + MIC_EINBPARA + EFAWPZ + + + + + + + + + + + + + Temporarity indicator + Temporaerer-Indikator + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVLG + MIC_EINBPARA + EFAVLG + + + + + + + + + + + + + Standard treatment indicator + Standard-Behandlungs-Indikator + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAUGB + MIC_EINBPARA + EFAUGB + + + + + + + + + + + + + Quota flag 1 + Kontingentkennzeichen 1 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKKA1 + MIC_EINBPARA + EFAKKA1 + + + + + + + + + + + + + Quota number 1 + Kontingentnummer 1 + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPEFANKA1 + MIC_EINBPARA + EFANKA1 + + + + + + + + + + + + + Quota number 2 + Kontingentnummer 2 + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPEFANKA2 + MIC_EINBPARA + EFANKA2 + + + + + + + + + + + + + Quota flag 3 + Kontingentkennzeichen 3 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKKA3 + MIC_EINBPARA + EFAKKA3 + + + + + + + + + + + + + Quota number 3 + Kontingentnummer 3 + + + false + String1..20 + + MIC_ALL_EAVPOS + EAPEFANKA3 + MIC_EINBPARA + EFANKA3 + + + + + + + + + + + + + Quota additional code flag 1 + Quoten-Zusatzcode-Kz. 1 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAZCA1 + MIC_EINBPARA + EFAZCA1 + + + + + + + + + + + + + Quota additional code 1 + Quoten-Zusatzcode 1 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAZCS1 + MIC_EINBPARA + EFAZCS1 + + + + + + + + + + + + + Quota additional code flag 2 + Quoten-Zusatzcode-Kz. 2 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAZCA2 + MIC_EINBPARA + EFAZCA2 + + + + + + + + + + + + + Quota additional code 2 + Quoten-Zusatzcode 2 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAZCS2 + MIC_EINBPARA + EFAZCS2 + + + + + + + + + + + + + Quota additional code flag 3 + Quoten-Zusatzcode-Kz. 3 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAZCA3 + MIC_EINBPARA + EFAZCA3 + + + + + + + + + + + + + Quota additional code 3 + Quoten-Zusatzcode 3 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAZCS3 + MIC_EINBPARA + EFAZCS3 + + + + + + + + + + + + + Customs procedure code + Zollverfahrenscode + + + false + String1..7 + + MIC_ALL_EAVPOS + EAPEFAVFC + MIC_EINBPARA + EFAVFC + + + + + + + + + + + + + Customs calculation code + Zollberechnungscode + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAZBC + MIC_EINBPARA + EFAZBC + + + + + + + + + + + + + Customs calculation Z + Zollberechnung Z + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAZBZ + MIC_EINBPARA + EFAZBZ + + + + + + + + + + + + + Customs quantity + Zollmenge + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAZOM + MIC_EINBPARA + EFAZOM + + + + + + + + + + + + + + Unit of customs quantity + Zollmengeneinheit + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAMESZO + MIC_EINBPARA + EFAMESZO + + + + + + + + + + + + + Customs value + Zollwert + + + false + Decimal(10,2) + + MIC_ALL_EAVPOS + EAPEFAZWT + MIC_EINBPARA + EFAZWT + + + + + + + + + + + + + + Levy unit + Abgabeneinheit + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAABM + MIC_EINBPARA + EFAABM + + + + + + + + + + + + + + Levy unit UOM + Abgabeneinheit-Uom + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESAB + MIC_EINBPARA + EFAMESAB + + + + + + + + + + + + + Special unit + Spezialeinheit + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFABSM + MIC_EINBPARA + EFABSM + + + + + + + + + + + + + + Special unit UOM + Spezialeinheit-Uom + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESBS + MIC_EINBPARA + EFAMESBS + + + + + + + + + + + + + Special value + Spezialwert + + + false + Decimal(10,2) + + MIC_ALL_EAVPOS + EAPEFABWT + MIC_EINBPARA + EFABWT + + + + + + + + + + + + + + Content type 1 + Gehaltsart 1 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS1 + MIC_EINBPARA + EFAGAS1 + + + + + + + + + + + + + Content share 1 + Gehaltsanteil 1 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT1 + MIC_EINBPARA + EFAANT1 + + + + + + + + + + + + + + Content type 2 + Gehaltsart 2 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS2 + MIC_EINBPARA + EFAGAS2 + + + + + + + + + + + + + Content share 2 + Gehaltsanteil 2 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT2 + MIC_EINBPARA + EFAANT2 + + + + + + + + + + + + + + Content type 3 + Gehaltsart 3 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS3 + MIC_EINBPARA + EFAGAS3 + + + + + + + + + + + + + Content share 3 + Gehaltsanteil 3 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT3 + MIC_EINBPARA + EFAANT3 + + + + + + + + + + + + + + Content type 4 + Gehaltsart 4 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS4 + MIC_EINBPARA + EFAGAS4 + + + + + + + + + + + + + Content share 4 + Gehaltsanteil 4 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT4 + MIC_EINBPARA + EFAANT4 + + + + + + + + + + + + + + Content type 5 + Gehaltsart 5 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS5 + MIC_EINBPARA + EFAGAS5 + + + + + + + + + + + + + Content share 5 + Gehaltsanteil 5 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT5 + MIC_EINBPARA + EFAANT5 + + + + + + + + + + + + + + Content type 6 + Gehaltsart 6 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGAS6 + MIC_EINBPARA + EFAGAS6 + + + + + + + + + + + + + Content share 6 + Gehaltsanteil 6 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANT6 + MIC_EINBPARA + EFAANT6 + + + + + + + + + + + + + + Excise tax code 1 + Verbrauchsteuercode 1 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC1 + MIC_EINBPARA + EFAVSC1 + + + + + + + + + + + + + Excise tax quantity 1 + Verbrauchsteuermenge 1 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM1 + MIC_EINBPARA + EFAVSTM1 + + + + + + + + + + + + + + Excise tax UOM 1 + Verbrauchsteuer-Uom 1 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST1 + MIC_EINBPARA + EFAMESVST1 + + + + + + + + + + + + + Excise tax value 1 + Verbrauchsteuerwert 1 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW1 + MIC_EINBPARA + EFAVSTW1 + + + + + + + + + + + + + + Excise tax share 1 + Verbrauchsteueranteil 1 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV1 + MIC_EINBPARA + EFAANTV1 + + + + + + + + + + + + + + Excise tax code 2 + Verbrauchsteuercode 2 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC2 + MIC_EINBPARA + EFAVSC2 + + + + + + + + + + + + + Excise tax quantity 2 + Verbrauchsteuermenge 2 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM2 + MIC_EINBPARA + EFAVSTM2 + + + + + + + + + + + + + + Excise tax UOM 2 + Verbrauchsteuer-Uom 2 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST2 + MIC_EINBPARA + EFAMESVST2 + + + + + + + + + + + + + Excise tax value 2 + Verbrauchsteuerwert 2 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW2 + MIC_EINBPARA + EFAVSTW2 + + + + + + + + + + + + + + Excise tax share 2 + Verbrauchsteueranteil 2 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV2 + MIC_EINBPARA + EFAANTV2 + + + + + + + + + + + + + + Excise tax code 3 + Verbrauchsteuercode 3 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC3 + MIC_EINBPARA + EFAVSC3 + + + + + + + + + + + + + Excise tax quantity 3 + Verbrauchsteuermenge 3 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM3 + MIC_EINBPARA + EFAVSTM3 + + + + + + + + + + + + + + Excise tax UOM 3 + Verbrauchsteuer-Uom 3 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST3 + MIC_EINBPARA + EFAMESVST3 + + + + + + + + + + + + + Excise tax value 3 + Verbrauchsteuerwert 3 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW3 + MIC_EINBPARA + EFAVSTW3 + + + + + + + + + + + + + + Excise tax share 3 + Verbrauchsteueranteil 3 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV3 + MIC_EINBPARA + EFAANTV3 + + + + + + + + + + + + + + Excise tax code 4 + Verbrauchsteuercode 4 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC4 + MIC_EINBPARA + EFAVSC4 + + + + + + + + + + + + + Excise tax quantity 4 + Verbrauchsteuermenge 4 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM4 + MIC_EINBPARA + EFAVSTM4 + + + + + + + + + + + + + + Excise tax UOM 4 + Verbrauchsteuer-Uom 4 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST4 + MIC_EINBPARA + EFAMESVST4 + + + + + + + + + + + + + Excise tax value 4 + Verbrauchsteuerwert 4 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW4 + MIC_EINBPARA + EFAVSTW4 + + + + + + + + + + + + + + Excise tax share 4 + Verbrauchsteueranteil 4 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV4 + MIC_EINBPARA + EFAANTV4 + + + + + + + + + + + + + + Excise tax code 5 + Verbrauchsteuercode 5 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC5 + MIC_EINBPARA + EFAVSC5 + + + + + + + + + + + + + Excise tax quantity 5 + Verbrauchsteuermenge 5 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM5 + MIC_EINBPARA + EFAVSTM5 + + + + + + + + + + + + + + Excise tax UOM 5 + Verbrauchsteuer-Uom 5 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST5 + MIC_EINBPARA + EFAMESVST5 + + + + + + + + + + + + + Excise tax value 5 + Verbrauchsteuerwert 5 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW5 + MIC_EINBPARA + EFAVSTW5 + + + + + + + + + + + + + + Excise tax share 5 + Verbrauchsteueranteil 5 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV5 + MIC_EINBPARA + EFAANTV5 + + + + + + + + + + + + + + Excise tax code 6 + Verbrauchsteuercode 6 + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAVSC6 + MIC_EINBPARA + EFAVSC6 + + + + + + + + + + + + + Excise tax quantity 6 + Verbrauchsteuermenge 6 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTM6 + MIC_EINBPARA + EFAVSTM6 + + + + + + + + + + + + + + Excise tax UOM 6 + Verbrauchsteuer-Uom 6 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMESVST6 + MIC_EINBPARA + EFAMESVST6 + + + + + + + + + + + + + Excise tax value 6 + Verbrauchsteuerwert 6 + + + false + Decimal(12,3) + + MIC_ALL_EAVPOS + EAPEFAVSTW6 + MIC_EINBPARA + EFAVSTW6 + + + + + + + + + + + + + + Excise tax share 6 + Verbrauchsteueranteil 6 + + + false + Decimal(5,2) + + MIC_ALL_EAVPOS + EAPEFAANTV6 + MIC_EINBPARA + EFAANTV6 + + + + + + + + + + + + + + Special case duty group 1 + Sonderfall-Abgabengruppe 1 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGR1 + MIC_EINBPARA + EFAAGR1 + + + + + + + + + + + + + Special case type 1 + Sonderfall-Typ 1 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAWT1 + MIC_EINBPARA + EFAAWT1 + + + + + + + + + + + + + Special case rate 1 + Sonderfall-Satz 1 + + + false + Decimal(13,5) + + MIC_ALL_EAVPOS + EAPEFAASB1 + MIC_EINBPARA + EFAASB1 + + + + + + + + + + + + + + Special case duty group 2 + Sonderfall-Abgabengruppe 2 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGR2 + MIC_EINBPARA + EFAAGR2 + + + + + + + + + + + + + Special case type 2 + Sonderfall-Typ 2 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAWT2 + MIC_EINBPARA + EFAAWT2 + + + + + + + + + + + + + Special case rate 2 + Sonderfall-Satz 2 + + + false + Decimal(13,5) + + MIC_ALL_EAVPOS + EAPEFAASB2 + MIC_EINBPARA + EFAASB2 + + + + + + + + + + + + + + Special case duty group 3 + Sonderfall-Abgabengruppe 3 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAGR3 + MIC_EINBPARA + EFAAGR3 + + + + + + + + + + + + + Special case type 3 + Sonderfall-Typ 3 + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAAWT3 + MIC_EINBPARA + EFAAWT3 + + + + + + + + + + + + + Special case rate 3 + Sonderfall-Satz 3 + + + false + Decimal(13,5) + + MIC_ALL_EAVPOS + EAPEFAASB3 + MIC_EINBPARA + EFAASB3 + + + + + + + + + + + + + + IVAT costs + IVAT-Kosten + + + false + Decimal(10,2) + + MIC_ALL_EAVPOS + EAPEFAEUK + MIC_EINBPARA + EFAEUK + + + + + + + + + + + + + + Gene field + Genfeld + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGEN + MIC_EINBPARA + EFAGEN + + + + + + + + + + + + + Certificates code + Zertifikat-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAZEU + MIC_EINBPARA + EFAZEU + + + + + + + + + + + + + Standards code + Standard-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAGUN + MIC_EINBPARA + EFAGUN + + + + + + + + + + + + + Import control code + Einfuhrkontroll-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAEFK + MIC_EINBPARA + EFAEFK + + + + + + + + + + + + + Insurance code + Versicherungs-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAVSG + MIC_EINBPARA + EFAVSG + + + + + + + + + + + + + Establishment code + Betriebsstätten-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAANS + MIC_EINBPARA + EFAANS + + + + + + + + + + + + + Procedure code + Verfahrens-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAVER + MIC_EINBPARA + EFAVER + + + + + + + + + + + + + License type 1 + Lizenztyp 1 + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFALIZENZART1 + MIC_EINBPARA + EFALIZENZART1 + + + + + + + + + + + + + License number 1 + Lizenznummer 1 + + + false + String1..15 + + MIC_ALL_EAVPOS + EAPEFALIZENZNR1 + MIC_EINBPARA + EFALIZENZNR1 + + + + + + + + + + + + + Excise tax qualifier 1 + Verbrauchsteuer-Qualifikator 1 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q1 + MIC_EINBPARA + EFAVST1Q1 + + + + + + + + + + + + + Excise tax qualifier 2 + Verbrauchsteuer-Qualifikator 2 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q2 + MIC_EINBPARA + EFAVST1Q2 + + + + + + + + + + + + + Excise tax qualifier 3 + Verbrauchsteuer-Qualifikator 3 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q3 + MIC_EINBPARA + EFAVST1Q3 + + + + + + + + + + + + + Excise tax qualifier 4 + Verbrauchsteuer-Qualifikator 4 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q4 + MIC_EINBPARA + EFAVST1Q4 + + + + + + + + + + + + + Excise tax qualifier 5 + Verbrauchsteuer-Qualifikator 5 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q5 + MIC_EINBPARA + EFAVST1Q5 + + + + + + + + + + + + + Excise tax qualifier 6 + Verbrauchsteuer-Qualifikator 6 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVST1Q6 + MIC_EINBPARA + EFAVST1Q6 + + + + + + + + + + + + + Quota quantity + Kontingenzmenge + + + false + Decimal(13,3) + + MIC_ALL_EAVPOS + EAPEFAZKMENGE + MIC_EINBPARA + EFAZKMENGE + + + + + + + + + + + + + + Quota UOM + Kontingenzmenge-Uom + + + false + String1..4 + + MIC_ALL_EAVPOS + EAPEFAZKMEH + MIC_EINBPARA + EFAZKMEH + + + + + + + + + + + + + Quota qualifier + Kontingenz-Qualifikator + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAZKMEHQ + MIC_EINBPARA + EFAZKMEHQ + + + + + + + + + + + + + Goods location + Warenlagerort + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPEFAWARENORT + MIC_EINBPARA + EFAWARENORT + + + + + + + + + + + + + Tax code 1 + Steuerschluessel 1 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL1 + MIC_EINBPARA + EFAVSSCHL1 + + + + + + + + + + + Tax code 2 + Steuerschluessel 2 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL2 + MIC_EINBPARA + EFAVSSCHL2 + + + + + + + + + + + Tax code 3 + Steuerschluessel 3 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL3 + MIC_EINBPARA + EFAVSSCHL3 + + + + + + + + + + + Tax code 4 + Steuerschluessel 4 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL4 + MIC_EINBPARA + EFAVSSCHL4 + + + + + + + + + + + Tax code 5 + Steuerschluessel 5 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL5 + MIC_EINBPARA + EFAVSSCHL5 + + + + + + + + + + + Tax code 6 + Steuerschluessel 6 + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAVSSCHL6 + MIC_EINBPARA + EFAVSSCHL6 + + + + + + + + + + + Tobacco flag number + Tabaksteuerzeichen-Nummer + + + false + String1..5 + + MIC_ALL_EAVPOS + EAPEFATABAKKZNR + MIC_EINBPARA + EFATABAKKZNR + + + + + + + + + + + + + Subject area code + Sachbereichscode + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFASACHBEREICH + MIC_EINBPARA + EFASACHBEREICH + + + + + + + + + + + + + Complete information flag + Vollständige-Angaben-Kz. + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAVOLLSTKZ + MIC_EINBPARA + EFAVOLLSTKZ + + + + + + + + + + + + + Statistic status code + Statistikstatus-Code + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFASTATSTATUS + MIC_EINBPARA + EFASTATSTATUS + + + + + + + + + + + + + Charge/price type + Preis-/Gebuehrentyp + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAPREISART + MIC_EINBPARA + EFAPREISART + + + + + + + + + + + + + Indirect payment amount + Mittelbare-Zahlung-Betrag + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAMITZWT + MIC_EINBPARA + EFAMITZWT + + + + + + + + + + + Indirect payment currency + Mittelbare-Zahlung-Waehrung + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAMITZWAE + MIC_EINBPARA + EFAMITZWAE + + + + + + + + + + + + + Indirect payment flag + Mittelbare-Zahlung-Kz. + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAMITZKURSKZ + MIC_EINBPARA + EFAMITZKURSKZ + + + + + + + + + + + + + Indirect payment rate + Mittelbare-Zahlung-Kurs + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAMITZKURS + MIC_EINBPARA + EFAMITZKURS + + + + + + + + + + + Message flag 22 + Meldungs-Kz. 22 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKZ22 + MIC_EINBPARA + EFAKZ22 + + + + + + + + + + + + + Message flag 55 + Meldungs-Kz. 55 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKZ55 + MIC_EINBPARA + EFAKZ55 + + + + + + + + + + + + + Message flag 77 + Meldungs-Kz. 77 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKZ77 + MIC_EINBPARA + EFAKZ77 + + + + + + + + + + + + + Message flag 90 + Meldungs-Kz. 90 + + + false + String1..1 + + MIC_ALL_EAVPOS + EAPEFAKZ90 + MIC_EINBPARA + EFAKZ90 + + + + + + + + + + + + + Tariff/commodity number + Warennummer + + + false + String1..13 + + MIC_ALL_EAVPOS + EAPEFATARNR + MIC_EINBPARA + EFATARNR + + + + + + + + + + + + + Country of dispatch + Versendungsland + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAVSLD + MIC_EINBPARA + EFAVSLD + + + + + + + + + + + + + Country of origin + Ursprungsland + + + false + String1..2 + + MIC_ALL_EAVPOS + EAPEFAURLD + MIC_EINBPARA + EFAURLD + + + + + + + + + + + + + Net weight + Eigenmasse + + + false + Decimal(14,5) + + MIC_ALL_EAVPOS + EAPEFAEIGMAS + MIC_EINBPARA + EFAEIGMAS + + + + + + + + + + + + + + Item/part price + Teilepreis + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAPREIS + MIC_EINBPARA + EFAPREIS + + + + + + + + + + + Preference request code + Beantragte-Begunstigung-Code + + + false + String1..3 + + MIC_ALL_EAVPOS + EAPEFAPAC + MIC_EINBPARA + EFAPAC + + + + + + + + + + + + + Position number + Positionsnummer + + + false + Integer + + MIC_ALL_EAVPOS + EAPEFAPOSNR + MIC_EINBPARA + EFAPOSNR + + + + + + + + + + + Additional costs IVAT + Zusätzliche-IVAT-Kosten + + + false + Decimal(13,3) + + MIC_ALL_EAVPOS + EAPEFAZUEUST + MIC_EINBPARA + EFAZUEUST + + + + + + + + + + + + + + + Previous documents + + + + + + Previous document + Vorpapier + + + true + + + + + MIC_EINDOC + + + + + + + + + + + + + Previous Document Type + Art des Vorpapiers + + + true + String1..9 + + MIC_EAVDOC + EADVSSART + MIC_EINDOC + EFDVSSART + + + + + + + + + + + + + Previous Document Number + Vorpapiernummer + + + true + String1..24 + + MIC_EAVDOC + EADVSSNR + MIC_EINDOC + EFDVSSNR + + + + + + + + + + + + + Previous document date + Vorpapierdatum + + + true + xs:date + + MIC_EAVDOC + EADVSSDAT + MIC_EINDOC + EFDVSSDAT + + + + + + + + Previous document customsdate + Vorpapierzolldatum + + + false + xs:date + + MIC_EAVDOC + EADVZDAT + MIC_EINDOC + EFDVZDAT + + + + + + + + Departure Customs Office + Abgang Zollstelle + + + false + String1..20 + + MIC_EAVDOC + EADABZOST + MIC_EINDOC + EFDABZOST + + + + + + + + + + + + + Destination Customs Office + Bestimmungszollstelle + + + false + String1..8 + + MIC_EAVDOC + EADZOST + MIC_EINDOC + EFDZOST + + + + + + + + + + + + + Category + Kategorie + + + false + String1..1 + + MIC_EAVDOC + EADTYP + MIC_EINDOC + EFDTYP + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_EAVDOC + EADCREUSER + MIC_EINDOC + EFDCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_EAVDOC + EADCREDAT + MIC_EINDOC + EFDCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_EAVDOC + EADUSER + MIC_EINDOC + EFDUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_EAVDOC + EADUSEDAT + MIC_EINDOC + EFDUSEDAT + + + + + + + + + + + + + + false + + + + + + + + + + + + + + Type of identification of transport on arrival + Art der Transportidentifikation bei Ankunft + + + false + String1..2 + + MIC_EAVSDG + EASVKZINIDENTIFICATIONTYPE + MIC_EINSDG + EFSVKZINIDENTIFICATIONTYPE + + + + + + + + + + + + + Declaration type + Kz. Nachrichtensteuerung + + + false + String1..1 + + MIC_EAVSDG + EASMESSVORZKZ + MIC_EINSDG + EFSMESSVORZKZ + + + + + + + + + + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + + + + + + + + + + + + Customer text field 1 + Kundenspezifisches Textfeld 1 + + + false + String1..400 + + + ___TEXT1 + + ___TEXT1 + ABC + + + + + + + Customer text field 2 + Kundenspezifisches Textfeld 2 + + + false + String1..400 + + + ___TEXT2 + + ___TEXT2 + ABC + + + + + + + Customer text field 3 + Kundenspezifisches Textfeld 3 + + + false + String1..400 + + + ___TEXT3 + + ___TEXT3 + ABC + + + + + + + Customer text field 4 + Kundenspezifisches Textfeld 4 + + + false + String1..400 + + + ___TEXT4 + + ___TEXT4 + ABC + + + + + + + Customer text field 5 + Kundenspezifisches Textfeld 5 + + + false + String1..400 + + + ___TEXT5 + + ___TEXT5 + ABC + + + + + + + Customer text field 6 + Kundenspezifisches Textfeld 6 + + + false + String1..400 + + + ___TEXT6 + + ___TEXT6 + ABC + + + + + + + Customer text field 7 + Kundenspezifisches Textfeld 7 + + + false + String1..400 + + + ___TEXT7 + + ___TEXT7 + ABC + + + + + + + Customer text field 8 + Kundenspezifisches Textfeld 8 + + + false + String1..400 + + + ___TEXT8 + + ___TEXT8 + ABC + + + + + + + Customer text field 9 + Kundenspezifisches Textfeld 9 + + + false + String1..400 + + + ___TEXT9 + + ___TEXT9 + ABC + + + + + + + Customer text field 10 + Kundenspezifisches Textfeld 10 + + + false + String1..400 + + + ___TEXT10 + + ___TEXT10 + ABC + + + + + + + Customer date 1 + Kundenspezifisches Datumsfeld 1 + + + false + Xs:datetime + + + ___DATE1 + + ___DATE1 + 01.01.2010 + + + + + + + + + + Customer date 2 + Kundenspezifisches Datumsfeld 2 + + + false + Xs:datetime + + + ___DATE2 + + ___DATE2 + 01.01.2010 + + + + + + + + + + Customer date 3 + Kundenspezifisches Datumsfeld 3 + + + false + Xs:datetime + + + ___DATE3 + + ___DATE3 + 01.01.2010 + + + + + + + + + + Customer date 4 + Kundenspezifisches Datumsfeld 4 + + + false + Xs:datetime + + + ___DATE4 + + ___DATE4 + 01.01.2010 + + + + + + + + + + Customer date 5 + Kundenspezifisches Datumsfeld 5 + + + false + Xs:datetime + + + ___DATE5 + + ___DATE5 + 01.01.2010 + + + + + + + + + + Customer date 6 + Kundenspezifisches Datumsfeld 6 + + + false + Xs:datetime + + + ___DATE6 + + ___DATE6 + 01.01.2010 + + + + + + + + + + Customer date 7 + Kundenspezifisches Datumsfeld 7 + + + false + Xs:datetime + + + ___DATE7 + + ___DATE7 + 01.01.2010 + + + + + + + + + + Customer date 8 + Kundenspezifisches Datumsfeld 8 + + + false + Xs:datetime + + + ___DATE8 + + ___DATE8 + 01.01.2010 + + + + + + + + + + Customer date 9 + Kundenspezifisches Datumsfeld 9 + + + false + Xs:datetime + + + ___DATE9 + + ___DATE9 + 01.01.2010 + + + + + + + + + + Customer date 10 + Kundenspezifisches Datumsfeld 10 + + + false + Xs:datetime + + + ___DATE10 + + ___FALG10 + 01.01.2010 + + + + + + + + + + Customer flag 1 + Kundenspezifisches Ja/Nein Feld 1 + + + false + Boolean + + + ___FLAG1 + + ___FLAG1 + 0 + + + + + + + Customer flag 2 + Kundenspezifisches Ja/Nein Feld 2 + + + false + Boolean + + + ___FLAG2 + + ___FLAG2 + 0 + + + + + + + Customer flag 3 + Kundenspezifisches Ja/Nein Feld 3 + + + false + Boolean + + + ___FLAG3 + + ___FLAG3 + 0 + + + + + + + Customer flag 4 + Kundenspezifisches Ja/Nein Feld 4 + + + false + Boolean + + + ___FLAG4 + + ___FLAG4 + 0 + + + + + + + Customer flag 5 + Kundenspezifisches Ja/Nein Feld 5 + + + false + Boolean + + + ___FLAG5 + + ___FLAG5 + 0 + + + + + + + Customer flag 6 + Kundenspezifisches Ja/Nein Feld 6 + + + false + Boolean + + + ___FLAG6 + + ___FLAG6 + 0 + + + + + + + Customer flag 7 + Kundenspezifisches Ja/Nein Feld 7 + + + false + Boolean + + + ___FLAG7 + + ___FLAG7 + 0 + + + + + + + Customer flag 8 + Kundenspezifisches Ja/Nein Feld 8 + + + false + Boolean + + + ___FLAG8 + + ___FLAG8 + 0 + + + + + + + Customer flag 9 + Kundenspezifisches Ja/Nein Feld 9 + + + false + Boolean + + + ___FLAG9 + + ___FLAG9 + 0 + + + + + + + Customer flag 10 + Kundenspezifisches Ja/Nein Feld 10 + + + false + Boolean + + + ___FLAG10 + + ___NUMBER10 + 0 + + + + + + + Customer number 1 + Kundenspezifisches Nummernfeld 1 + + + false + Number(15,4) + + + ___NUMBER1 + + ___NUMBER1 + 10 + + + + + + + Customer number 2 + Kundenspezifisches Nummernfeld 2 + + + false + Number(15,4) + + + ___NUMBER2 + + ___NUMBER2 + 10 + + + + + + + Customer number 3 + Kundenspezifisches Nummernfeld 3 + + + false + Number(15,4) + + + ___NUMBER3 + + ___NUMBER3 + 10 + + + + + + + Customer number 4 + Kundenspezifisches Nummernfeld 4 + + + false + Number(15,4) + + + ___NUMBER4 + + ___NUMBER4 + 10 + + + + + + + Customer number 5 + Kundenspezifisches Nummernfeld 5 + + + false + Number(15,4) + + + ___NUMBER5 + + ___NUMBER5 + 10 + + + + + + + Customer number 6 + Kundenspezifisches Nummernfeld 6 + + + false + Number(15,4) + + + ___NUMBER6 + + ___NUMBER6 + 10 + + + + + + + Customer number 7 + Kundenspezifisches Nummernfeld 7 + + + false + Number(15,4) + + + ___NUMBER7 + + ___NUMBER7 + 10 + + + + + + + Customer number 8 + Kundenspezifisches Nummernfeld 8 + + + false + Number(15,4) + + + ___NUMBER8 + + ___NUMBER8 + 10 + + + + + + + Customer number 9 + Kundenspezifisches Nummernfeld 9 + + + false + Number(15,4) + + + ___NUMBER9 + + ___NUMBER9 + 10 + + + + + + + Customer number 10 + Kundenspezifisches Nummernfeld 10 + + + false + Number(15,4) + + + ___NUMBER10 + + ___NUMBER10 + 10 + + + + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + + + + + + + + + + + + Customer text field 1 + Kundenspezifisches Textfeld 1 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT1 + MIC_EINPOS + EFPTEXT1 + ABC + + + + + + + Customer text field 2 + Kundenspezifisches Textfeld 2 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT2 + MIC_EINPOS + EFPTEXT2 + ABC + + + + + + + Customer text field 3 + Kundenspezifisches Textfeld 3 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT3 + MIC_EINPOS + EFPTEXT3 + ABC + + + + + + + Customer text field 4 + Kundenspezifisches Textfeld 4 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT4 + MIC_EINPOS + EFPTEXT4 + ABC + + + + + + + Customer text field 5 + Kundenspezifisches Textfeld 5 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT5 + MIC_EINPOS + EFPTEXT5 + ABC + + + + + + + Customer text field 6 + Kundenspezifisches Textfeld 6 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT6 + MIC_EINPOS + EFPTEXT6 + ABC + + + + + + + Customer text field 7 + Kundenspezifisches Textfeld 7 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT7 + MIC_EINPOS + EFPTEXT7 + ABC + + + + + + + Customer text field 8 + Kundenspezifisches Textfeld 8 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT8 + MIC_EINPOS + EFPTEXT8 + ABC + + + + + + + Customer text field 9 + Kundenspezifisches Textfeld 9 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT9 + MIC_EINPOS + EFPTEXT9 + ABC + + + + + + + Customer text field 10 + Kundenspezifisches Textfeld 10 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT10 + MIC_EINPOS + EFPTEXT10 + ABC + + + + + + + Customer text field 11 + Kundenspezifisches Textfeld 11 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT11 + MIC_EINPOS + EFPTEXT11 + ABC + + + + + + + Customer text field 12 + Kundenspezifisches Textfeld 12 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT12 + MIC_EINPOS + EFPTEXT12 + ABC + + + + + + + Customer text field 13 + Kundenspezifisches Textfeld 13 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT13 + MIC_EINPOS + EFPTEXT13 + ABC + + + + + + + Customer text field 14 + Kundenspezifisches Textfeld 14 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT14 + MIC_EINPOS + EFPTEXT14 + ABC + + + + + + + Customer text field 15 + Kundenspezifisches Textfeld 15 + + + false + String1..400 + + MIC_ALL_EAVPOS + EAPTEXT15 + MIC_EINPOS + EFPTEXT15 + ABC + + + + + + + Customer date 1 + Kundenspezifisches Datumsfeld 1 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE1 + MIC_EINPOS + EFPDATE1 + 01.01.2010 + + + + + + + + + + Customer date 2 + Kundenspezifisches Datumsfeld 2 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE2 + MIC_EINPOS + EFPDATE2 + 01.01.2010 + + + + + + + + + + Customer date 3 + Kundenspezifisches Datumsfeld 3 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE3 + MIC_EINPOS + EFPDATE3 + 01.01.2010 + + + + + + + + + + Customer date 4 + Kundenspezifisches Datumsfeld 4 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE4 + MIC_EINPOS + EFPDATE4 + 01.01.2010 + + + + + + + + + + Customer date 5 + Kundenspezifisches Datumsfeld 5 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE5 + MIC_EINPOS + EFPDATE5 + 01.01.2010 + + + + + + + + + + Customer date 6 + Kundenspezifisches Datumsfeld 6 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE6 + MIC_EINPOS + EFPDATE6 + 01.01.2010 + + + + + + + + + + Customer date 7 + Kundenspezifisches Datumsfeld 7 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE7 + MIC_EINPOS + EFPDATE7 + 01.01.2010 + + + + + + + + + + Customer date 8 + Kundenspezifisches Datumsfeld 8 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE8 + MIC_EINPOS + EFPDATE8 + 01.01.2010 + + + + + + + + + + Customer date 9 + Kundenspezifisches Datumsfeld 9 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE9 + MIC_EINPOS + EFPDATE9 + 01.01.2010 + + + + + + + + + + Customer date 10 + Kundenspezifisches Datumsfeld 10 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE10 + MIC_EINPOS + EFPDATE10 + 01.01.2010 + + + + + + + + + + Customer date 11 + Kundenspezifisches Datumsfeld 11 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE11 + MIC_EINPOS + EFPDATE11 + 01.01.2010 + + + + + + + + + + Customer date 12 + Kundenspezifisches Datumsfeld 12 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE12 + MIC_EINPOS + EFPDATE12 + 01.01.2010 + + + + + + + + + + Customer date 13 + Kundenspezifisches Datumsfeld 13 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE13 + MIC_EINPOS + EFPDATE13 + 01.01.2010 + + + + + + + + + + Customer date 14 + Kundenspezifisches Datumsfeld 14 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE14 + MIC_EINPOS + EFPDATE14 + 01.01.2010 + + + + + + + + + + Customer date 15 + Kundenspezifisches Datumsfeld 15 + + + false + Xs:datetime + + MIC_ALL_EAVPOS + EAPDATE15 + MIC_EINPOS + EFPDATE15 + 01.01.2010 + + + + + + + + + + Customer flag 1 + Kundenspezifisches Ja/Nein Feld 1 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG1 + MIC_EINPOS + EFPFLAG1 + 0 + + + + + + + Customer flag 2 + Kundenspezifisches Ja/Nein Feld 2 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG2 + MIC_EINPOS + EFPFLAG2 + 0 + + + + + + + Customer flag 3 + Kundenspezifisches Ja/Nein Feld 3 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG3 + MIC_EINPOS + EFPFLAG3 + 0 + + + + + + + Customer flag 4 + Kundenspezifisches Ja/Nein Feld 4 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG4 + MIC_EINPOS + EFPFLAG4 + 0 + + + + + + + Customer flag 5 + Kundenspezifisches Ja/Nein Feld 5 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG5 + MIC_EINPOS + EFPFLAG5 + 0 + + + + + + + Customer flag 6 + Kundenspezifisches Ja/Nein Feld 6 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG6 + MIC_EINPOS + EFPFLAG6 + 0 + + + + + + + Customer flag 7 + Kundenspezifisches Ja/Nein Feld 7 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG7 + MIC_EINPOS + EFPFLAG7 + 0 + + + + + + + Customer flag 8 + Kundenspezifisches Ja/Nein Feld 8 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG8 + MIC_EINPOS + EFPFLAG8 + 0 + + + + + + + Customer flag 9 + Kundenspezifisches Ja/Nein Feld 9 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG9 + MIC_EINPOS + EFPFLAG9 + 0 + + + + + + + Customer flag 10 + Kundenspezifisches Ja/Nein Feld 10 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG10 + MIC_EINPOS + EFPFLAG10 + 0 + + + + + + + Customer flag 11 + Kundenspezifisches Ja/Nein Feld 11 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG11 + MIC_EINPOS + EFPFLAG11 + 0 + + + + + + + Customer flag 12 + Kundenspezifisches Ja/Nein Feld 12 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG12 + MIC_EINPOS + EFPFLAG12 + 0 + + + + + + + Customer flag 13 + Kundenspezifisches Ja/Nein Feld 13 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG13 + MIC_EINPOS + EFPFLAG13 + 0 + + + + + + + Customer flag 14 + Kundenspezifisches Ja/Nein Feld 14 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG14 + MIC_EINPOS + EFPFLAG14 + 0 + + + + + + + Customer flag 15 + Kundenspezifisches Ja/Nein Feld 15 + + + false + Boolean + + MIC_ALL_EAVPOS + EAPFLAG15 + MIC_EINPOS + EFPFLAG15 + 0 + + + + + + + Customer number 1 + Kundenspezifisches Nummernfeld 1 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER1 + MIC_EINPOS + EFPNUMBER1 + 10 + + + + + + + Customer number 2 + Kundenspezifisches Nummernfeld 2 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER2 + MIC_EINPOS + EFPNUMBER2 + 10 + + + + + + + Customer number 3 + Kundenspezifisches Nummernfeld 3 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER3 + MIC_EINPOS + EFPNUMBER3 + 10 + + + + + + + Customer number 4 + Kundenspezifisches Nummernfeld 4 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER4 + MIC_EINPOS + EFPNUMBER4 + 10 + + + + + + + Customer number 5 + Kundenspezifisches Nummernfeld 5 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER5 + MIC_EINPOS + EFPNUMBER5 + 10 + + + + + + + Customer number 6 + Kundenspezifisches Nummernfeld 6 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER6 + MIC_EINPOS + EFPNUMBER6 + 10 + + + + + + + Customer number 7 + Kundenspezifisches Nummernfeld 7 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER7 + MIC_EINPOS + EFPNUMBER7 + 10 + + + + + + + Customer number 8 + Kundenspezifisches Nummernfeld 8 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER8 + MIC_EINPOS + EFPNUMBER8 + 10 + + + + + + + Customer number 9 + Kundenspezifisches Nummernfeld 9 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER9 + MIC_EINPOS + EFPNUMBER9 + 10 + + + + + + + Customer number 10 + Kundenspezifisches Nummernfeld 10 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER10 + MIC_EINPOS + EFPNUMBER10 + 10 + + + + + + + Customer number 11 + Kundenspezifisches Nummernfeld 11 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER11 + MIC_EINPOS + EFPNUMBER11 + 10 + + + + + + + Customer number 12 + Kundenspezifisches Nummernfeld 12 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER12 + MIC_EINPOS + EFPNUMBER12 + 10 + + + + + + + Customer number 13 + Kundenspezifisches Nummernfeld 13 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER13 + MIC_EINPOS + EFPNUMBER13 + 10 + + + + + + + Customer number 14 + Kundenspezifisches Nummernfeld 14 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER14 + MIC_EINPOS + EFPNUMBER14 + 10 + + + + + + + Customer number 15 + Kundenspezifisches Nummernfeld 15 + + + false + Number(15,4) + + MIC_ALL_EAVPOS + EAPNUMBER15 + MIC_EINPOS + EFPNUMBER15 + 10 + + + + + + + + Data elements including payment information + + + + + + Payment Type + Zahlungsart + + + false + String1..2 + + MIC_ALL_EAVKOP + EAKPAYMENTTYPE + MIC_EINKOP + EFKPAYMENTTYPE + + + + + + + + + + + + + Payment Date + Zahlungstermin + + + false + xs:datetime + + MIC_ALL_EAVKOP + EAKPAYMENTDATE + MIC_EINKOP + EFKPAYMENTDATE + + + + + + + + + + + Payment Bank Code + Zahlungsbankleitzahl + + + false + String1..20 + + MIC_ALL_EAVKOP + EAKPAYMENTBANKCODE + MIC_EINKOP + EFKPAYMENTBANKCODE + + + + + + + + + + + + + Payment Bank Branch Code + Zahlung Bank Branch Code + + + false + String1..20 + + MIC_ALL_EAVKOP + EAKPAYMENTBANKBRANCHCODE + MIC_EINKOP + EFKPAYMENTBANKBRANCHCODE + + + + + + + + + + + + + Payment Currency + Zahlungswährung + + + false + String1..3 + + MIC_ALL_EAVKOP + EAKPAYMENTCURRENCY + MIC_EINKOP + EFKPAYMENTCURRENCY + + + + + + + + + + + + + + Data elements including registration numbers + + + + + + CRN / Registration No. + Registriernummer Abfertigung + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPMESSREGNR + MIC_EINPOS + EFPMESSREGNR + + + + + + + + + + + + + EGZ / Registration No. + Registriernummer EGZ + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPMESSREGNR2 + MIC_EINPOS + EFPMESSREGNR2 + + + + + + + + + + + + + Registr. No. 3 + Registriernummer 3 + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPMESSREGNR3 + MIC_EINPOS + EFPMESSREGNR3 + + + + + + + + + + + + + Registr. No. 4 + Registriernummer 4 + + + false + String1..35 + + MIC_ALL_EAVPOS + EAPMESSREGNR4 + MIC_EINPOS + EFPMESSREGNR4 + + + + + + + + + + + + + Registration Number Old (pre ATLAS 10.1) + Registriernummer Alt (vor ATLAS 10.1) + + + false + String1..22 + + + + MIC_EINPOS + EFPMESSREGNROLD + + + + + + + + + + + + + Registration Number 2 Old (pre ATLAS 10.1) + Registriernummer 2 Alt (vor ATLAS 10.1) + + + false + String1..22 + + + + MIC_EINPOS + EFPMESSREGNR2OLD + + + + + + + + + + + + + Message Ref Number 1 + Nachr.Referenz Abf. + + + false + String1..22 + + + + MIC_EINPOS + EFPMESSREFNR + + + + + + + + + + + + + Message Ref Number 2 + Nachr.Referenz EGZ + + + false + String1..52 + + + + MIC_EINPOS + EFPMESSREFNR2 + + + + + + + + + + + + + Message Ref Number 3 + Nachr.Referenz 3 + + + false + String1..22 + + + + MIC_EINPOS + EFPMESSREFNR3 + + + + + + + + + + + + + Position Number 1 + Positionnummer Abf. + + + false + Decimal(5) + + + + MIC_EINPOS + EFPMESSPOSNR1 + + + + + + + + + + + + + Position Number 2 + Positionsnummer EGZ. + + + false + Decimal(5) + + + + MIC_EINPOS + EFPMESSPOSNR2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Duties - calculated by external system + + + + false + + 0-n + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + Type of Identification + Art der Identifikation + + + true + String1..3 + + MIC_CUST_WB_EXTDUTY + EXWTYPE + MIC_CUST_WB_EXTDUTY + EXWTYPE + + + + + + + + + + + + + Calculated Duty Base + + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWCALCDUTYBASE + MIC_CUST_WB_EXTDUTY + EXWCALCDUTYBASE + + + + + + + + + + + + + + Currency + + + + false + String1..3 + + MIC_CUST_WB_EXTDUTY + EXWCURRENCY + MIC_CUST_WB_EXTDUTY + EXWCURRENCY + + + + + + + + + + + + + Code + Code + + + false + String1..4 + + MIC_CUST_WB_EXTDUTY + EXWCODE + MIC_CUST_WB_EXTDUTY + EXWCODE + + + + + + + + + + + + + Rate + Satz + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWRATE + MIC_CUST_WB_EXTDUTY + EXWRATE + + + + + + + + + + + + + + Amount + Betrag + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWAMOUNT + MIC_CUST_WB_EXTDUTY + EXWAMOUNT + + + + + + + + + + + + + + Add deduct + Abzug hinzufügen + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWADDDEDUCT + MIC_CUST_WB_EXTDUTY + EXWADDDEDUCT + + + + + + + + + + + + + + Calculated Duty + + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWCALCDUTY + MIC_CUST_WB_EXTDUTY + EXWCALCDUTY + + + + + + + + + + + + + + Duty + + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWDUTY + MIC_CUST_WB_EXTDUTY + EXWDUTY + + + + + + + + + + + + + + Duty base + + + + false + Decimal(14,4) + + MIC_CUST_WB_EXTDUTY + EXWDUTYBASE + MIC_CUST_WB_EXTDUTY + EXWDUTYBASE + + + + + + + + + + + + + + Measure Code + + + + false + String1..4 + + MIC_CUST_WB_EXTDUTY + EXWMEASURECODE + MIC_CUST_WB_EXTDUTY + EXWMEASURECODE + + + + + + + + + + + + + Measure + + + + false + String1..100 + + MIC_CUST_WB_EXTDUTY + EXWMEASURE + MIC_CUST_WB_EXTDUTY + EXWMEASURE + + + + + + + + + + + + + Authority duty code + + + + false + String1..4 + + MIC_CUST_WB_EXTDUTY + EXWAUTHORITYDUTYCODE + MIC_CUST_WB_EXTDUTY + EXWAUTHORITYDUTYCODE + + + + + + + + + + + + + Territory + + + + false + String1..4 + + MIC_CUST_WB_EXTDUTY + EXWTERRITORY + MIC_CUST_WB_EXTDUTY + EXWTERRITORY + + + + + + + + + + + + + Type add Code + + + + false + String1..1 + + MIC_CUST_WB_EXTDUTY + EXWTYPEADDCODE + MIC_CUST_WB_EXTDUTY + EXWTYPEADDCODE + + + + + + + + + + + + + Number add code + + + + false + String1..3 + + MIC_CUST_WB_EXTDUTY + EXWNUMBERADDCODE + MIC_CUST_WB_EXTDUTY + EXWNUMBERADDCODE + + + + + + + + + + + + + Tariff rate quota + + + + false + String1..6 + + MIC_CUST_WB_EXTDUTY + EXWTARIFFRATEQUOTA + MIC_CUST_WB_EXTDUTY + EXWTARIFFRATEQUOTA + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_CUST_WB_EXTDUTY + EXWCREUSER + MIC_CUST_WB_EXTDUTY + EXWCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_CUST_WB_EXTDUTY + EXWCREDAT + MIC_CUST_WB_EXTDUTY + EXWCREDAT + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_WB_EXTDUTY + EXWUSER + MIC_CUST_WB_EXTDUTY + EXWUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_WB_EXTDUTY + EXWUSEDAT + MIC_CUST_WB_EXTDUTY + EXWUSEDAT + + + + + + + + + + + + + + + + true + + + + + MIC_EINABG + + + + + + + + + + + + + Type + Abgabenart + + + true + String1..6 + + + + MIC_EINABG + EFAABART + + + + + + + + + + + + + Code + Code + + + true + String1..4 + + + + MIC_EINABG + EFACODE + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + true + Decimal(16,4) + + + + MIC_EINABG + EFAABGABE + + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + false + Decimal(16,4) + + + + MIC_EINABG + EFAABGABEZW + + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + false + String1..1 + + + + MIC_EINABG + EFAANLKZ + + + + + + + + + + + + + Unit + Einheit + + + false + String1..4 + + + + MIC_EINABG + EFABEMEH + + + + + + + + + + + + + Base + ATLAS Bemessungsgrundlage + + + false + Decimal(18,6) + + + + MIC_EINABG + EFABEMESSG + + + + + + + + + + + + + + Base + ATLAS Bemessungsgrundlage + + + false + String1..2 + + + + MIC_EINABG + EFACTRY + + + + + + + + + + + + + Calculated Duty + Abgabe + + + false + Decimal(16,4) + + + + MIC_EINABG + EFAERRABGABE + + + + + + + + + + + + + + Calculation Base + Bemessungsgrundlage + + + false + Decimal(18,6) + + + + MIC_EINABG + EFAERRBEMESSG + + + + + + + + + + + + + + Area Code + + + + false + String1..4 + + + + MIC_EINABG + EFAGEOGRGEBID + + + + + + + + + + + + + Measure + Massnahmenart + + + false + String1..6 + + + + MIC_EINABG + EFAMASSN + + + + + + + + + + + + + Measure + Massnahmenart + + + false + String1..4 + + + + MIC_EINABG + EFAOFFCODE + + + + + + + + + + + + + Indenture Number + + + + false + String1..6 + + + + MIC_EINABG + EFAORDNUNGSNR + + + + + + + + + + + + + Rate + Satz + + + false + Decimal(16,4) + + + + MIC_EINABG + EFASATZ + + + + + + + + + + + + + + Cancellation Flag + Storno + + + false + String1..1 + + + + MIC_EINABG + EFASTORNO + + + + + + + + + + + + + Duty amount increase or decrease + + + + false + Decimal(16,4) + + + + MIC_EINABG + EFAZUAB + + + + + + + + + + + + + + Type of additional code + + + + false + String1..1 + + + + MIC_EINABG + EFAZUSCDART + + + + + + + + + + + + + Number of additional code + + + + false + String1..3 + + + + MIC_EINABG + EFAZUSCDNR + + + + + + + + + + + + + Calculated duty rate + + + + false + Decimal(16,4) + + + + MIC_EINABG + EFAERRSATZ + + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + + + MIC_EINABG + EFACREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + + + MIC_EINABG + EFACREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + + + MIC_EINABG + EFAUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + + + MIC_EINABG + EFAUSEDAT + + + + + + + + + + + + + + + + true + + + + + MIC_CUST_DUTY_SAVING + + + + + + + + + + + + + Type + Abgabenart + + + false + String1..6 + + + + MIC_CUST_DUTY_SAVING + CDSDUTYTYPE + + + + + + + + + + + + + Code + Code + + + false + String1..4 + + + + MIC_CUST_DUTY_SAVING + CDSCODE + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSDUTY + + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSDUTYZW + + + + + + + + + + + + + + "A" for automatically created, "M" for manually created + Erstellungs KZ + + + false + String1..1 + + + + MIC_CUST_DUTY_SAVING + CDSCREATIONFLAG + + + + + + + + + + + + + Unit + Einheit + + + false + String1..4 + + + + MIC_CUST_DUTY_SAVING + CDSCALCBASEUNIT + + + + + + + + + + + + + Base + ATLAS Bemessungsgrundlage + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSCALCBASE + + + + + + + + + + + + + + Base + ATLAS Bemessungsgrundlage + + + false + String1..2 + + + + MIC_CUST_DUTY_SAVING + CDSCTRY + + + + + + + + + + + + + Duty + ATLAS Abgabe + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSCALCULATEDDUTY + + + + + + + + + + + + + + Base + ATLAS Bemessungsgrundlage + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSCALCULATEDCALCBASE + + + + + + + + + + + + + + Measure + Massnahmenart + + + false + String1..6 + + + + MIC_CUST_DUTY_SAVING + CDSMEASURE + + + + + + + + + + + + + Rate + Satz + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSRATE + + + + + + + + + + + + + + Addition + Zusatz + + + false + Decimal(16,4) + + + + MIC_CUST_DUTY_SAVING + CDSADDITION + + + + + + + + + + + + + + Preferential flag + Präferenziell + + + false + String1..1 + + + + MIC_CUST_DUTY_SAVING + CDSPREFERENTIAL + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + + + MIC_CUST_DUTY_SAVING + CDSCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + + + MIC_CUST_DUTY_SAVING + CDSCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + + + MIC_CUST_DUTY_SAVING + CDSUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + + + MIC_CUST_DUTY_SAVING + CDSUSEDAT + + + + + + + + + + + Container ID.mapped by 'eseconid' + + + + + + + + + + Validierungskennzeichen.mapped by 'esevalidkz' + + + + + + + + + + Storno.mapped by 'esestorno' + + + + + + + + + + Zeichen des angebrachten Verschlusses laut Versandanmeldung.mapped by 'esezeichensoll' + + + + + + + + + + Tatsächliches Zeichen des angebrachten Verschlusses..mapped by 'esezeichenist' + + + + + + + + + + + + + + + Company + Mandant + + + true + String1..2 + + MIC_ALL_EAVKOP + EAKMANDANT + + + + + + + + + + + + + + + Plant + Werk + + + true + String1..2 + + MIC_ALL_EAVKOP + EAKWERK + + + + + + + + + + + + + + + Type + + + + false + String1..1 + + MIC_ALL_EAVKOP + EAKTYP + + + + + + + + + + + + + + + The invoice number. + Rechnungsnummer + + + true + String1..30 + + MIC_ALL_EAVKOP + EAKFAKTNR + + + + + + + + + + + + + + + + An unique version id. + + + + false + String1..50 + + MIC_ALL_EAVKOP + EAKVERSION + + + + + + + + + + + + + + + The invoice date. + Rechnungsdatum + + + false + xs:date + + MIC_ALL_EAVKOP + EAKFAKTDAT + + + + + + + + + + + + + + + Customs date + + + + false + xs:dateTime + + MIC_ALL_EAVKOP + eakvzdat + + + + + + + + + + + + + Dispatch country + + + + false + String1..3 + + MIC_ALL_EAVKOP + eakheld + + + + + + + + + + + + + + + Last dispatch country + + + + false + String1..3 + + MIC_ALL_EAVKOP + eakleheld + + + + + + + + + + + + + + + Destination place + + + + false + String1..20 + + MIC_ALL_EAVKOP + eakbstort + + + + + + + + + + + + + + + Destination region + + + + false + String1..2 + + MIC_ALL_EAVKOP + destinationRegion + + + + + + + + + + + + + + + Office entry + + + + false + String1..8 + + MIC_ALL_EAVKOP + eakeinzost + + + + + + + + + + + + + + + + + The mode of transportation at the border. +EAKVKZGR +EAKVKMART +EAKVKML +EAKVKMGRK +EAKVKMINBEZ + + + + + The inland mode of transport information +EAKVKZIN +EAKVKMINK +EAKVKMINK + + + + + + + + + + false + + + MIC_EAVSDG + EAK___ + + + + + + + + + PreviousDocument + + + + + + + Previous doc type + Art des Vorpapiers + + + true + String1..3 + + MIC_ALL_EAVKOP + eakvssart + + + + + + + + + + + + + + + Previous doc number + Vorpapiernummer + + + true + String1..18 + + MIC_ALL_EAVKOP + eakvssnr + + + + + + + + + + + + + + + Previous doc date + Vorpapierdatum + + + true + xs:date + + MIC_EAVDOC + EADVSSDAT + + + + + + + + + + + + + + + + + + Shipment attributes + Rechnungsattribute + + + false + + 1-n + + + + + + + + + + + Business partner information + + + + + + + Invoice lines + Rechnungspositionen + + + true + + 1-n + + + + + + + + + + + + + + + + + Invoice type + Rechnungstyp + + + false + String1..3 + + MIC_ALL_EAVKOP + EAKFAKTTYP + MIC_EINKOP + EFKFAKTTYP + + + + + + + + + + + + + The contract date. + Vertragsdatum + + + false + xs:date + + MIC_ALL_EAVKOP + EAKDATVTG + MIC_EINKOP + EFKDATVTG + + + + + + + + Country of Trade + Handelsland + + + false + String1..3 + + MIC_ALL_EAVKOP + EAKHALD + MIC_EINKOP + EFKHALD + + + + + + + + + + + + + Supplier + Lieferant + + + false + + + MIC_ALL_EAVKOP + addrNo:EAKLFRNR, addrName:EAKLFRNM1,EAKLFRNM2, addrStreet:EAKLFRSTR, addrLoc:EAKLFRORT, addrCtry:EAKLFRLD, addrState:EAKLFRREGION, addrZip:EAKLFRPLZ, addrTin:EAKLFRTIN, addrEori:EAKLFREORI, partnerRelation:EAKLFRREL, addrDistrict:not mapped + + + + + + + + + + Gross Weight (kg) + Rohmasse (kg) + + + false + Decimal(17,4) + + MIC_ALL_EAVKOP + EAKROHMAS + MIC_EINKOP + EFKROHMAS + + + + + + + + + + + + + + Net Weight (kg)/The net weight of this invoice (sum of all invoice line net weights). + Eigenmasse (kg) + + + false + Decimal(15,6) + + MIC_ALL_EAVKOP + EAKGEWSUM + MIC_EINKOP + EFKGEWSUM + + + + + + + + + + + + + + Invoice Value/The total invoice value. + Rechnungswert + + + false + Decimal(17,4) + + MIC_ALL_EAVKOP + EAKLIEWERT + MIC_EINKOP + EFKLIEWERT + + + + + + + + + + + + + + Currency Invoice/The invoice currency as ISO currency code. + Währung Rechnung + + + false + String1..3 + + MIC_ALL_EAVKOP + EAKLIEWAE + MIC_EINKOP + EFKLIEWAE + + + + + + + + + + + + + Delivery terms + + + + false + + + + + + + + + + + + + + Rebate + Rabatt/Nachlass + + + false + + + + + + + + + + + + + + Discount/Discount for invoice value. + Skonto + + + false + Decimal(5,2) + + MIC_ALL_EAVKOP + EAKSKONTO + MIC_EINKOP + EFKSKONTO + + + + + + + + + + + + + + Additional costs can be added on all levels as additional part value components. They are pro-rated to the invoice lines as indicated. + + + + false + + 0-2 + MIC_ALL_EAVKOP + EAK___ + MIC_EINKOP + EFK___ + + + + + + + + Position additions/Additional remarks and information + Zusätzliche Angaben + + + false + String1..80 + + MIC_ALL_EAVKOP + EAKINFO + MIC_EINKOP + EFKINFO + + + + + + + + + + + + + Position additions/Additional remarks and information 2 + Zusätzliche Angaben 2 + + + false + String1..80 + + MIC_ALL_EAVKOP + EAKINFO2 + MIC_EINKOP + EAKINFO2 + + + + + + + + + + + + + Invoice freight costs + Sendungsfrachtkosten + + + + + + + + + + + + + + + Crossing Border Date + Grenz\u00FCbertritt + + + false + xs:date + + MIC_ALL_EAVKOP + EAKGRDAT + MIC_EINSDG + EFKGRDAT + + + + + + + + Reference Number + Referenznummer + + + false + String1..30 + + MIC_ALL_EAVKOP + EAKREFNR + MIC_EINKOP + EFKREFNR + + + + + + + + + + + + + Transport Number + Transportnummer + + + false + String1..20 + + MIC_ALL_EAVKOP + EAKTRANSPNR + MIC_EINKOP + EFKTRANSPNR + + + + + + + + + + + + + Type of Transport + Art des Transports + + + false + String1..10 + + MIC_ALL_EAVKOP + EAKTRANSPTYP + MIC_EINKOP + EFKTRANSPTYP + + + + + + + + + + + + + Acceptance Date + Datum der Annahme (ZiA) + + + false + xs:date + + MIC_ALL_EAVKOP + EAKANNAHMEDAT + MIC_EINSDG + EFSANNAHMEDAT + + + + + + + + Release Date + Datum der Überlassung (ZiA) + + + false + xs:date + + MIC_ALL_EAVKOP + EAKUEBERLASSDAT + MIC_EINSDG + EFSUEBERLASSDAT + + + + + + + + Frist (ZiA) + Term of Application + + + false + xs:date + + MIC_ALL_EAVKOP + EAKFRIST + MIC_EINSDG + EFSFRIST + + + + + + + + Customs Register Number + Registriernummer (ZiA) + + + false + String1..35 + + MIC_ALL_EAVKOP + EAKREGNR + MIC_EINSDG + EFSREGNR + + + + + + + + + + + + + Container number + Containernummer + + + false + String1..20 + + + + MIC_EINKOP + EFKCONTNR + + + + + + + + + + + + + Seal number + Verschlussnummer + + + false + String1..50 + + MIC_ALL_EAVKOP + EAKPLOMBE + MIC_EINKOP + EFKPLOMBE + + + + + + + + + + + + + Bill of lading + Konnossement / Frachtbrief + + + false + String1..20 + + MIC_ALL_EAVKOP + EAKBOL + MIC_EINKOP + EFKBOL + + + + + + + + + + + + + Number of Packages + Anzahl Packstücke + + + false + Decimal(6) + + MIC_ALL_EAVKOP + EAKKOLANZ + MIC_EINKOP + EFKKOLANZ + + + + + + + + + + + + + + Package Type + Packstückart + + + false + String1..15 + + MIC_ALL_EAVKOP + EAKKOLART + MIC_EINKOP + EFKKOLART + + + + + + + + + + + + + Buyer + Käufer + + + false + String1..15 + + MIC_ALL_EAVKOP + EAKKAUFNR + MIC_EINKOP + EFKKAUFNR + + + + + + + + + + + + + Consignee + Empfänger + + + false + String1..15 + + MIC_ALL_EAVKOP + EAKEMPNR + MIC_EINKOP + EFKEMPNR + + + + + + + + + + + + Data elements including payment information + + + + + + Customer specific fields + Kundenspezifische Felder + + + false + + + MIC_ALL_EAVKOP + eak___ + MIC_EINKOP + EFK___ + + + + + + + + Seller + Verkäufer + + + false + + + MIC_ALL_EAVKOP + addrNo:EAKSELLERNR, addrName:EAKSELLERNAME1,EAKSELLERNAME2, addrStreet:EAKSELLERSTREET, addrLoc:EAKSELLERPLACE, addrCtry:EAKSELLERCTRY, addrState:EAKORT, addrZip:EAKSELLERZIP, addrTin:EAKSELLERTIN, addrEori:EAKSELLEREORI, partnerRelation:EAKSELLERKVB, addrDistrict:not mapped, addrBranchNo:EAKSELLERBRANCHNO + + + + + + + + + + Exchange Rate + Wechselkurs + + + false + Decimal + + MIC_ALL_EAVKOP + EAKKURS + MIC_EINKOP + EFKKURS + + + + + + + + + + + Terms of delivery - UN location code + false + String1..17 + + MIC_ALL_EAVKOP + EAKELIUNLOCODE + MIC_EINKOP + EFKELIUNLOCODE + + + + + + + + + + + + + Terms of delivery - Country + false + String1..2 + + MIC_ALL_EAVKOP + EAKELICOUNTRY + MIC_EINKOP + EFKELICOUNTRY + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_ALL_EAVKOP + EAKCREUSER + MIC_EINKOP + EFKCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_ALL_EAVKOP + EAKCREADAT + MIC_EINKOP + EFKCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_ALL_EAVKOP + EAKUSER + MIC_EINKOP + EFKUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_ALL_EAVKOP + EAKUSEDAT + MIC_EINKOP + EFKUSEDAT + + + + + + + + + + + + false + + + MIC_ALL_EAVKOP + EAK___ + MIC_EINKOP + EFK___ + + + + + + + + + + Mapping to table MIC_CUST_WB_ATLAS_COMP_SUMD + + + + + + Completion parts + Beendigunsgsanteile + + + true + + + + + MIC_ATLAS_COMPLETION_SUMD + + + + + + + + + + + + + Type of Identification + Art der Identifikation + + + false + String1..3 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSIDTYPE + MIC_ATLAS_COMPLETION_SUMD + ACSIDTYPE + + + + + + + + + + + + + Quantity + Stückzahl + + + false + xs:long 5 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSQUANTITY + MIC_ATLAS_COMPLETION_SUMD + ACSQUANTITY + + + + + + + + + + + + + Package Type + Packstückart + + + false + String1..2 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSPACKAGETYPE + MIC_ATLAS_COMPLETION_SUMD + ACSPACKAGETYPE + + + + + + + + + + + + + Customs Register Number + Registriernummer (ZiA) + + + false + String1..21 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSREGNR + MIC_ATLAS_COMPLETION_SUMD + ACSREGNR + + + + + + + + + + + + + Position Number + Positionsnummer + + + false + xs:long 4 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSPOSNR + MIC_ATLAS_COMPLETION_SUMD + ACSPOSNR + + + + + + + + + + + + + Depository + Verwahrer + + + false + String1..17 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSDEPOSITOR + MIC_ATLAS_COMPLETION_SUMD + ACSDEPOSITOR + + + + + + + + + + + + + Type of specific defining argument + Art des spezifischen Ordnungsbegriffs + + + false + String1..3 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSSPECDEFTYPE + MIC_ATLAS_COMPLETION_SUMD + ACSSPECDEFTYPE + + + + + + + + + + + + + Specific defining argument + Spezifischer Ordnungsbegriff + + + false + String1..44 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSSPECDEFARG + MIC_ATLAS_COMPLETION_SUMD + ACSSPECDEFARG + + + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSCREUSER + MIC_ATLAS_COMPLETION_SUMD + ACSCREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSCREDAT + MIC_ATLAS_COMPLETION_SUMD + EFDCREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSUSER + MIC_ATLAS_COMPLETION_SUMD + ACSUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_WB_ATLAS_COMP_SUMD + ECSUSEDAT + MIC_ATLAS_COMPLETION_SUMD + ACSUSEDAT + + + + + + + + + + Invoice line previous document references + Positionsbeendigungsanteile Vorpapiere + + + + + + + Previous document reference + Beendigungsanteil Vorpapier + + + true + + 1-n + MIC_CUST_AVBEENDIGUNG + + MIC_CUST_BEENDIGUNG + + + + + + + + + + + Reference previous procedures + + + + + + + Reference type + Art des BE-Anteils + + + false + String1..4 + + MIC_CUST_AVBEENDIGUNG + MCBART + MIC_CUST_BEENDIGUNG + ECBART + + + + + + + + + + + + + Reference number + Bezugsnummer + + + false + String1..35 + + MIC_CUST_AVBEENDIGUNG + MCBBEZUGNR + MIC_CUST_BEENDIGUNG + ECBBEZUGNR + + + + + + + + + + + + + Authorization number + Bewilligungsnummer + + + false + String1..35 + + MIC_CUST_AVBEENDIGUNG + MCBBEWILLNR + MIC_CUST_BEENDIGUNG + ECBBEWILLNR + + + + + + + + + + + + + Registration number + Registriernummer Zugang + + + false + String1..70 + + MIC_CUST_AVBEENDIGUNG + MCBREGNR + MIC_CUST_BEENDIGUNG + ECBREGNR + + + + + + + + + + + + + Position number + Positionsnummer Zugang + + + false + Long 5 + + MIC_CUST_AVBEENDIGUNG + MCBZUGPOSNR + MIC_CUST_BEENDIGUNG + ECBZUGPOSNR + + + + + + + + + + + + + Part number + Artikelnummer + + + false + String1..30 + + MIC_CUST_AVBEENDIGUNG + MCBARTNR + MIC_CUST_BEENDIGUNG + ECBARTNR + + + + + + + + + + + + + Tariff number + Tarifnummer + + + false + String1..13 + + MIC_CUST_AVBEENDIGUNG + MCBTARNR + MIC_CUST_BEENDIGUNG + ECBTARNR + + + + + + + + + + + + + Trade quantity + Handelsmenge + + + false + Decimal(12,3) + + MIC_CUST_AVBEENDIGUNG + MCBHMENGE + MIC_CUST_BEENDIGUNG + ECBHMENGE + + + + + + + + + + + + + + Trade unit of measurement + Handelsmengeneinheit + + + false + String1..3 + + MIC_CUST_AVBEENDIGUNG + MCBHMEH + MIC_CUST_BEENDIGUNG + ECBHMEH + + + + + + + + + + + + + Trade qualifier + Handelsqualifikator + + + false + String1..1 + + MIC_CUST_AVBEENDIGUNG + MCBHQUAL + MIC_CUST_BEENDIGUNG + ECBHQUAL + + + + + + + + + + + + + Deduction quantity + Abbuchungsmenge + + + false + Decimal(12,3) + + MIC_CUST_AVBEENDIGUNG + MCBMENGE + MIC_CUST_BEENDIGUNG + ECBMENGE + + + + + + + + + + + + + + Deduction unit of measurement + Abbuchungsmengeneinheit + + + false + String1..3 + + MIC_CUST_AVBEENDIGUNG + MCBMEH + MIC_CUST_BEENDIGUNG + ECBMEH + + + + + + + + + + + + + Deduction qualifier + Abbuchungsqualifikator + + + false + String1..1 + + MIC_CUST_AVBEENDIGUNG + MCBQUAL + MIC_CUST_BEENDIGUNG + ECBQUAL + + + + + + + + + + + + + Additional information + Zusatzinformation + + + false + String1..4000 + + MIC_CUST_AVBEENDIGUNG + MCBINFO + MIC_CUST_BEENDIGUNG + ECBINFO + + + + + + + + + + + + + Normal treatment flag + Kennzeichen Normales Verfahren + + + false + xs:boolean + + MIC_CUST_AVBEENDIGUNG + MCBKZUEBLBEH + MIC_CUST_BEENDIGUNG + ECBKZUEBLBEH + + + + + + + + Atlas flag + ATLAS Kennzeichen + + + false + xs:boolean + + MIC_CUST_AVBEENDIGUNG + MCBKZATLAS + MIC_CUST_BEENDIGUNG + ECBKZATLAS + + + + + + + + Customs number + Zollnummer + + + false + String1..17 + + MIC_CUST_AVBEENDIGUNG + MCBZNRAB + MIC_CUST_BEENDIGUNG + ECBZNRAB + + + + + + + + + + + + + Statistical quantity + Statistiche Menge + + + false + Decimal(13,3) + + MIC_CUST_AVBEENDIGUNG + MCBBESM + MIC_CUST_BEENDIGUNG + ECBBESM + + + + + + + + + + + + + + Net mass + Eigenmasse (kg) + + + false + Decimal(13,4) + + MIC_CUST_AVBEENDIGUNG + MCBEIGMAS + MIC_CUST_BEENDIGUNG + ECBEIGMAS + + + + + + + + + + + + + + Gross mass + Rohmasse (kg) + + + false + Decimal(13,4) + + MIC_CUST_AVBEENDIGUNG + MCBROHMAS + MIC_CUST_BEENDIGUNG + ECBROHMAS + + + + + + + + + + + + + + Package quantity + Packstückanzahl + + + false + Decimal + + MIC_CUST_AVBEENDIGUNG + MCBKOLANZ + MIC_CUST_BEENDIGUNG + ECBKOLANZ + + + + + + + + Simple IPR application flag + Kennzeichen einfache Bewilligung für aktive Veredelung + + + false + xs:boolean + + MIC_CUST_AVBEENDIGUNG + MCBSIMPLEIPRAPPLICATION + MIC_CUST_BEENDIGUNG + ECBSIMPLEIPRAPPLICATION + + + + + + + + Supervising office + Überwachungszollstelle + + + false + String1..8 + + MIC_CUST_AVBEENDIGUNG + MCBSUPERVISINGOFFICE + MIC_CUST_BEENDIGUNG + ECBSUPERVISINGOFFICE + + + + + + + + + + + + + Type of package + Packstückart + + + false + String1..2 + + MIC_CUST_AVBEENDIGUNG + MCBTYPEOFPACKAGE + + + + + + + + + + + + + + + + Packages + + + + + + Package + Packstück + + + true + String1..8 + + MIC_CUST_WB_PACKAGES + + MIC_CUST_PACKAGES + + + + + + + + + + Import package type + + + + + + Signo + Zeichen/Nummer + + + true + String1..140 + + MIC_CUST_WB_PACKAGES + WBPSIGNO + MIC_CUST_PACKAGES + PCKSIGNO + + + + + + + + + + + Quantity + Menge + + + true + xs:long 15 + + MIC_CUST_WB_PACKAGES + WBPANZAR + MIC_CUST_PACKAGES + PCKANZAR + + + + + + + + + + + Package Type + Packstückart + + + true + String1..5 + + MIC_CUST_WB_PACKAGES + WBPART + MIC_CUST_PACKAGES + PCKART + + + + + + + + + + + + + + + + + false + + 0-n + + + + + + + + + + + + Attribute as name/value pair + + + + true + + + MIC_CUST_WB_EU_AUTH_HOLDER + + MIC_CUST_EU_AUTH_HOLDER + + + + + + + + + + Authorisation holder type + + + + + + Authorisation type code + Bewilligungsart-Code + + + true + String1..4 + + MIC_CUST_WB_EU_AUTH_HOLDER + WBATYPECD + MIC_CUST_EU_AUTH_HOLDER + AUHTYP + + + + + + + + + + + Identifier/EORI of authorisation holder + Identifikation + + + true + String1..17 + + MIC_CUST_WB_EU_AUTH_HOLDER + WBAID + MIC_CUST_EU_AUTH_HOLDER + AUHID + + + + + + + + + + + Reference number of authorisation holder + Referenznummer + + + true + String1..35 + + MIC_CUST_WB_EU_AUTH_HOLDER + WBAREFERENCENUMBER + MIC_CUST_EU_AUTH_HOLDER + AUHREFERENCENUMBER + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.Designer.vb new file mode 100644 index 00000000..202b02b7 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.Designer.vb @@ -0,0 +1,22110 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"MicCustImportMessage","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 MicCustImportMessage + + + Partial Public Class MicCustImportInvoiceComponent + +#Region "Private fields" + Private _invoice As List(Of TMicInvoice) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._invoice = New List(Of TMicInvoice)() + End Sub + + + Public Property Invoice() As List(Of TMicInvoice) + Get + Return Me._invoice + End Get + Set + Me._invoice = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MicCustImportInvoiceComponent)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent object + ''' + ''' string to deserialize + ''' Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent) 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 MicCustImportInvoiceComponent + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent + Return CType(SerializerXml.Deserialize(s), MicCustImportInvoiceComponent) + End Function +#End Region + + ''' + ''' Serializes current MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent object + ''' + ''' File to load and deserialize + ''' Output MicCustImportInvoiceComponent 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 MicCustImportInvoiceComponent, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportInvoiceComponent) + 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 MicCustImportInvoiceComponent) 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 MicCustImportInvoiceComponent + 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 TMicInvoice + +#Region "Private fields" + Private _invoiceNumber As String + + Private _invoiceVersion As String + + Private _invoiceDate As Date + + Private _invoiceHead As TMicInvoiceHead + + Private _attributes As TMicAttributes + + Private _documents As TMicDocuments + + Private _partners As TMicPartners + + Private _atlasCompletionSumDs As TMicAtlasCompletionSumD + + Private _intra As TMicCustIntra + + Private _invoiceLines As TMicInvoiceLines + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._invoiceLines = New TMicInvoiceLines() + Me._intra = New TMicCustIntra() + Me._atlasCompletionSumDs = New TMicAtlasCompletionSumD() + Me._partners = New TMicPartners() + Me._documents = New TMicDocuments() + Me._attributes = New TMicAttributes() + Me._invoiceHead = New TMicInvoiceHead() + End Sub + + Public Property invoiceNumber() As String + Get + Return Me._invoiceNumber + End Get + Set + Me._invoiceNumber = 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 InvoiceHead() As TMicInvoiceHead + Get + Return Me._invoiceHead + End Get + Set + Me._invoiceHead = Value + End Set + End Property + + Public Property Attributes() As TMicAttributes + Get + Return Me._attributes + End Get + Set + Me._attributes = Value + End Set + End Property + + Public Property Documents() As TMicDocuments + Get + Return Me._documents + End Get + Set + Me._documents = Value + End Set + End Property + + Public Property Partners() As TMicPartners + Get + Return Me._partners + End Get + Set + Me._partners = Value + End Set + End Property + + Public Property AtlasCompletionSumDs() As TMicAtlasCompletionSumD + Get + Return Me._atlasCompletionSumDs + End Get + Set + Me._atlasCompletionSumDs = Value + End Set + End Property + + Public Property Intra() As TMicCustIntra + Get + Return Me._intra + End Get + Set + Me._intra = Value + End Set + End Property + + Public Property InvoiceLines() As TMicInvoiceLines + Get + Return Me._invoiceLines + End Get + Set + Me._invoiceLines = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoice)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoice 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 TMicInvoice object + ''' + ''' string to deserialize + ''' Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoice) + 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 TMicInvoice) 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 TMicInvoice + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoice) + 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 TMicInvoice + Return CType(SerializerXml.Deserialize(s), TMicInvoice) + End Function +#End Region + + ''' + ''' Serializes current TMicInvoice 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 TMicInvoice object + ''' + ''' File to load and deserialize + ''' Output TMicInvoice 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 TMicInvoice, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoice) + 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 TMicInvoice) 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 TMicInvoice + 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 TMicInvoiceHead + +#Region "Private fields" + Private _invoiceType As String + + Private _contractDate As Date + + Private _countryOfTrade As String + + Private _supplier As TMicAddress + + Private _grossWeight As Decimal + + Private _netWeight As Decimal + + Private _invoiceValue As Decimal + + Private _invoiceCurrency As String + + Private _deliveryTerms As TMicDelTerm + + Private _rebate As TMicRebate + + Private _discount As Decimal + + Private _additionalCost As List(Of TMicAdditionalCosts) + + Private _text As String + + Private _text2 As String + + Private _freight As TMicFreightCostsInv + + Private _insurance As TMicInsuranceCostsInv + + Private _crossingBorderDate As Date + + Private _referenceNumber As String + + Private _transportNumber As String + + Private _transportType As String + + Private _acceptanceDate As Date + + Private _disposalDate As Date + + Private _timeLimit As Date + + Private _registrationNumber As String + + Private _containerNumber As String + + Private _sealNumber As String + + Private _billOfLading As String + + Private _packageCount As Decimal + + Private _packageType As String + + Private _buyer As String + + Private _consignee As String + + Private _paymentInformation As TMicImportPaymentInfo + + Private _customerFields As TMicImportCustomerFields + + Private _seller As TMicAddress + + Private _exchangeRate As Decimal + + Private _eliUnLocationCode As String + + Private _eliCountry As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _containerInfo As TMicContainer + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._containerInfo = New TMicContainer() + Me._seller = New TMicAddress() + Me._customerFields = New TMicImportCustomerFields() + Me._paymentInformation = New TMicImportPaymentInfo() + Me._insurance = New TMicInsuranceCostsInv() + Me._freight = New TMicFreightCostsInv() + Me._additionalCost = New List(Of TMicAdditionalCosts)() + Me._rebate = New TMicRebate() + Me._deliveryTerms = New TMicDelTerm() + Me._supplier = New TMicAddress() + End Sub + + Public Property invoiceType() As String + Get + Return Me._invoiceType + End Get + Set + Me._invoiceType = Value + End Set + End Property + + + Public Property contractDate() As Date + Get + Return Me._contractDate + End Get + Set + Me._contractDate = Value + End Set + End Property + + Public Property countryOfTrade() As String + Get + Return Me._countryOfTrade + End Get + Set + Me._countryOfTrade = Value + End Set + End Property + + Public Property Supplier() As TMicAddress + Get + Return Me._supplier + End Get + Set + Me._supplier = Value + End Set + End Property + + Public Property grossWeight() As Decimal + Get + Return Me._grossWeight + End Get + Set + Me._grossWeight = Value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = Value + End Set + End Property + + Public Property invoiceValue() As Decimal + Get + Return Me._invoiceValue + End Get + Set + Me._invoiceValue = Value + End Set + End Property + + Public Property invoiceCurrency() As String + Get + Return Me._invoiceCurrency + End Get + Set + Me._invoiceCurrency = Value + End Set + End Property + + Public Property deliveryTerms() As TMicDelTerm + Get + Return Me._deliveryTerms + End Get + Set + Me._deliveryTerms = Value + End Set + End Property + + Public Property Rebate() As TMicRebate + Get + Return Me._rebate + End Get + Set + Me._rebate = Value + End Set + End Property + + Public Property discount() As Decimal + Get + Return Me._discount + End Get + Set + Me._discount = Value + End Set + End Property + + + Public Property AdditionalCost() As List(Of TMicAdditionalCosts) + Get + Return Me._additionalCost + End Get + Set + Me._additionalCost = 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 text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property Freight() As TMicFreightCostsInv + Get + Return Me._freight + End Get + Set + Me._freight = Value + End Set + End Property + + Public Property Insurance() As TMicInsuranceCostsInv + Get + Return Me._insurance + End Get + Set + Me._insurance = 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 referenceNumber() As String + Get + Return Me._referenceNumber + End Get + Set + Me._referenceNumber = Value + End Set + End Property + + Public Property transportNumber() As String + Get + Return Me._transportNumber + End Get + Set + Me._transportNumber = 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 acceptanceDate() As Date + Get + Return Me._acceptanceDate + End Get + Set + Me._acceptanceDate = Value + End Set + End Property + + + Public Property disposalDate() As Date + Get + Return Me._disposalDate + End Get + Set + Me._disposalDate = Value + End Set + End Property + + + Public Property timeLimit() As Date + Get + Return Me._timeLimit + End Get + Set + Me._timeLimit = Value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = Value + End Set + End Property + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = 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 billOfLading() As String + Get + Return Me._billOfLading + End Get + Set + Me._billOfLading = Value + End Set + End Property + + Public Property packageCount() As Decimal + Get + Return Me._packageCount + End Get + Set + Me._packageCount = Value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = Value + End Set + End Property + + Public Property buyer() As String + Get + Return Me._buyer + End Get + Set + Me._buyer = Value + End Set + End Property + + Public Property consignee() As String + Get + Return Me._consignee + End Get + Set + Me._consignee = Value + End Set + End Property + + Public Property PaymentInformation() As TMicImportPaymentInfo + Get + Return Me._paymentInformation + End Get + Set + Me._paymentInformation = Value + End Set + End Property + + Public Property CustomerFields() As TMicImportCustomerFields + Get + Return Me._customerFields + End Get + Set + Me._customerFields = Value + End Set + End Property + + Public Property seller() As TMicAddress + Get + Return Me._seller + End Get + Set + Me._seller = 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 eliUnLocationCode() As String + Get + Return Me._eliUnLocationCode + End Get + Set + Me._eliUnLocationCode = Value + End Set + End Property + + Public Property eliCountry() As String + Get + Return Me._eliCountry + End Get + Set + Me._eliCountry = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Public Property ContainerInfo() As TMicContainer + Get + Return Me._containerInfo + End Get + Set + Me._containerInfo = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceHead)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceHead 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 TMicInvoiceHead object + ''' + ''' string to deserialize + ''' Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceHead) + 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 TMicInvoiceHead) 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 TMicInvoiceHead + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceHead) + 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 TMicInvoiceHead + Return CType(SerializerXml.Deserialize(s), TMicInvoiceHead) + End Function +#End Region + + ''' + ''' Serializes current TMicInvoiceHead 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 TMicInvoiceHead object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceHead 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 TMicInvoiceHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceHead) + 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 TMicInvoiceHead) 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 TMicInvoiceHead + 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 TMicAddress + +#Region "Private fields" + Private _addrNo As String + + Private _addrNoType 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 _partnerRelation As String + + Private _addrDistrict As String + + Private _addrBranchNo As String + + Private _email As String + + Private _addrVatNumber 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 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 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 partnerRelation() As String + Get + Return Me._partnerRelation + End Get + Set + Me._partnerRelation = Value + End Set + End Property + + Public Property addrDistrict() As String + Get + Return Me._addrDistrict + End Get + Set + Me._addrDistrict = Value + End Set + End Property + + Public Property addrBranchNo() As String + Get + Return Me._addrBranchNo + End Get + Set + Me._addrBranchNo = 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 addrVatNumber() As String + Get + Return Me._addrVatNumber + End Get + Set + Me._addrVatNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAddress)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAddress 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 TMicAddress object + ''' + ''' string to deserialize + ''' Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAddress) + 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 TMicAddress) 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 TMicAddress + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAddress) + 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 TMicAddress + Return CType(SerializerXml.Deserialize(s), TMicAddress) + End Function +#End Region + + ''' + ''' Serializes current TMicAddress 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 TMicAddress object + ''' + ''' File to load and deserialize + ''' Output TMicAddress 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 TMicAddress, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAddress) + 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 TMicAddress) 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 TMicAddress + 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 TMicAuthHolder + +#Region "Private fields" + Private _typeCode As String + + Private _identifier As String + + Private _referenceNumber As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property typeCode() As String + Get + Return Me._typeCode + End Get + Set + Me._typeCode = Value + End Set + End Property + + Public Property identifier() As String + Get + Return Me._identifier + End Get + Set + Me._identifier = Value + End Set + End Property + + Public Property referenceNumber() As String + Get + Return Me._referenceNumber + End Get + Set + Me._referenceNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolder)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAuthHolder 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 TMicAuthHolder object + ''' + ''' string to deserialize + ''' Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolder) + 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 TMicAuthHolder) 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 TMicAuthHolder + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAuthHolder) + 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 TMicAuthHolder + Return CType(SerializerXml.Deserialize(s), TMicAuthHolder) + End Function +#End Region + + ''' + ''' Serializes current TMicAuthHolder 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 TMicAuthHolder object + ''' + ''' File to load and deserialize + ''' Output TMicAuthHolder 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 TMicAuthHolder, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolder) + 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 TMicAuthHolder) 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 TMicAuthHolder + 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 TMicAuthHolders + +#Region "Private fields" + Private _authorisationHolder As List(Of TMicAuthHolder) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._authorisationHolder = New List(Of TMicAuthHolder)() + End Sub + + + Public Property AuthorisationHolder() As List(Of TMicAuthHolder) + Get + Return Me._authorisationHolder + End Get + Set + Me._authorisationHolder = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAuthHolders)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAuthHolders 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 TMicAuthHolders object + ''' + ''' string to deserialize + ''' Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolders) + 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 TMicAuthHolders) 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 TMicAuthHolders + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAuthHolders) + 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 TMicAuthHolders + Return CType(SerializerXml.Deserialize(s), TMicAuthHolders) + End Function +#End Region + + ''' + ''' Serializes current TMicAuthHolders 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 TMicAuthHolders object + ''' + ''' File to load and deserialize + ''' Output TMicAuthHolders 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 TMicAuthHolders, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAuthHolders) + 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 TMicAuthHolders) 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 TMicAuthHolders + 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 TMicPackageData + +#Region "Private fields" + Private _signo As String + + Private _numberOfPackages As Long + + Private _packageType As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property signo() As String + Get + Return Me._signo + End Get + Set + Me._signo = 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 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(TMicPackageData)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackageData 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 TMicPackageData object + ''' + ''' string to deserialize + ''' Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackageData) + 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 TMicPackageData) 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 TMicPackageData + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackageData) + 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 TMicPackageData + Return CType(SerializerXml.Deserialize(s), TMicPackageData) + End Function +#End Region + + ''' + ''' Serializes current TMicPackageData 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 TMicPackageData object + ''' + ''' File to load and deserialize + ''' Output TMicPackageData 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 TMicPackageData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackageData) + 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 TMicPackageData) 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 TMicPackageData + 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 TMicPackagesData + +#Region "Private fields" + Private _packageData As List(Of TMicPackageData) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._packageData = New List(Of TMicPackageData)() + End Sub + + + Public Property PackageData() As List(Of TMicPackageData) + Get + Return Me._packageData + End Get + Set + Me._packageData = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackagesData)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackagesData 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 TMicPackagesData object + ''' + ''' string to deserialize + ''' Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackagesData) + 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 TMicPackagesData) 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 TMicPackagesData + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackagesData) + 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 TMicPackagesData + Return CType(SerializerXml.Deserialize(s), TMicPackagesData) + End Function +#End Region + + ''' + ''' Serializes current TMicPackagesData 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 TMicPackagesData object + ''' + ''' File to load and deserialize + ''' Output TMicPackagesData 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 TMicPackagesData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackagesData) + 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 TMicPackagesData) 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 TMicPackagesData + 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 TReferencePreviousProcedure + +#Region "Private fields" + Private _referenceType As String + + Private _referenceNumber As String + + Private _authorisationNumber As String + + Private _registrationNumber As String + + Private _positionNumber As Long + + Private _partNumber As String + + Private _tariffNumber As String + + Private _tradeQuantity As Decimal + + Private _tradeUnitOfMeasurement As String + + Private _tradeQualifier As String + + Private _deductionQuantity As Decimal + + Private _deductionUnitOfMeasurement As String + + Private _deductionQualifier As String + + Private _additionalInformation As String + + Private _normalTreatmentFlag As Boolean + + Private _atlasFlag As Boolean + + Private _customsNumber As String + + Private _statisticalQuantity As Decimal + + Private _netMass As Decimal + + Private _grossMass As Decimal + + Private _packageQuantity As Decimal + + Private _simpleIprApplication As Boolean + + Private _supervisingOffice As String + + Private _packageType As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property referenceType() As String + Get + Return Me._referenceType + End Get + Set + Me._referenceType = 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 authorisationNumber() As String + Get + Return Me._authorisationNumber + End Get + Set + Me._authorisationNumber = Value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = Value + End Set + End Property + + Public Property positionNumber() As Long + Get + Return Me._positionNumber + End Get + Set + Me._positionNumber = Value + End Set + End Property + + Public Property partNumber() As String + Get + Return Me._partNumber + End Get + Set + Me._partNumber = Value + End Set + End Property + + Public Property tariffNumber() As String + Get + Return Me._tariffNumber + End Get + Set + Me._tariffNumber = Value + End Set + End Property + + Public Property tradeQuantity() As Decimal + Get + Return Me._tradeQuantity + End Get + Set + Me._tradeQuantity = Value + End Set + End Property + + Public Property tradeUnitOfMeasurement() As String + Get + Return Me._tradeUnitOfMeasurement + End Get + Set + Me._tradeUnitOfMeasurement = Value + End Set + End Property + + Public Property tradeQualifier() As String + Get + Return Me._tradeQualifier + End Get + Set + Me._tradeQualifier = Value + End Set + End Property + + Public Property deductionQuantity() As Decimal + Get + Return Me._deductionQuantity + End Get + Set + Me._deductionQuantity = Value + End Set + End Property + + Public Property deductionUnitOfMeasurement() As String + Get + Return Me._deductionUnitOfMeasurement + End Get + Set + Me._deductionUnitOfMeasurement = Value + End Set + End Property + + Public Property deductionQualifier() As String + Get + Return Me._deductionQualifier + End Get + Set + Me._deductionQualifier = Value + End Set + End Property + + Public Property additionalInformation() As String + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + Public Property normalTreatmentFlag() As Boolean + Get + Return Me._normalTreatmentFlag + End Get + Set + Me._normalTreatmentFlag = Value + End Set + End Property + + Public Property atlasFlag() As Boolean + Get + Return Me._atlasFlag + End Get + Set + Me._atlasFlag = Value + End Set + End Property + + Public Property customsNumber() As String + Get + Return Me._customsNumber + End Get + Set + Me._customsNumber = 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 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 packageQuantity() As Decimal + Get + Return Me._packageQuantity + End Get + Set + Me._packageQuantity = Value + End Set + End Property + + Public Property simpleIprApplication() As Boolean + 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 + + 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(TReferencePreviousProcedure)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TReferencePreviousProcedure 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 TReferencePreviousProcedure object + ''' + ''' string to deserialize + ''' Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedure) + 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 TReferencePreviousProcedure) 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 TReferencePreviousProcedure + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TReferencePreviousProcedure) + 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 TReferencePreviousProcedure + Return CType(SerializerXml.Deserialize(s), TReferencePreviousProcedure) + End Function +#End Region + + ''' + ''' Serializes current TReferencePreviousProcedure 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 TReferencePreviousProcedure object + ''' + ''' File to load and deserialize + ''' Output TReferencePreviousProcedure 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 TReferencePreviousProcedure, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedure) + 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 TReferencePreviousProcedure) 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 TReferencePreviousProcedure + 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 TReferencePreviousProcedures + +#Region "Private fields" + Private _referencePreviousProcedure As List(Of TReferencePreviousProcedure) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._referencePreviousProcedure = New List(Of TReferencePreviousProcedure)() + End Sub + + + Public Property ReferencePreviousProcedure() As List(Of TReferencePreviousProcedure) + Get + Return Me._referencePreviousProcedure + End Get + Set + Me._referencePreviousProcedure = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TReferencePreviousProcedures)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TReferencePreviousProcedures 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 TReferencePreviousProcedures object + ''' + ''' string to deserialize + ''' Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedures) + 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 TReferencePreviousProcedures) 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 TReferencePreviousProcedures + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TReferencePreviousProcedures) + 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 TReferencePreviousProcedures + Return CType(SerializerXml.Deserialize(s), TReferencePreviousProcedures) + End Function +#End Region + + ''' + ''' Serializes current TReferencePreviousProcedures 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 TReferencePreviousProcedures object + ''' + ''' File to load and deserialize + ''' Output TReferencePreviousProcedures 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 TReferencePreviousProcedures, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TReferencePreviousProcedures) + 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 TReferencePreviousProcedures) 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 TReferencePreviousProcedures + 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 TMicPreSupplier + +#Region "Private fields" + Private _infDutyValue As Decimal + + Private _infDutyRate As Decimal + + Private _infDuty As Decimal + + Private _infDutyCurrency As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property infDutyValue() As Decimal + Get + Return Me._infDutyValue + End Get + Set + Me._infDutyValue = Value + End Set + End Property + + Public Property infDutyRate() As Decimal + Get + Return Me._infDutyRate + End Get + Set + Me._infDutyRate = Value + End Set + End Property + + Public Property infDuty() As Decimal + Get + Return Me._infDuty + End Get + Set + Me._infDuty = Value + End Set + End Property + + Public Property infDutyCurrency() As String + Get + Return Me._infDutyCurrency + End Get + Set + Me._infDutyCurrency = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreSupplier)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreSupplier 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 TMicPreSupplier object + ''' + ''' string to deserialize + ''' Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreSupplier) + 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 TMicPreSupplier) 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 TMicPreSupplier + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreSupplier) + 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 TMicPreSupplier + Return CType(SerializerXml.Deserialize(s), TMicPreSupplier) + End Function +#End Region + + ''' + ''' Serializes current TMicPreSupplier 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 TMicPreSupplier object + ''' + ''' File to load and deserialize + ''' Output TMicPreSupplier 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 TMicPreSupplier, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreSupplier) + 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 TMicPreSupplier) 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 TMicPreSupplier + 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 TMicCustIntraLine + +#Region "Private fields" + Private _status As String + + Private _invoiceDate As Date + + Private _period As Long + + Private _region As String + + Private _statisticalProcedure As String + + Private _statisticalValue As Decimal + + Private _additionalCostsCurrency1 As String + + Private _additionalCostsType1 As String + + Private _additionalCostsCurrency2 As String + + Private _additionalCostsType2 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property status() As String + Get + Return Me._status + End Get + Set + Me._status = 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 period() As Long + Get + Return Me._period + End Get + Set + Me._period = Value + End Set + End Property + + Public Property region() As String + Get + Return Me._region + End Get + Set + Me._region = Value + End Set + End Property + + Public Property statisticalProcedure() As String + Get + Return Me._statisticalProcedure + End Get + Set + Me._statisticalProcedure = Value + End Set + End Property + + Public Property statisticalValue() As Decimal + Get + Return Me._statisticalValue + End Get + Set + Me._statisticalValue = Value + End Set + End Property + + Public Property additionalCostsCurrency1() As String + Get + Return Me._additionalCostsCurrency1 + End Get + Set + Me._additionalCostsCurrency1 = Value + End Set + End Property + + Public Property additionalCostsType1() As String + Get + Return Me._additionalCostsType1 + End Get + Set + Me._additionalCostsType1 = Value + End Set + End Property + + Public Property additionalCostsCurrency2() As String + Get + Return Me._additionalCostsCurrency2 + End Get + Set + Me._additionalCostsCurrency2 = Value + End Set + End Property + + Public Property additionalCostsType2() As String + Get + Return Me._additionalCostsType2 + End Get + Set + Me._additionalCostsType2 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntraLine)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCustIntraLine 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 TMicCustIntraLine object + ''' + ''' string to deserialize + ''' Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntraLine) + 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 TMicCustIntraLine) 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 TMicCustIntraLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCustIntraLine) + 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 TMicCustIntraLine + Return CType(SerializerXml.Deserialize(s), TMicCustIntraLine) + End Function +#End Region + + ''' + ''' Serializes current TMicCustIntraLine 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 TMicCustIntraLine object + ''' + ''' File to load and deserialize + ''' Output TMicCustIntraLine 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 TMicCustIntraLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntraLine) + 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 TMicCustIntraLine) 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 TMicCustIntraLine + 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 TMicImportLineAdditionalParams + +#Region "Private fields" + Private _cancel As String + + Private _codeNumber As String + + Private _countryGroup As String + + Private _condition1 As String + + Private _condition2 As String + + Private _vehicleTobaccoCode As String + + Private _specialProvision As String + + Private _relecantTime As Date + + Private _relecantTimePreference As Date + + Private _countryOfExportation As String + + Private _originCountry As String + + Private _purchaseCountry As String + + Private _defaultPrefDocType As String + + Private _defaultPrefDocSubType As String + + Private _temporarity As String + + Private _standardTreatment As String + + Private _quota1 As String + + Private _quotaNumber1 As String + + Private _quotaNumber2 As String + + Private _quota3 As String + + Private _quotaNumber3 As String + + Private _quotaAdditionalCodeFlag1 As String + + Private _quotaAdditionalCode1 As String + + Private _quotaAdditionalCodeFlag2 As String + + Private _quotaAdditionalCode2 As String + + Private _quotaAdditionalCodeFlag3 As String + + Private _quotaAdditionalCode3 As String + + Private _procedureCode As String + + Private _customsCalculationCode As String + + Private _customsCalculationZ As String + + Private _customsQuantity As Decimal + + Private _unitCustomsQuantity As String + + Private _customsValue As Decimal + + Private _levyUnit As Decimal + + Private _levyUnitUom As String + + Private _specialUnit As Decimal + + Private _specialUnitUom As String + + Private _specialValue As Decimal + + Private _salaryType1 As String + + Private _salaryShare1 As Decimal + + Private _salaryType2 As String + + Private _salaryShare2 As Decimal + + Private _salaryType3 As String + + Private _salaryShare3 As Decimal + + Private _salaryType4 As String + + Private _salaryShare4 As Decimal + + Private _salaryType5 As String + + Private _salaryShare5 As Decimal + + Private _salaryType6 As String + + Private _salaryShare6 As Decimal + + Private _exciseTax1 As String + + Private _exciseTaxQuantity1 As Decimal + + Private _exciseTaxUom1 As String + + Private _exciseTaxValue1 As Decimal + + Private _exciseTaxShare1 As Decimal + + Private _exciseTax2 As String + + Private _exciseTaxQuantity2 As Decimal + + Private _exciseTaxUom2 As String + + Private _exciseTaxValue2 As Decimal + + Private _exciseTaxShare2 As Decimal + + Private _exciseTax3 As String + + Private _exciseTaxQuantity3 As Decimal + + Private _exciseTaxUom3 As String + + Private _exciseTaxValue3 As Decimal + + Private _exciseTaxShare3 As Decimal + + Private _exciseTax4 As String + + Private _exciseTaxQuantity4 As Decimal + + Private _exciseTaxUom4 As String + + Private _exciseTaxValue4 As Decimal + + Private _exciseTaxShare4 As Decimal + + Private _exciseTax5 As String + + Private _exciseTaxQuantity5 As Decimal + + Private _exciseTaxUom5 As String + + Private _exciseTaxValue5 As Decimal + + Private _exciseTaxShare5 As Decimal + + Private _exciseTax6 As String + + Private _exciseTaxQuantity6 As Decimal + + Private _exciseTaxUom6 As String + + Private _exciseTaxValue6 As Decimal + + Private _exciseTaxShare6 As Decimal + + Private _specialCaseGroup1 As String + + Private _specialCaseType1 As String + + Private _specialCaseRate1 As Decimal + + Private _specialCaseGroup2 As String + + Private _specialCaseType2 As String + + Private _specialCaseRate2 As Decimal + + Private _specialCaseGroup3 As String + + Private _specialCaseType3 As String + + Private _specialCaseRate3 As Decimal + + Private _ivatCosts As Decimal + + Private _efagen As String + + Private _certificates As String + + Private _standards As String + + Private _importControl As String + + Private _insurance As String + + Private _establishment As String + + Private _procedure As String + + Private _licenseType As String + + Private _licenseNumber As String + + Private _exciseTaxQualificator1 As String + + Private _exciseTaxQualificator2 As String + + Private _exciseTaxQualificator3 As String + + Private _exciseTaxQualificator4 As String + + Private _exciseTaxQualificator5 As String + + Private _exciseTaxQualificator6 As String + + Private _quota As Decimal + + Private _quotaUom As String + + Private _quotaQualificator As String + + Private _location As String + + Private _taxCode1 As Long + + Private _taxCode2 As Long + + Private _taxCode3 As Long + + Private _taxCode4 As Long + + Private _taxCode5 As Long + + Private _taxCode6 As Long + + Private _tobaccoFlagNumber As String + + Private _subjectArea As String + + Private _completeInfoFlag As String + + Private _statisticStatus As String + + Private _chargeType As String + + Private _indirectPayment As Long + + Private _indirectPaymentCurrency As String + + Private _indirectPaymentFlag As String + + Private _indirectPaymentRate As Long + + Private _messageFlag22 As String + + Private _messageFlag55 As String + + Private _messageFlag77 As String + + Private _messageFlag90 As String + + Private _tariffNumber As String + + Private _shippingCountry As String + + Private _countryOfOrigin As String + + Private _netWeight As Decimal + + Private _partPrice As Long + + Private _prefRequestCode As String + + Private _positionNumber As Long + + Private _additionalCostsIVAT As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property cancel() As String + Get + Return Me._cancel + End Get + Set + Me._cancel = Value + End Set + End Property + + Public Property codeNumber() As String + Get + Return Me._codeNumber + End Get + Set + Me._codeNumber = Value + End Set + End Property + + Public Property countryGroup() As String + Get + Return Me._countryGroup + End Get + Set + Me._countryGroup = Value + End Set + End Property + + Public Property condition1() As String + Get + Return Me._condition1 + End Get + Set + Me._condition1 = Value + End Set + End Property + + Public Property condition2() As String + Get + Return Me._condition2 + End Get + Set + Me._condition2 = Value + End Set + End Property + + Public Property vehicleTobaccoCode() As String + Get + Return Me._vehicleTobaccoCode + End Get + Set + Me._vehicleTobaccoCode = Value + End Set + End Property + + Public Property specialProvision() As String + Get + Return Me._specialProvision + End Get + Set + Me._specialProvision = Value + End Set + End Property + + + Public Property relecantTime() As Date + Get + Return Me._relecantTime + End Get + Set + Me._relecantTime = Value + End Set + End Property + + + Public Property relecantTimePreference() As Date + Get + Return Me._relecantTimePreference + End Get + Set + Me._relecantTimePreference = Value + End Set + End Property + + Public Property countryOfExportation() As String + Get + Return Me._countryOfExportation + End Get + Set + Me._countryOfExportation = Value + End Set + End Property + + Public Property originCountry() As String + Get + Return Me._originCountry + End Get + Set + Me._originCountry = Value + End Set + End Property + + Public Property purchaseCountry() As String + Get + Return Me._purchaseCountry + End Get + Set + Me._purchaseCountry = Value + End Set + End Property + + Public Property defaultPrefDocType() As String + Get + Return Me._defaultPrefDocType + End Get + Set + Me._defaultPrefDocType = Value + End Set + End Property + + Public Property defaultPrefDocSubType() As String + Get + Return Me._defaultPrefDocSubType + End Get + Set + Me._defaultPrefDocSubType = Value + End Set + End Property + + Public Property temporarity() As String + Get + Return Me._temporarity + End Get + Set + Me._temporarity = Value + End Set + End Property + + Public Property standardTreatment() As String + Get + Return Me._standardTreatment + End Get + Set + Me._standardTreatment = Value + End Set + End Property + + Public Property quota1() As String + Get + Return Me._quota1 + End Get + Set + Me._quota1 = Value + End Set + End Property + + Public Property quotaNumber1() As String + Get + Return Me._quotaNumber1 + End Get + Set + Me._quotaNumber1 = Value + End Set + End Property + + Public Property quotaNumber2() As String + Get + Return Me._quotaNumber2 + End Get + Set + Me._quotaNumber2 = Value + End Set + End Property + + Public Property quota3() As String + Get + Return Me._quota3 + End Get + Set + Me._quota3 = Value + End Set + End Property + + Public Property quotaNumber3() As String + Get + Return Me._quotaNumber3 + End Get + Set + Me._quotaNumber3 = Value + End Set + End Property + + Public Property quotaAdditionalCodeFlag1() As String + Get + Return Me._quotaAdditionalCodeFlag1 + End Get + Set + Me._quotaAdditionalCodeFlag1 = Value + End Set + End Property + + Public Property quotaAdditionalCode1() As String + Get + Return Me._quotaAdditionalCode1 + End Get + Set + Me._quotaAdditionalCode1 = Value + End Set + End Property + + Public Property quotaAdditionalCodeFlag2() As String + Get + Return Me._quotaAdditionalCodeFlag2 + End Get + Set + Me._quotaAdditionalCodeFlag2 = Value + End Set + End Property + + Public Property quotaAdditionalCode2() As String + Get + Return Me._quotaAdditionalCode2 + End Get + Set + Me._quotaAdditionalCode2 = Value + End Set + End Property + + Public Property quotaAdditionalCodeFlag3() As String + Get + Return Me._quotaAdditionalCodeFlag3 + End Get + Set + Me._quotaAdditionalCodeFlag3 = Value + End Set + End Property + + Public Property quotaAdditionalCode3() As String + Get + Return Me._quotaAdditionalCode3 + End Get + Set + Me._quotaAdditionalCode3 = Value + End Set + End Property + + Public Property procedureCode() As String + Get + Return Me._procedureCode + End Get + Set + Me._procedureCode = Value + End Set + End Property + + Public Property customsCalculationCode() As String + Get + Return Me._customsCalculationCode + End Get + Set + Me._customsCalculationCode = Value + End Set + End Property + + Public Property customsCalculationZ() As String + Get + Return Me._customsCalculationZ + End Get + Set + Me._customsCalculationZ = Value + End Set + End Property + + Public Property customsQuantity() As Decimal + Get + Return Me._customsQuantity + End Get + Set + Me._customsQuantity = Value + End Set + End Property + + Public Property unitCustomsQuantity() As String + Get + Return Me._unitCustomsQuantity + End Get + Set + Me._unitCustomsQuantity = Value + End Set + End Property + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = Value + End Set + End Property + + Public Property levyUnit() As Decimal + Get + Return Me._levyUnit + End Get + Set + Me._levyUnit = Value + End Set + End Property + + Public Property levyUnitUom() As String + Get + Return Me._levyUnitUom + End Get + Set + Me._levyUnitUom = Value + End Set + End Property + + Public Property specialUnit() As Decimal + Get + Return Me._specialUnit + End Get + Set + Me._specialUnit = Value + End Set + End Property + + Public Property specialUnitUom() As String + Get + Return Me._specialUnitUom + End Get + Set + Me._specialUnitUom = Value + End Set + End Property + + Public Property specialValue() As Decimal + Get + Return Me._specialValue + End Get + Set + Me._specialValue = Value + End Set + End Property + + Public Property salaryType1() As String + Get + Return Me._salaryType1 + End Get + Set + Me._salaryType1 = Value + End Set + End Property + + Public Property salaryShare1() As Decimal + Get + Return Me._salaryShare1 + End Get + Set + Me._salaryShare1 = Value + End Set + End Property + + Public Property salaryType2() As String + Get + Return Me._salaryType2 + End Get + Set + Me._salaryType2 = Value + End Set + End Property + + Public Property salaryShare2() As Decimal + Get + Return Me._salaryShare2 + End Get + Set + Me._salaryShare2 = Value + End Set + End Property + + Public Property salaryType3() As String + Get + Return Me._salaryType3 + End Get + Set + Me._salaryType3 = Value + End Set + End Property + + Public Property salaryShare3() As Decimal + Get + Return Me._salaryShare3 + End Get + Set + Me._salaryShare3 = Value + End Set + End Property + + Public Property salaryType4() As String + Get + Return Me._salaryType4 + End Get + Set + Me._salaryType4 = Value + End Set + End Property + + Public Property salaryShare4() As Decimal + Get + Return Me._salaryShare4 + End Get + Set + Me._salaryShare4 = Value + End Set + End Property + + Public Property salaryType5() As String + Get + Return Me._salaryType5 + End Get + Set + Me._salaryType5 = Value + End Set + End Property + + Public Property salaryShare5() As Decimal + Get + Return Me._salaryShare5 + End Get + Set + Me._salaryShare5 = Value + End Set + End Property + + Public Property salaryType6() As String + Get + Return Me._salaryType6 + End Get + Set + Me._salaryType6 = Value + End Set + End Property + + Public Property salaryShare6() As Decimal + Get + Return Me._salaryShare6 + End Get + Set + Me._salaryShare6 = Value + End Set + End Property + + Public Property exciseTax1() As String + Get + Return Me._exciseTax1 + End Get + Set + Me._exciseTax1 = Value + End Set + End Property + + Public Property exciseTaxQuantity1() As Decimal + Get + Return Me._exciseTaxQuantity1 + End Get + Set + Me._exciseTaxQuantity1 = Value + End Set + End Property + + Public Property exciseTaxUom1() As String + Get + Return Me._exciseTaxUom1 + End Get + Set + Me._exciseTaxUom1 = Value + End Set + End Property + + Public Property exciseTaxValue1() As Decimal + Get + Return Me._exciseTaxValue1 + End Get + Set + Me._exciseTaxValue1 = Value + End Set + End Property + + Public Property exciseTaxShare1() As Decimal + Get + Return Me._exciseTaxShare1 + End Get + Set + Me._exciseTaxShare1 = Value + End Set + End Property + + Public Property exciseTax2() As String + Get + Return Me._exciseTax2 + End Get + Set + Me._exciseTax2 = Value + End Set + End Property + + Public Property exciseTaxQuantity2() As Decimal + Get + Return Me._exciseTaxQuantity2 + End Get + Set + Me._exciseTaxQuantity2 = Value + End Set + End Property + + Public Property exciseTaxUom2() As String + Get + Return Me._exciseTaxUom2 + End Get + Set + Me._exciseTaxUom2 = Value + End Set + End Property + + Public Property exciseTaxValue2() As Decimal + Get + Return Me._exciseTaxValue2 + End Get + Set + Me._exciseTaxValue2 = Value + End Set + End Property + + Public Property exciseTaxShare2() As Decimal + Get + Return Me._exciseTaxShare2 + End Get + Set + Me._exciseTaxShare2 = Value + End Set + End Property + + Public Property exciseTax3() As String + Get + Return Me._exciseTax3 + End Get + Set + Me._exciseTax3 = Value + End Set + End Property + + Public Property exciseTaxQuantity3() As Decimal + Get + Return Me._exciseTaxQuantity3 + End Get + Set + Me._exciseTaxQuantity3 = Value + End Set + End Property + + Public Property exciseTaxUom3() As String + Get + Return Me._exciseTaxUom3 + End Get + Set + Me._exciseTaxUom3 = Value + End Set + End Property + + Public Property exciseTaxValue3() As Decimal + Get + Return Me._exciseTaxValue3 + End Get + Set + Me._exciseTaxValue3 = Value + End Set + End Property + + Public Property exciseTaxShare3() As Decimal + Get + Return Me._exciseTaxShare3 + End Get + Set + Me._exciseTaxShare3 = Value + End Set + End Property + + Public Property exciseTax4() As String + Get + Return Me._exciseTax4 + End Get + Set + Me._exciseTax4 = Value + End Set + End Property + + Public Property exciseTaxQuantity4() As Decimal + Get + Return Me._exciseTaxQuantity4 + End Get + Set + Me._exciseTaxQuantity4 = Value + End Set + End Property + + Public Property exciseTaxUom4() As String + Get + Return Me._exciseTaxUom4 + End Get + Set + Me._exciseTaxUom4 = Value + End Set + End Property + + Public Property exciseTaxValue4() As Decimal + Get + Return Me._exciseTaxValue4 + End Get + Set + Me._exciseTaxValue4 = Value + End Set + End Property + + Public Property exciseTaxShare4() As Decimal + Get + Return Me._exciseTaxShare4 + End Get + Set + Me._exciseTaxShare4 = Value + End Set + End Property + + Public Property exciseTax5() As String + Get + Return Me._exciseTax5 + End Get + Set + Me._exciseTax5 = Value + End Set + End Property + + Public Property exciseTaxQuantity5() As Decimal + Get + Return Me._exciseTaxQuantity5 + End Get + Set + Me._exciseTaxQuantity5 = Value + End Set + End Property + + Public Property exciseTaxUom5() As String + Get + Return Me._exciseTaxUom5 + End Get + Set + Me._exciseTaxUom5 = Value + End Set + End Property + + Public Property exciseTaxValue5() As Decimal + Get + Return Me._exciseTaxValue5 + End Get + Set + Me._exciseTaxValue5 = Value + End Set + End Property + + Public Property exciseTaxShare5() As Decimal + Get + Return Me._exciseTaxShare5 + End Get + Set + Me._exciseTaxShare5 = Value + End Set + End Property + + Public Property exciseTax6() As String + Get + Return Me._exciseTax6 + End Get + Set + Me._exciseTax6 = Value + End Set + End Property + + Public Property exciseTaxQuantity6() As Decimal + Get + Return Me._exciseTaxQuantity6 + End Get + Set + Me._exciseTaxQuantity6 = Value + End Set + End Property + + Public Property exciseTaxUom6() As String + Get + Return Me._exciseTaxUom6 + End Get + Set + Me._exciseTaxUom6 = Value + End Set + End Property + + Public Property exciseTaxValue6() As Decimal + Get + Return Me._exciseTaxValue6 + End Get + Set + Me._exciseTaxValue6 = Value + End Set + End Property + + Public Property exciseTaxShare6() As Decimal + Get + Return Me._exciseTaxShare6 + End Get + Set + Me._exciseTaxShare6 = Value + End Set + End Property + + Public Property specialCaseGroup1() As String + Get + Return Me._specialCaseGroup1 + End Get + Set + Me._specialCaseGroup1 = Value + End Set + End Property + + Public Property specialCaseType1() As String + Get + Return Me._specialCaseType1 + End Get + Set + Me._specialCaseType1 = Value + End Set + End Property + + Public Property specialCaseRate1() As Decimal + Get + Return Me._specialCaseRate1 + End Get + Set + Me._specialCaseRate1 = Value + End Set + End Property + + Public Property specialCaseGroup2() As String + Get + Return Me._specialCaseGroup2 + End Get + Set + Me._specialCaseGroup2 = Value + End Set + End Property + + Public Property specialCaseType2() As String + Get + Return Me._specialCaseType2 + End Get + Set + Me._specialCaseType2 = Value + End Set + End Property + + Public Property specialCaseRate2() As Decimal + Get + Return Me._specialCaseRate2 + End Get + Set + Me._specialCaseRate2 = Value + End Set + End Property + + Public Property specialCaseGroup3() As String + Get + Return Me._specialCaseGroup3 + End Get + Set + Me._specialCaseGroup3 = Value + End Set + End Property + + Public Property specialCaseType3() As String + Get + Return Me._specialCaseType3 + End Get + Set + Me._specialCaseType3 = Value + End Set + End Property + + Public Property specialCaseRate3() As Decimal + Get + Return Me._specialCaseRate3 + End Get + Set + Me._specialCaseRate3 = Value + End Set + End Property + + Public Property ivatCosts() As Decimal + Get + Return Me._ivatCosts + End Get + Set + Me._ivatCosts = Value + End Set + End Property + + Public Property efagen() As String + Get + Return Me._efagen + End Get + Set + Me._efagen = Value + End Set + End Property + + Public Property certificates() As String + Get + Return Me._certificates + End Get + Set + Me._certificates = Value + End Set + End Property + + Public Property standards() As String + Get + Return Me._standards + End Get + Set + Me._standards = Value + End Set + End Property + + Public Property importControl() As String + Get + Return Me._importControl + End Get + Set + Me._importControl = Value + End Set + End Property + + Public Property insurance() As String + Get + Return Me._insurance + End Get + Set + Me._insurance = Value + End Set + End Property + + Public Property establishment() As String + Get + Return Me._establishment + End Get + Set + Me._establishment = Value + End Set + End Property + + Public Property procedure() As String + Get + Return Me._procedure + End Get + Set + Me._procedure = 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 exciseTaxQualificator1() As String + Get + Return Me._exciseTaxQualificator1 + End Get + Set + Me._exciseTaxQualificator1 = Value + End Set + End Property + + Public Property exciseTaxQualificator2() As String + Get + Return Me._exciseTaxQualificator2 + End Get + Set + Me._exciseTaxQualificator2 = Value + End Set + End Property + + Public Property exciseTaxQualificator3() As String + Get + Return Me._exciseTaxQualificator3 + End Get + Set + Me._exciseTaxQualificator3 = Value + End Set + End Property + + Public Property exciseTaxQualificator4() As String + Get + Return Me._exciseTaxQualificator4 + End Get + Set + Me._exciseTaxQualificator4 = Value + End Set + End Property + + Public Property exciseTaxQualificator5() As String + Get + Return Me._exciseTaxQualificator5 + End Get + Set + Me._exciseTaxQualificator5 = Value + End Set + End Property + + Public Property exciseTaxQualificator6() As String + Get + Return Me._exciseTaxQualificator6 + End Get + Set + Me._exciseTaxQualificator6 = Value + End Set + End Property + + Public Property quota() As Decimal + Get + Return Me._quota + End Get + Set + Me._quota = Value + End Set + End Property + + Public Property quotaUom() As String + Get + Return Me._quotaUom + End Get + Set + Me._quotaUom = Value + End Set + End Property + + Public Property quotaQualificator() As String + Get + Return Me._quotaQualificator + End Get + Set + Me._quotaQualificator = Value + End Set + End Property + + Public Property location() As String + Get + Return Me._location + End Get + Set + Me._location = Value + End Set + End Property + + Public Property taxCode1() As Long + Get + Return Me._taxCode1 + End Get + Set + Me._taxCode1 = Value + End Set + End Property + + Public Property taxCode2() As Long + Get + Return Me._taxCode2 + End Get + Set + Me._taxCode2 = Value + End Set + End Property + + Public Property taxCode3() As Long + Get + Return Me._taxCode3 + End Get + Set + Me._taxCode3 = Value + End Set + End Property + + Public Property taxCode4() As Long + Get + Return Me._taxCode4 + End Get + Set + Me._taxCode4 = Value + End Set + End Property + + Public Property taxCode5() As Long + Get + Return Me._taxCode5 + End Get + Set + Me._taxCode5 = Value + End Set + End Property + + Public Property taxCode6() As Long + Get + Return Me._taxCode6 + End Get + Set + Me._taxCode6 = Value + End Set + End Property + + Public Property tobaccoFlagNumber() As String + Get + Return Me._tobaccoFlagNumber + End Get + Set + Me._tobaccoFlagNumber = Value + End Set + End Property + + Public Property subjectArea() As String + Get + Return Me._subjectArea + End Get + Set + Me._subjectArea = Value + End Set + End Property + + Public Property completeInfoFlag() As String + Get + Return Me._completeInfoFlag + End Get + Set + Me._completeInfoFlag = Value + End Set + End Property + + Public Property statisticStatus() As String + Get + Return Me._statisticStatus + End Get + Set + Me._statisticStatus = Value + End Set + End Property + + Public Property chargeType() As String + Get + Return Me._chargeType + End Get + Set + Me._chargeType = Value + End Set + End Property + + Public Property indirectPayment() As Long + Get + Return Me._indirectPayment + End Get + Set + Me._indirectPayment = Value + End Set + End Property + + Public Property indirectPaymentCurrency() As String + Get + Return Me._indirectPaymentCurrency + End Get + Set + Me._indirectPaymentCurrency = Value + End Set + End Property + + Public Property indirectPaymentFlag() As String + Get + Return Me._indirectPaymentFlag + End Get + Set + Me._indirectPaymentFlag = Value + End Set + End Property + + Public Property indirectPaymentRate() As Long + Get + Return Me._indirectPaymentRate + End Get + Set + Me._indirectPaymentRate = Value + End Set + End Property + + Public Property messageFlag22() As String + Get + Return Me._messageFlag22 + End Get + Set + Me._messageFlag22 = Value + End Set + End Property + + Public Property messageFlag55() As String + Get + Return Me._messageFlag55 + End Get + Set + Me._messageFlag55 = Value + End Set + End Property + + Public Property messageFlag77() As String + Get + Return Me._messageFlag77 + End Get + Set + Me._messageFlag77 = Value + End Set + End Property + + Public Property messageFlag90() As String + Get + Return Me._messageFlag90 + End Get + Set + Me._messageFlag90 = Value + End Set + End Property + + Public Property tariffNumber() As String + Get + Return Me._tariffNumber + End Get + Set + Me._tariffNumber = Value + End Set + End Property + + Public Property shippingCountry() As String + Get + Return Me._shippingCountry + End Get + Set + Me._shippingCountry = Value + End Set + End Property + + Public Property countryOfOrigin() As String + Get + Return Me._countryOfOrigin + End Get + Set + Me._countryOfOrigin = Value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = Value + End Set + End Property + + Public Property partPrice() As Long + Get + Return Me._partPrice + End Get + Set + Me._partPrice = Value + End Set + End Property + + Public Property prefRequestCode() As String + Get + Return Me._prefRequestCode + End Get + Set + Me._prefRequestCode = Value + End Set + End Property + + Public Property positionNumber() As Long + Get + Return Me._positionNumber + End Get + Set + Me._positionNumber = Value + End Set + End Property + + Public Property additionalCostsIVAT() As Decimal + Get + Return Me._additionalCostsIVAT + End Get + Set + Me._additionalCostsIVAT = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineAdditionalParams)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams object + ''' + ''' string to deserialize + ''' Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams) 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 TMicImportLineAdditionalParams + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams + Return CType(SerializerXml.Deserialize(s), TMicImportLineAdditionalParams) + End Function +#End Region + + ''' + ''' Serializes current TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams object + ''' + ''' File to load and deserialize + ''' Output TMicImportLineAdditionalParams 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 TMicImportLineAdditionalParams, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineAdditionalParams) + 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 TMicImportLineAdditionalParams) 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 TMicImportLineAdditionalParams + 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 TMicOprInfo + +#Region "Private fields" + Private _dutyGroup1 As String + + Private _reductionAmount1 As Decimal + + Private _dutyGroup2 As String + + Private _reductionAmount2 As Decimal + + Private _dutyGroup3 As String + + Private _reductionAmount3 As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property dutyGroup1() As String + Get + Return Me._dutyGroup1 + End Get + Set + Me._dutyGroup1 = Value + End Set + End Property + + Public Property reductionAmount1() As Decimal + Get + Return Me._reductionAmount1 + End Get + Set + Me._reductionAmount1 = Value + End Set + End Property + + Public Property dutyGroup2() As String + Get + Return Me._dutyGroup2 + End Get + Set + Me._dutyGroup2 = Value + End Set + End Property + + Public Property reductionAmount2() As Decimal + Get + Return Me._reductionAmount2 + End Get + Set + Me._reductionAmount2 = Value + End Set + End Property + + Public Property dutyGroup3() As String + Get + Return Me._dutyGroup3 + End Get + Set + Me._dutyGroup3 = Value + End Set + End Property + + Public Property reductionAmount3() As Decimal + Get + Return Me._reductionAmount3 + End Get + Set + Me._reductionAmount3 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicOprInfo)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicOprInfo 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 TMicOprInfo object + ''' + ''' string to deserialize + ''' Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicOprInfo) + 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 TMicOprInfo) 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 TMicOprInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicOprInfo) + 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 TMicOprInfo + Return CType(SerializerXml.Deserialize(s), TMicOprInfo) + End Function +#End Region + + ''' + ''' Serializes current TMicOprInfo 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 TMicOprInfo object + ''' + ''' File to load and deserialize + ''' Output TMicOprInfo 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 TMicOprInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicOprInfo) + 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 TMicOprInfo) 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 TMicOprInfo + 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 TMicDutySaving + +#Region "Private fields" + Private _additionalCostsType As String + + Private _code As String + + Private _calculatedCustDuties As Decimal + + Private _amount As Decimal + + Private _creationFlag As String + + Private _unitOfMeasurment As String + + Private _calculationBase As Decimal + + Private _countryOfDuties As String + + Private _calculatedDuties As Decimal + + Private _calculatedAssessmentBasis As Decimal + + Private _measuresType As String + + Private _dutyRate As Decimal + + Private _addition As Decimal + + Private _preferentialFlag As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property additionalCostsType() As String + Get + Return Me._additionalCostsType + End Get + Set + Me._additionalCostsType = 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 calculatedCustDuties() As Decimal + Get + Return Me._calculatedCustDuties + End Get + Set + Me._calculatedCustDuties = 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 creationFlag() As String + Get + Return Me._creationFlag + End Get + Set + Me._creationFlag = Value + End Set + End Property + + Public Property unitOfMeasurment() As String + Get + Return Me._unitOfMeasurment + End Get + Set + Me._unitOfMeasurment = 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 countryOfDuties() As String + Get + Return Me._countryOfDuties + End Get + Set + Me._countryOfDuties = 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 calculatedAssessmentBasis() As Decimal + Get + Return Me._calculatedAssessmentBasis + End Get + Set + Me._calculatedAssessmentBasis = Value + End Set + End Property + + Public Property measuresType() As String + Get + Return Me._measuresType + End Get + Set + Me._measuresType = Value + End Set + End Property + + Public Property dutyRate() As Decimal + Get + Return Me._dutyRate + End Get + Set + Me._dutyRate = Value + End Set + End Property + + Public Property addition() As Decimal + Get + Return Me._addition + End Get + Set + Me._addition = Value + End Set + End Property + + Public Property preferentialFlag() As String + Get + Return Me._preferentialFlag + End Get + Set + Me._preferentialFlag = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySaving)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDutySaving 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 TMicDutySaving object + ''' + ''' string to deserialize + ''' Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySaving) + 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 TMicDutySaving) 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 TMicDutySaving + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutySaving) + 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 TMicDutySaving + Return CType(SerializerXml.Deserialize(s), TMicDutySaving) + End Function +#End Region + + ''' + ''' Serializes current TMicDutySaving 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 TMicDutySaving object + ''' + ''' File to load and deserialize + ''' Output TMicDutySaving 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 TMicDutySaving, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySaving) + 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 TMicDutySaving) 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 TMicDutySaving + 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 TMicDutySavings + +#Region "Private fields" + Private _dutySaving As List(Of TMicDutySaving) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._dutySaving = New List(Of TMicDutySaving)() + End Sub + + + Public Property DutySaving() As List(Of TMicDutySaving) + Get + Return Me._dutySaving + End Get + Set + Me._dutySaving = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDutySavings)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDutySavings 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 TMicDutySavings object + ''' + ''' string to deserialize + ''' Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySavings) + 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 TMicDutySavings) 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 TMicDutySavings + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDutySavings) + 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 TMicDutySavings + Return CType(SerializerXml.Deserialize(s), TMicDutySavings) + End Function +#End Region + + ''' + ''' Serializes current TMicDutySavings 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 TMicDutySavings object + ''' + ''' File to load and deserialize + ''' Output TMicDutySavings 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 TMicDutySavings, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDutySavings) + 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 TMicDutySavings) 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 TMicDutySavings + 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 _additionalCostsType As String + + Private _code As String + + Private _calculatedCustDuties As Decimal + + Private _amount As Decimal + + Private _creationFlag As String + + Private _unitOfMeasurment As String + + Private _calculationBase As Decimal + + Private _countryOfDuties As String + + Private _calculatedDuties As Decimal + + Private _calculatedAssessmentBasis As Decimal + + Private _areaCode As String + + Private _measuresType As String + + Private _dutyCodeCustomsOffice As String + + Private _indentureNumber As String + + Private _dutyRate As Decimal + + Private _stornoFlag As String + + Private _dutyAmountIncreaseOrDecrease As Decimal + + Private _typeOfAdditionalCode As String + + Private _noOfAdditionalCode As String + + Private _calculatedDutyRate As Decimal + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property additionalCostsType() As String + Get + Return Me._additionalCostsType + End Get + Set + Me._additionalCostsType = 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 calculatedCustDuties() As Decimal + Get + Return Me._calculatedCustDuties + End Get + Set + Me._calculatedCustDuties = 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 creationFlag() As String + Get + Return Me._creationFlag + End Get + Set + Me._creationFlag = Value + End Set + End Property + + Public Property unitOfMeasurment() As String + Get + Return Me._unitOfMeasurment + End Get + Set + Me._unitOfMeasurment = 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 countryOfDuties() As String + Get + Return Me._countryOfDuties + End Get + Set + Me._countryOfDuties = 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 calculatedAssessmentBasis() As Decimal + Get + Return Me._calculatedAssessmentBasis + End Get + Set + Me._calculatedAssessmentBasis = Value + End Set + End Property + + Public Property areaCode() As String + Get + Return Me._areaCode + End Get + Set + Me._areaCode = Value + End Set + End Property + + Public Property measuresType() As String + Get + Return Me._measuresType + End Get + Set + Me._measuresType = Value + End Set + End Property + + Public Property dutyCodeCustomsOffice() As String + Get + Return Me._dutyCodeCustomsOffice + End Get + Set + Me._dutyCodeCustomsOffice = Value + End Set + End Property + + Public Property indentureNumber() As String + Get + Return Me._indentureNumber + End Get + Set + Me._indentureNumber = Value + End Set + End Property + + Public Property dutyRate() As Decimal + Get + Return Me._dutyRate + End Get + Set + Me._dutyRate = Value + End Set + End Property + + Public Property stornoFlag() As String + Get + Return Me._stornoFlag + End Get + Set + Me._stornoFlag = Value + End Set + End Property + + Public Property dutyAmountIncreaseOrDecrease() As Decimal + Get + Return Me._dutyAmountIncreaseOrDecrease + End Get + Set + Me._dutyAmountIncreaseOrDecrease = Value + End Set + End Property + + Public Property typeOfAdditionalCode() As String + Get + Return Me._typeOfAdditionalCode + End Get + Set + Me._typeOfAdditionalCode = Value + End Set + End Property + + Public Property noOfAdditionalCode() As String + Get + Return Me._noOfAdditionalCode + End Get + Set + Me._noOfAdditionalCode = Value + End Set + End Property + + Public Property calculatedDutyRate() As Decimal + Get + Return Me._calculatedDutyRate + End Get + Set + Me._calculatedDutyRate = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = 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 _calcDutyBase As Decimal + + Private _currency As String + + Private _code As String + + Private _rate As Decimal + + Private _amount As Decimal + + Private _addDeduct As Decimal + + Private _calcDuty 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 _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + 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 calcDutyBase() As Decimal + Get + Return Me._calcDutyBase + End Get + Set + Me._calcDutyBase = 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 calcDuty() As Decimal + Get + Return Me._calcDuty + End Get + Set + Me._calcDuty = 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 + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = 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 TMicCalculatedValuesCust + +#Region "Private fields" + Private _customsValue As Decimal + + Private _netValue As Decimal + + Private _additionalStatisticalValue As Decimal + + Private _additionalCostsVat As Decimal + + Private _addStatisticValue As Decimal + + Private _freightCostsCommunity As Decimal + + Private _freightCostsInternational As Decimal + + Private _oprIngredientsValue As Decimal + + Private _additionalCosts1 As Decimal + + Private _additionalCosts2 As Decimal + + Private _additionalCosts3 As Decimal + + Private _additionalCosts4 As Decimal + + Private _additionalCosts5 As Decimal + + Private _additionalCosts6 As Decimal + + Private _additionalCosts7 As Decimal + + Private _additionalCosts8 As Decimal + + Private _additionalCosts9 As Decimal + + Private _additionalCosts10 As Decimal + + Private _additionalCosts11 As Decimal + + Private _additionalCosts12 As Decimal + + Private _additionalCosts13 As Decimal + + Private _additionalCosts14 As Decimal + + Private _additionalCosts15 As Decimal + + Private _additionalCosts16 As Decimal + + Private _additionalCosts17 As Decimal + + Private _additionalCosts18 As Decimal + + Private _additionalCosts19 As Decimal + + Private _additionalCosts20 As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = Value + End Set + End Property + + Public Property netValue() As Decimal + Get + Return Me._netValue + End Get + Set + Me._netValue = Value + End Set + End Property + + Public Property additionalStatisticalValue() As Decimal + Get + Return Me._additionalStatisticalValue + End Get + Set + Me._additionalStatisticalValue = Value + End Set + End Property + + Public Property additionalCostsVat() As Decimal + Get + Return Me._additionalCostsVat + End Get + Set + Me._additionalCostsVat = Value + End Set + End Property + + Public Property addStatisticValue() As Decimal + Get + Return Me._addStatisticValue + End Get + Set + Me._addStatisticValue = Value + End Set + End Property + + Public Property freightCostsCommunity() As Decimal + Get + Return Me._freightCostsCommunity + End Get + Set + Me._freightCostsCommunity = Value + End Set + End Property + + Public Property freightCostsInternational() As Decimal + Get + Return Me._freightCostsInternational + End Get + Set + Me._freightCostsInternational = Value + End Set + End Property + + Public Property oprIngredientsValue() As Decimal + Get + Return Me._oprIngredientsValue + End Get + Set + Me._oprIngredientsValue = Value + End Set + End Property + + Public Property additionalCosts1() As Decimal + Get + Return Me._additionalCosts1 + End Get + Set + Me._additionalCosts1 = Value + End Set + End Property + + Public Property additionalCosts2() As Decimal + Get + Return Me._additionalCosts2 + End Get + Set + Me._additionalCosts2 = Value + End Set + End Property + + Public Property additionalCosts3() As Decimal + Get + Return Me._additionalCosts3 + End Get + Set + Me._additionalCosts3 = Value + End Set + End Property + + Public Property additionalCosts4() As Decimal + Get + Return Me._additionalCosts4 + End Get + Set + Me._additionalCosts4 = Value + End Set + End Property + + Public Property additionalCosts5() As Decimal + Get + Return Me._additionalCosts5 + End Get + Set + Me._additionalCosts5 = Value + End Set + End Property + + Public Property additionalCosts6() As Decimal + Get + Return Me._additionalCosts6 + End Get + Set + Me._additionalCosts6 = Value + End Set + End Property + + Public Property additionalCosts7() As Decimal + Get + Return Me._additionalCosts7 + End Get + Set + Me._additionalCosts7 = Value + End Set + End Property + + Public Property additionalCosts8() As Decimal + Get + Return Me._additionalCosts8 + End Get + Set + Me._additionalCosts8 = Value + End Set + End Property + + Public Property additionalCosts9() As Decimal + Get + Return Me._additionalCosts9 + End Get + Set + Me._additionalCosts9 = Value + End Set + End Property + + Public Property additionalCosts10() As Decimal + Get + Return Me._additionalCosts10 + End Get + Set + Me._additionalCosts10 = Value + End Set + End Property + + Public Property additionalCosts11() As Decimal + Get + Return Me._additionalCosts11 + End Get + Set + Me._additionalCosts11 = Value + End Set + End Property + + Public Property additionalCosts12() As Decimal + Get + Return Me._additionalCosts12 + End Get + Set + Me._additionalCosts12 = Value + End Set + End Property + + Public Property additionalCosts13() As Decimal + Get + Return Me._additionalCosts13 + End Get + Set + Me._additionalCosts13 = Value + End Set + End Property + + Public Property additionalCosts14() As Decimal + Get + Return Me._additionalCosts14 + End Get + Set + Me._additionalCosts14 = Value + End Set + End Property + + Public Property additionalCosts15() As Decimal + Get + Return Me._additionalCosts15 + End Get + Set + Me._additionalCosts15 = Value + End Set + End Property + + Public Property additionalCosts16() As Decimal + Get + Return Me._additionalCosts16 + End Get + Set + Me._additionalCosts16 = Value + End Set + End Property + + Public Property additionalCosts17() As Decimal + Get + Return Me._additionalCosts17 + End Get + Set + Me._additionalCosts17 = Value + End Set + End Property + + Public Property additionalCosts18() As Decimal + Get + Return Me._additionalCosts18 + End Get + Set + Me._additionalCosts18 = Value + End Set + End Property + + Public Property additionalCosts19() As Decimal + Get + Return Me._additionalCosts19 + End Get + Set + Me._additionalCosts19 = Value + End Set + End Property + + Public Property additionalCosts20() As Decimal + Get + Return Me._additionalCosts20 + End Get + Set + Me._additionalCosts20 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValuesCust)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCalculatedValuesCust 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 TMicCalculatedValuesCust object + ''' + ''' string to deserialize + ''' Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust) 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 TMicCalculatedValuesCust + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust + Return CType(SerializerXml.Deserialize(s), TMicCalculatedValuesCust) + End Function +#End Region + + ''' + ''' Serializes current TMicCalculatedValuesCust 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 TMicCalculatedValuesCust object + ''' + ''' File to load and deserialize + ''' Output TMicCalculatedValuesCust 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 TMicCalculatedValuesCust, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValuesCust) + 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 TMicCalculatedValuesCust) 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 TMicCalculatedValuesCust + 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 TMicCalculatedValues + +#Region "Private fields" + Private _customsValue As Decimal + + Private _netValue As Decimal + + Private _statValue As Decimal + + Private _freightStatVal As Decimal + + Private _freightInternational As Decimal + + Private _freightEU As Decimal + + Private _freightNational As Decimal + + Private _insurance As Decimal + + Private _shipAddCosts As List(Of Decimal) + + Private _invAddCosts As List(Of Decimal) + + Private _lineAddCosts As List(Of Decimal) + + Private _custValue As Decimal + + Private _assistValue As Decimal + + Private _vatAddCosts As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._lineAddCosts = New List(Of Decimal)() + Me._invAddCosts = New List(Of Decimal)() + Me._shipAddCosts = New List(Of Decimal)() + End Sub + + Public Property customsValue() As Decimal + Get + Return Me._customsValue + End Get + Set + Me._customsValue = Value + End Set + End Property + + Public Property netValue() As Decimal + Get + Return Me._netValue + End Get + Set + Me._netValue = Value + End Set + End Property + + Public Property statValue() As Decimal + Get + Return Me._statValue + End Get + Set + Me._statValue = Value + End Set + End Property + + Public Property freightStatVal() As Decimal + Get + Return Me._freightStatVal + End Get + Set + Me._freightStatVal = Value + End Set + End Property + + Public Property freightInternational() As Decimal + Get + Return Me._freightInternational + End Get + Set + Me._freightInternational = Value + End Set + End Property + + Public Property freightEU() As Decimal + Get + Return Me._freightEU + End Get + Set + Me._freightEU = Value + End Set + End Property + + Public Property freightNational() As Decimal + Get + Return Me._freightNational + End Get + Set + Me._freightNational = Value + End Set + End Property + + Public Property insurance() As Decimal + Get + Return Me._insurance + End Get + Set + Me._insurance = Value + End Set + End Property + + + Public Property shipAddCosts() As List(Of Decimal) + Get + Return Me._shipAddCosts + End Get + Set + Me._shipAddCosts = Value + End Set + End Property + + + Public Property invAddCosts() As List(Of Decimal) + Get + Return Me._invAddCosts + End Get + Set + Me._invAddCosts = Value + End Set + End Property + + + Public Property lineAddCosts() As List(Of Decimal) + Get + Return Me._lineAddCosts + End Get + Set + Me._lineAddCosts = Value + End Set + End Property + + Public Property custValue() As Decimal + Get + Return Me._custValue + End Get + Set + Me._custValue = Value + End Set + End Property + + Public Property assistValue() As Decimal + Get + Return Me._assistValue + End Get + Set + Me._assistValue = Value + End Set + End Property + + Public Property vatAddCosts() As Decimal + Get + Return Me._vatAddCosts + End Get + Set + Me._vatAddCosts = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCalculatedValues)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCalculatedValues 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 TMicCalculatedValues object + ''' + ''' string to deserialize + ''' Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValues) + 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 TMicCalculatedValues) 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 TMicCalculatedValues + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCalculatedValues) + 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 TMicCalculatedValues + Return CType(SerializerXml.Deserialize(s), TMicCalculatedValues) + End Function +#End Region + + ''' + ''' Serializes current TMicCalculatedValues 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 TMicCalculatedValues object + ''' + ''' File to load and deserialize + ''' Output TMicCalculatedValues 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 TMicCalculatedValues, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCalculatedValues) + 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 TMicCalculatedValues) 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 TMicCalculatedValues + 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 TMicDetailContainerInfo + +#Region "Private fields" + Private _containerNumber As String + + Private _containerSealNumber As String + + Private _containerPackages As Decimal + + Private _containerGrossWeight As Decimal + + Private _containerNetWeight As Decimal + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = Value + End Set + End Property + + Public Property containerSealNumber() As String + Get + Return Me._containerSealNumber + End Get + Set + Me._containerSealNumber = Value + End Set + End Property + + Public Property containerPackages() As Decimal + Get + Return Me._containerPackages + End Get + Set + Me._containerPackages = Value + End Set + End Property + + Public Property containerGrossWeight() As Decimal + Get + Return Me._containerGrossWeight + End Get + Set + Me._containerGrossWeight = Value + End Set + End Property + + Public Property containerNetWeight() As Decimal + Get + Return Me._containerNetWeight + End Get + Set + Me._containerNetWeight = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDetailContainerInfo)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDetailContainerInfo 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 TMicDetailContainerInfo object + ''' + ''' string to deserialize + ''' Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDetailContainerInfo) + 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 TMicDetailContainerInfo) 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 TMicDetailContainerInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDetailContainerInfo) + 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 TMicDetailContainerInfo + Return CType(SerializerXml.Deserialize(s), TMicDetailContainerInfo) + End Function +#End Region + + ''' + ''' Serializes current TMicDetailContainerInfo 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 TMicDetailContainerInfo object + ''' + ''' File to load and deserialize + ''' Output TMicDetailContainerInfo 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 TMicDetailContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDetailContainerInfo) + 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 TMicDetailContainerInfo) 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 TMicDetailContainerInfo + 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 TMicContainerInfo + +#Region "Private fields" + Private _detailContainerInfo As List(Of TMicDetailContainerInfo) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._detailContainerInfo = New List(Of TMicDetailContainerInfo)() + End Sub + + + Public Property DetailContainerInfo() As List(Of TMicDetailContainerInfo) + Get + Return Me._detailContainerInfo + End Get + Set + Me._detailContainerInfo = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainerInfo)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicContainerInfo 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 TMicContainerInfo object + ''' + ''' string to deserialize + ''' Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainerInfo) + 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 TMicContainerInfo) 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 TMicContainerInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicContainerInfo) + 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 TMicContainerInfo + Return CType(SerializerXml.Deserialize(s), TMicContainerInfo) + End Function +#End Region + + ''' + ''' Serializes current TMicContainerInfo 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 TMicContainerInfo object + ''' + ''' File to load and deserialize + ''' Output TMicContainerInfo 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 TMicContainerInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainerInfo) + 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 TMicContainerInfo) 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 TMicContainerInfo + 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 TMicLinesCustomerFields + +#Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _text11 As String + + Private _text12 As String + + Private _text13 As String + + Private _text14 As String + + Private _text15 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _date11 As Date + + Private _date12 As Date + + Private _date13 As Date + + Private _date14 As Date + + Private _date15 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _flag11 As Boolean + + Private _flag12 As Boolean + + Private _flag13 As Boolean + + Private _flag14 As Boolean + + Private _flag15 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private _number11 As Decimal + + Private _number12 As Decimal + + Private _number13 As Decimal + + Private _number14 As Decimal + + Private _number15 As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = Value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = Value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = Value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = Value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = Value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = Value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = Value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = Value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = Value + End Set + End Property + + Public Property text11() As String + Get + Return Me._text11 + End Get + Set + Me._text11 = Value + End Set + End Property + + Public Property text12() As String + Get + Return Me._text12 + End Get + Set + Me._text12 = Value + End Set + End Property + + Public Property text13() As String + Get + Return Me._text13 + End Get + Set + Me._text13 = Value + End Set + End Property + + Public Property text14() As String + Get + Return Me._text14 + End Get + Set + Me._text14 = Value + End Set + End Property + + Public Property text15() As String + Get + Return Me._text15 + End Get + Set + Me._text15 = Value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = Value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = Value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = Value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = Value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = Value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = Value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = Value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = Value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = Value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = Value + End Set + End Property + + Public Property date11() As Date + Get + Return Me._date11 + End Get + Set + Me._date11 = Value + End Set + End Property + + Public Property date12() As Date + Get + Return Me._date12 + End Get + Set + Me._date12 = Value + End Set + End Property + + Public Property date13() As Date + Get + Return Me._date13 + End Get + Set + Me._date13 = Value + End Set + End Property + + Public Property date14() As Date + Get + Return Me._date14 + End Get + Set + Me._date14 = Value + End Set + End Property + + Public Property date15() As Date + Get + Return Me._date15 + End Get + Set + Me._date15 = Value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = Value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = Value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = Value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = Value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = Value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = Value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = Value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = Value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = Value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = Value + End Set + End Property + + Public Property flag11() As Boolean + Get + Return Me._flag11 + End Get + Set + Me._flag11 = Value + End Set + End Property + + Public Property flag12() As Boolean + Get + Return Me._flag12 + End Get + Set + Me._flag12 = Value + End Set + End Property + + Public Property flag13() As Boolean + Get + Return Me._flag13 + End Get + Set + Me._flag13 = Value + End Set + End Property + + Public Property flag14() As Boolean + Get + Return Me._flag14 + End Get + Set + Me._flag14 = Value + End Set + End Property + + Public Property flag15() As Boolean + Get + Return Me._flag15 + End Get + Set + Me._flag15 = Value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = Value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = Value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = Value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = Value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = Value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = Value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = Value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = Value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = Value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = Value + End Set + End Property + + Public Property number11() As Decimal + Get + Return Me._number11 + End Get + Set + Me._number11 = Value + End Set + End Property + + Public Property number12() As Decimal + Get + Return Me._number12 + End Get + Set + Me._number12 = Value + End Set + End Property + + Public Property number13() As Decimal + Get + Return Me._number13 + End Get + Set + Me._number13 = Value + End Set + End Property + + Public Property number14() As Decimal + Get + Return Me._number14 + End Get + Set + Me._number14 = Value + End Set + End Property + + Public Property number15() As Decimal + Get + Return Me._number15 + End Get + Set + Me._number15 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicLinesCustomerFields)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicLinesCustomerFields 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 TMicLinesCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLinesCustomerFields) + 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 TMicLinesCustomerFields) 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 TMicLinesCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicLinesCustomerFields) + 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 TMicLinesCustomerFields + Return CType(SerializerXml.Deserialize(s), TMicLinesCustomerFields) + End Function +#End Region + + ''' + ''' Serializes current TMicLinesCustomerFields 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 TMicLinesCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicLinesCustomerFields 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 TMicLinesCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLinesCustomerFields) + 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 TMicLinesCustomerFields) 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 TMicLinesCustomerFields + 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 TMicImportRegistrationNo + +#Region "Private fields" + Private _registrationNumber1 As String + + Private _registrationNumber2 As String + + Private _registrationNumber3 As String + + Private _registrationNumber4 As String + + Private _registrationNumberOld As String + + Private _registrationNumber2Old As String + + Private _messageRefNumber1 As String + + Private _messageRefNumber2 As String + + Private _messageRefNumber3 As String + + Private _positionNumber1 As Decimal + + Private _positionNumber2 As Decimal + + 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 registrationNumber4() As String + Get + Return Me._registrationNumber4 + End Get + Set + Me._registrationNumber4 = Value + End Set + End Property + + Public Property registrationNumberOld() As String + Get + Return Me._registrationNumberOld + End Get + Set + Me._registrationNumberOld = Value + End Set + End Property + + Public Property registrationNumber2Old() As String + Get + Return Me._registrationNumber2Old + End Get + Set + Me._registrationNumber2Old = Value + End Set + End Property + + Public Property messageRefNumber1() As String + Get + Return Me._messageRefNumber1 + End Get + Set + Me._messageRefNumber1 = Value + End Set + End Property + + Public Property messageRefNumber2() As String + Get + Return Me._messageRefNumber2 + End Get + Set + Me._messageRefNumber2 = Value + End Set + End Property + + Public Property messageRefNumber3() As String + Get + Return Me._messageRefNumber3 + End Get + Set + Me._messageRefNumber3 = Value + End Set + End Property + + Public Property positionNumber1() As Decimal + Get + Return Me._positionNumber1 + End Get + Set + Me._positionNumber1 = Value + End Set + End Property + + Public Property positionNumber2() As Decimal + Get + Return Me._positionNumber2 + End Get + Set + Me._positionNumber2 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportRegistrationNo)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportRegistrationNo 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 TMicImportRegistrationNo object + ''' + ''' string to deserialize + ''' Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportRegistrationNo) + 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 TMicImportRegistrationNo) 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 TMicImportRegistrationNo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportRegistrationNo) + 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 TMicImportRegistrationNo + Return CType(SerializerXml.Deserialize(s), TMicImportRegistrationNo) + End Function +#End Region + + ''' + ''' Serializes current TMicImportRegistrationNo 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 TMicImportRegistrationNo object + ''' + ''' File to load and deserialize + ''' Output TMicImportRegistrationNo 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 TMicImportRegistrationNo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportRegistrationNo) + 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 TMicImportRegistrationNo) 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 TMicImportRegistrationNo + 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 TMicReceipt + +#Region "Private fields" + Private _receiptNumber As String + + Private _receiptDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property receiptNumber() As String + Get + Return Me._receiptNumber + End Get + Set + Me._receiptNumber = Value + End Set + End Property + + + Public Property receiptDate() As Date + Get + Return Me._receiptDate + End Get + Set + Me._receiptDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicReceipt)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicReceipt 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 TMicReceipt object + ''' + ''' string to deserialize + ''' Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicReceipt) + 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 TMicReceipt) 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 TMicReceipt + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicReceipt) + 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 TMicReceipt + Return CType(SerializerXml.Deserialize(s), TMicReceipt) + End Function +#End Region + + ''' + ''' Serializes current TMicReceipt 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 TMicReceipt object + ''' + ''' File to load and deserialize + ''' Output TMicReceipt 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 TMicReceipt, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicReceipt) + 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 TMicReceipt) 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 TMicReceipt + 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 TMicPackage + +#Region "Private fields" + Private _packageCount As Decimal + + Private _packageType As String + + Private _packageDescription As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property packageCount() As Decimal + Get + Return Me._packageCount + End Get + Set + Me._packageCount = Value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = Value + End Set + End Property + + Public Property packageDescription() As String + Get + Return Me._packageDescription + End Get + Set + Me._packageDescription = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPackage)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPackage 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 TMicPackage object + ''' + ''' string to deserialize + ''' Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackage) + 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 TMicPackage) 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 TMicPackage + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPackage) + 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 TMicPackage + Return CType(SerializerXml.Deserialize(s), TMicPackage) + End Function +#End Region + + ''' + ''' Serializes current TMicPackage 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 TMicPackage object + ''' + ''' File to load and deserialize + ''' Output TMicPackage 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 TMicPackage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPackage) + 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 TMicPackage) 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 TMicPackage + 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 TMicBom + +#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(TMicBom)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicBom 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 TMicBom object + ''' + ''' string to deserialize + ''' Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicBom) + 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 TMicBom) 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 TMicBom + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicBom) + 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 TMicBom + Return CType(SerializerXml.Deserialize(s), TMicBom) + End Function +#End Region + + ''' + ''' Serializes current TMicBom 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 TMicBom object + ''' + ''' File to load and deserialize + ''' Output TMicBom 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 TMicBom, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicBom) + 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 TMicBom) 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 TMicBom + 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 TMicPreviousDocument + +#Region "Private fields" + Private _previousDocType As String + + Private _previousDocNumber As String + + Private _previousDocDate As Date + + Private _customsDate As Date + + Private _departureCustomsOffice As String + + Private _destinationCustomsOffice As String + + Private _type As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property previousDocType() As String + Get + Return Me._previousDocType + End Get + Set + Me._previousDocType = Value + End Set + End Property + + Public Property previousDocNumber() As String + Get + Return Me._previousDocNumber + End Get + Set + Me._previousDocNumber = Value + End Set + End Property + + + Public Property previousDocDate() As Date + Get + Return Me._previousDocDate + End Get + Set + Me._previousDocDate = Value + End Set + End Property + + + Public Property customsDate() As Date + Get + Return Me._customsDate + End Get + Set + Me._customsDate = Value + End Set + End Property + + Public Property departureCustomsOffice() As String + Get + Return Me._departureCustomsOffice + End Get + Set + Me._departureCustomsOffice = Value + End Set + End Property + + Public Property destinationCustomsOffice() As String + Get + Return Me._destinationCustomsOffice + End Get + Set + Me._destinationCustomsOffice = 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 creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocument)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreviousDocument 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 TMicPreviousDocument object + ''' + ''' string to deserialize + ''' Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocument) + 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 TMicPreviousDocument) 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 TMicPreviousDocument + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreviousDocument) + 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 TMicPreviousDocument + Return CType(SerializerXml.Deserialize(s), TMicPreviousDocument) + End Function +#End Region + + ''' + ''' Serializes current TMicPreviousDocument 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 TMicPreviousDocument object + ''' + ''' File to load and deserialize + ''' Output TMicPreviousDocument 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 TMicPreviousDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocument) + 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 TMicPreviousDocument) 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 TMicPreviousDocument + 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 TMicPreviousDocuments + +#Region "Private fields" + Private _previousDocument As List(Of TMicPreviousDocument) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._previousDocument = New List(Of TMicPreviousDocument)() + End Sub + + + Public Property PreviousDocument() As List(Of TMicPreviousDocument) + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPreviousDocuments)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPreviousDocuments 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 TMicPreviousDocuments object + ''' + ''' string to deserialize + ''' Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocuments) + 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 TMicPreviousDocuments) 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 TMicPreviousDocuments + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPreviousDocuments) + 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 TMicPreviousDocuments + Return CType(SerializerXml.Deserialize(s), TMicPreviousDocuments) + End Function +#End Region + + ''' + ''' Serializes current TMicPreviousDocuments 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 TMicPreviousDocuments object + ''' + ''' File to load and deserialize + ''' Output TMicPreviousDocuments 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 TMicPreviousDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPreviousDocuments) + 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 TMicPreviousDocuments) 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 TMicPreviousDocuments + 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 TMicAdditionalCostsVAT + +#Region "Private fields" + Private _addAmountVAT As Decimal + + Private _addCurrencyVAT As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property addAmountVAT() As Decimal + Get + Return Me._addAmountVAT + End Get + Set + Me._addAmountVAT = Value + End Set + End Property + + Public Property addCurrencyVAT() As String + Get + Return Me._addCurrencyVAT + End Get + Set + Me._addCurrencyVAT = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCostsVAT)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT object + ''' + ''' string to deserialize + ''' Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT) 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 TMicAdditionalCostsVAT + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT + Return CType(SerializerXml.Deserialize(s), TMicAdditionalCostsVAT) + End Function +#End Region + + ''' + ''' Serializes current TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT object + ''' + ''' File to load and deserialize + ''' Output TMicAdditionalCostsVAT 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 TMicAdditionalCostsVAT, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCostsVAT) + 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 TMicAdditionalCostsVAT) 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 TMicAdditionalCostsVAT + 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 TMicRebateLine + +#Region "Private fields" + Private _rebAmount As Decimal + + Private _rebCurrency As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property rebAmount() As Decimal + Get + Return Me._rebAmount + End Get + Set + Me._rebAmount = Value + End Set + End Property + + Public Property rebCurrency() As String + Get + Return Me._rebCurrency + End Get + Set + Me._rebCurrency = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebateLine)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicRebateLine 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 TMicRebateLine object + ''' + ''' string to deserialize + ''' Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebateLine) + 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 TMicRebateLine) 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 TMicRebateLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicRebateLine) + 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 TMicRebateLine + Return CType(SerializerXml.Deserialize(s), TMicRebateLine) + End Function +#End Region + + ''' + ''' Serializes current TMicRebateLine 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 TMicRebateLine object + ''' + ''' File to load and deserialize + ''' Output TMicRebateLine 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 TMicRebateLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebateLine) + 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 TMicRebateLine) 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 TMicRebateLine + 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 TMicInsuranceCostsLine + +#Region "Private fields" + Private _insAmount As Decimal + + Private _insCurrency As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property insAmount() As Decimal + Get + Return Me._insAmount + End Get + Set + Me._insAmount = Value + End Set + End Property + + Public Property insCurrency() As String + Get + Return Me._insCurrency + End Get + Set + Me._insCurrency = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsLine)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInsuranceCostsLine 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 TMicInsuranceCostsLine object + ''' + ''' string to deserialize + ''' Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine) 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 TMicInsuranceCostsLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine + Return CType(SerializerXml.Deserialize(s), TMicInsuranceCostsLine) + End Function +#End Region + + ''' + ''' Serializes current TMicInsuranceCostsLine 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 TMicInsuranceCostsLine object + ''' + ''' File to load and deserialize + ''' Output TMicInsuranceCostsLine 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 TMicInsuranceCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsLine) + 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 TMicInsuranceCostsLine) 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 TMicInsuranceCostsLine + 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 TMicFreightCostsLine + +#Region "Private fields" + Private _frtAmount As Decimal + + Private _frtCurrency As String + + Private _frtInternational As Decimal + + Private _frtEuNational As Decimal + + Private _frtInland As Decimal + + Private _frtFlagPercentOrValue As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._frtFlagPercentOrValue = "P" + End Sub + + Public Property frtAmount() As Decimal + Get + Return Me._frtAmount + End Get + Set + Me._frtAmount = Value + End Set + End Property + + Public Property frtCurrency() As String + Get + Return Me._frtCurrency + End Get + Set + Me._frtCurrency = Value + End Set + End Property + + Public Property frtInternational() As Decimal + Get + Return Me._frtInternational + End Get + Set + Me._frtInternational = Value + End Set + End Property + + Public Property frtEuNational() As Decimal + Get + Return Me._frtEuNational + End Get + Set + Me._frtEuNational = Value + End Set + End Property + + Public Property frtInland() As Decimal + Get + Return Me._frtInland + End Get + Set + Me._frtInland = Value + End Set + End Property + + + Public Property frtFlagPercentOrValue() As String + Get + Return Me._frtFlagPercentOrValue + End Get + Set + Me._frtFlagPercentOrValue = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsLine)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicFreightCostsLine 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 TMicFreightCostsLine object + ''' + ''' string to deserialize + ''' Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsLine) + 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 TMicFreightCostsLine) 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 TMicFreightCostsLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCostsLine) + 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 TMicFreightCostsLine + Return CType(SerializerXml.Deserialize(s), TMicFreightCostsLine) + End Function +#End Region + + ''' + ''' Serializes current TMicFreightCostsLine 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 TMicFreightCostsLine object + ''' + ''' File to load and deserialize + ''' Output TMicFreightCostsLine 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 TMicFreightCostsLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsLine) + 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 TMicFreightCostsLine) 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 TMicFreightCostsLine + 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 TMicPricing + +#Region "Private fields" + Private _prcType As String + + Private _prcReference As String + + Private _prcDate As Date + + Private _prcSystem As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property prcType() As String + Get + Return Me._prcType + End Get + Set + Me._prcType = Value + End Set + End Property + + Public Property prcReference() As String + Get + Return Me._prcReference + End Get + Set + Me._prcReference = Value + End Set + End Property + + + Public Property prcDate() As Date + Get + Return Me._prcDate + End Get + Set + Me._prcDate = Value + End Set + End Property + + Public Property prcSystem() As String + Get + Return Me._prcSystem + End Get + Set + Me._prcSystem = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPricing)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPricing 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 TMicPricing object + ''' + ''' string to deserialize + ''' Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPricing) + 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 TMicPricing) 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 TMicPricing + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPricing) + 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 TMicPricing + Return CType(SerializerXml.Deserialize(s), TMicPricing) + End Function +#End Region + + ''' + ''' Serializes current TMicPricing 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 TMicPricing object + ''' + ''' File to load and deserialize + ''' Output TMicPricing 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 TMicPricing, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPricing) + 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 TMicPricing) 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 TMicPricing + 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 TMicImportLineLicense + +#Region "Private fields" + Private _type As String + + Private _code As String + + Private _number As String + + Private _date As Date + + Private _notRequired As Boolean + + 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 code() As String + Get + Return Me._code + End Get + Set + Me._code = Value + End Set + End Property + + Public Property number() As String + Get + Return Me._number + End Get + Set + Me._number = Value + End Set + End Property + + + Public Property [date]() As Date + Get + Return Me._date + End Get + Set + Me._date = Value + End Set + End Property + + Public Property notRequired() As Boolean + Get + Return Me._notRequired + End Get + Set + Me._notRequired = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportLineLicense)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportLineLicense 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 TMicImportLineLicense object + ''' + ''' string to deserialize + ''' Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineLicense) + 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 TMicImportLineLicense) 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 TMicImportLineLicense + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportLineLicense) + 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 TMicImportLineLicense + Return CType(SerializerXml.Deserialize(s), TMicImportLineLicense) + End Function +#End Region + + ''' + ''' Serializes current TMicImportLineLicense 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 TMicImportLineLicense object + ''' + ''' File to load and deserialize + ''' Output TMicImportLineLicense 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 TMicImportLineLicense, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportLineLicense) + 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 TMicImportLineLicense) 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 TMicImportLineLicense + 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 TMicTariffCode + +#Region "Private fields" + Private _hsCode As String + + Private _vatCode As String + + Private _exciseTaxCode As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property hsCode() As String + Get + Return Me._hsCode + End Get + Set + Me._hsCode = Value + End Set + End Property + + Public Property vatCode() As String + Get + Return Me._vatCode + End Get + Set + Me._vatCode = Value + End Set + End Property + + Public Property exciseTaxCode() As String + Get + Return Me._exciseTaxCode + End Get + Set + Me._exciseTaxCode = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicTariffCode)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicTariffCode 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 TMicTariffCode object + ''' + ''' string to deserialize + ''' Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicTariffCode) + 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 TMicTariffCode) 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 TMicTariffCode + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicTariffCode) + 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 TMicTariffCode + Return CType(SerializerXml.Deserialize(s), TMicTariffCode) + End Function +#End Region + + ''' + ''' Serializes current TMicTariffCode 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 TMicTariffCode object + ''' + ''' File to load and deserialize + ''' Output TMicTariffCode 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 TMicTariffCode, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicTariffCode) + 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 TMicTariffCode) 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 TMicTariffCode + 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 TMicItem + +#Region "Private fields" + Private _partNumber As String + + Private _partDescription As String + + Private _serialNumber As String + + Private _productGroup As String + + Private _model As String + + Private _brand As String + + Private _manufacturerNumber As String + + Private _ctoNumber As String + + Private _confidenceLevel As Long + + Private _productCategory As String + + Private _usage As String + + Private _usageType As String + + Private _tariffCode As TMicTariffCode + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._tariffCode = New TMicTariffCode() + End Sub + + Public Property partNumber() As String + Get + Return Me._partNumber + End Get + Set + Me._partNumber = Value + End Set + End Property + + Public Property partDescription() As String + Get + Return Me._partDescription + End Get + Set + Me._partDescription = Value + End Set + End Property + + Public Property serialNumber() As String + Get + Return Me._serialNumber + End Get + Set + Me._serialNumber = Value + End Set + End Property + + Public Property productGroup() As String + Get + Return Me._productGroup + End Get + Set + Me._productGroup = 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 manufacturerNumber() As String + Get + Return Me._manufacturerNumber + End Get + Set + Me._manufacturerNumber = Value + End Set + End Property + + Public Property ctoNumber() As String + Get + Return Me._ctoNumber + End Get + Set + Me._ctoNumber = Value + End Set + End Property + + Public Property confidenceLevel() As Long + Get + Return Me._confidenceLevel + End Get + Set + Me._confidenceLevel = Value + End Set + End Property + + Public Property productCategory() As String + Get + Return Me._productCategory + End Get + Set + Me._productCategory = Value + End Set + End Property + + Public Property usage() As String + Get + Return Me._usage + End Get + Set + Me._usage = Value + End Set + End Property + + Public Property usageType() As String + Get + Return Me._usageType + End Get + Set + Me._usageType = Value + End Set + End Property + + Public Property TariffCode() As TMicTariffCode + Get + Return Me._tariffCode + End Get + Set + Me._tariffCode = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicItem)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicItem 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 TMicItem object + ''' + ''' string to deserialize + ''' Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicItem) + 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 TMicItem) 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 TMicItem + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicItem) + 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 TMicItem + Return CType(SerializerXml.Deserialize(s), TMicItem) + End Function +#End Region + + ''' + ''' Serializes current TMicItem 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 TMicItem object + ''' + ''' File to load and deserialize + ''' Output TMicItem 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 TMicItem, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicItem) + 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 TMicItem) 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 TMicItem + 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 TMicInvoiceLine + +#Region "Private fields" + Private _lineNumber As Decimal + + Private _item As TMicItem + + Private _quantity As Decimal + + Private _quantityUom As String + + Private _netWeight As Decimal + + Private _grossWeight As Decimal + + Private _reportingQuantity As Decimal + + Private _reportingQuantityUom As String + + Private _price As Decimal + + Private _lineValue As Decimal + + Private _license As TMicImportLineLicense + + Private _pricing As TMicPricing + + Private _freightCosts As TMicFreightCostsLine + + Private _insuranceCosts As TMicInsuranceCostsLine + + Private _additionalCost As List(Of TMicAdditionalCosts) + + Private _rebate As TMicRebateLine + + Private _additionalCostsVAT As TMicAdditionalCostsVAT + + Private _countryOfOrigin As String + + Private _prefCountryOfOrigin As String + + Private _locationOfGoods As String + + Private _importQuota As String + + Private _importQuotaKey As String + + Private _importQuotaQuantity As Decimal + + Private _importQuotaUnitOfMeasurement As String + + Private _importQuotaQualifier As String + + Private _customsProcedure As String + + Private _statisticalCode As String + + Private _endUseIndicator As String + + Private _transactionType As String + + Private _valuationMethod As String + + Private _addCode As List(Of String) + + Private _prefRequestCode As String + + Private _documents As TMicDocuments + + Private _previousDocument As TMicPreviousDocuments + + Private _bOM As TMicBom + + Private _stockType As String + + Private _stockType2 As String + + Private _stockExpiryDate As Date + + Private _package As TMicPackage + + Private _accountNumber As String + + Private _deliveryNote As String + + Private _orderNumber As String + + Private _orderPosition As Long + + Private _receipt As TMicReceipt + + Private _asnNumber As String + + Private _referenceValue As Decimal + + Private _referenceCurrency As String + + Private _text As String + + Private _text2 As String + + Private _registrationNumbers As TMicImportRegistrationNo + + Private _customerFields As TMicLinesCustomerFields + + Private _attributes As TMicAttributes + + Private _containerInfo As TMicContainerInfo + + Private _partners As TMicPartners + + Private _calculatedValues As TMicCalculatedValues + + Private _calculatedValuesCust As TMicCalculatedValuesCust + + Private _duties As TMicDuties + + Private _dutyTaxes As TMicDutyTaxes + + Private _dutySavings As TMicDutySavings + + Private _oprDetails As TMicOprInfo + + Private _additionalParams As TMicImportLineAdditionalParams + + Private _uniqueId As Decimal + + Private _externalProcessing As String + + Private _additionalInformation As TMicAttributes + + Private _intra As TMicCustIntraLine + + Private _preSupplier As TMicPreSupplier + + Private _ucr As String + + Private _cusCode As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _valuationIndicator As String + + Private _trackingNumber As String + + Private _referencePreviousProcedures As TReferencePreviousProcedures + + Private _packagesData As TMicPackagesData + + Private _authorisationHolders As TMicAuthHolders + + Private _acceptanceDate As Date + + Private _noCertOrigin As Boolean + + Private _manualContribution As Decimal + + Private _manualContributionCurrency As String + + Private _eudr As TMicInvoiceLineEudr + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._eudr = New TMicInvoiceLineEudr() + Me._authorisationHolders = New TMicAuthHolders() + Me._packagesData = New TMicPackagesData() + Me._referencePreviousProcedures = New TReferencePreviousProcedures() + Me._preSupplier = New TMicPreSupplier() + Me._intra = New TMicCustIntraLine() + Me._additionalInformation = New TMicAttributes() + Me._additionalParams = New TMicImportLineAdditionalParams() + Me._oprDetails = New TMicOprInfo() + Me._dutySavings = New TMicDutySavings() + Me._dutyTaxes = New TMicDutyTaxes() + Me._duties = New TMicDuties() + Me._calculatedValuesCust = New TMicCalculatedValuesCust() + Me._calculatedValues = New TMicCalculatedValues() + Me._partners = New TMicPartners() + Me._containerInfo = New TMicContainerInfo() + Me._attributes = New TMicAttributes() + Me._customerFields = New TMicLinesCustomerFields() + Me._registrationNumbers = New TMicImportRegistrationNo() + Me._receipt = New TMicReceipt() + Me._package = New TMicPackage() + Me._bOM = New TMicBom() + Me._previousDocument = New TMicPreviousDocuments() + Me._documents = New TMicDocuments() + Me._addCode = New List(Of String)() + Me._additionalCostsVAT = New TMicAdditionalCostsVAT() + Me._rebate = New TMicRebateLine() + Me._additionalCost = New List(Of TMicAdditionalCosts)() + Me._insuranceCosts = New TMicInsuranceCostsLine() + Me._freightCosts = New TMicFreightCostsLine() + Me._pricing = New TMicPricing() + Me._license = New TMicImportLineLicense() + Me._item = New TMicItem() + End Sub + + Public Property lineNumber() As Decimal + Get + Return Me._lineNumber + End Get + Set + Me._lineNumber = Value + End Set + End Property + + Public Property Item() As TMicItem + Get + Return Me._item + End Get + Set + Me._item = 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 quantityUom() As String + Get + Return Me._quantityUom + End Get + Set + Me._quantityUom = Value + End Set + End Property + + Public Property netWeight() As Decimal + Get + Return Me._netWeight + End Get + Set + Me._netWeight = Value + End Set + End Property + + Public Property grossWeight() As Decimal + Get + Return Me._grossWeight + End Get + Set + Me._grossWeight = Value + End Set + End Property + + Public Property reportingQuantity() As Decimal + Get + Return Me._reportingQuantity + End Get + Set + Me._reportingQuantity = Value + End Set + End Property + + Public Property reportingQuantityUom() As String + Get + Return Me._reportingQuantityUom + End Get + Set + Me._reportingQuantityUom = Value + End Set + End Property + + Public Property price() As Decimal + Get + Return Me._price + End Get + Set + Me._price = Value + End Set + End Property + + Public Property lineValue() As Decimal + Get + Return Me._lineValue + End Get + Set + Me._lineValue = Value + End Set + End Property + + Public Property License() As TMicImportLineLicense + Get + Return Me._license + End Get + Set + Me._license = Value + End Set + End Property + + Public Property Pricing() As TMicPricing + Get + Return Me._pricing + End Get + Set + Me._pricing = Value + End Set + End Property + + Public Property FreightCosts() As TMicFreightCostsLine + Get + Return Me._freightCosts + End Get + Set + Me._freightCosts = Value + End Set + End Property + + Public Property InsuranceCosts() As TMicInsuranceCostsLine + Get + Return Me._insuranceCosts + End Get + Set + Me._insuranceCosts = Value + End Set + End Property + + + Public Property AdditionalCost() As List(Of TMicAdditionalCosts) + Get + Return Me._additionalCost + End Get + Set + Me._additionalCost = Value + End Set + End Property + + Public Property Rebate() As TMicRebateLine + Get + Return Me._rebate + End Get + Set + Me._rebate = Value + End Set + End Property + + Public Property AdditionalCostsVAT() As TMicAdditionalCostsVAT + Get + Return Me._additionalCostsVAT + End Get + Set + Me._additionalCostsVAT = Value + End Set + End Property + + Public Property countryOfOrigin() As String + Get + Return Me._countryOfOrigin + End Get + Set + Me._countryOfOrigin = Value + End Set + End Property + + Public Property prefCountryOfOrigin() As String + Get + Return Me._prefCountryOfOrigin + End Get + Set + Me._prefCountryOfOrigin = Value + End Set + End Property + + Public Property locationOfGoods() As String + Get + Return Me._locationOfGoods + End Get + Set + Me._locationOfGoods = Value + End Set + End Property + + Public Property importQuota() As String + Get + Return Me._importQuota + End Get + Set + Me._importQuota = Value + End Set + End Property + + Public Property importQuotaKey() As String + Get + Return Me._importQuotaKey + End Get + Set + Me._importQuotaKey = Value + End Set + End Property + + Public Property importQuotaQuantity() As Decimal + Get + Return Me._importQuotaQuantity + End Get + Set + Me._importQuotaQuantity = Value + End Set + End Property + + Public Property importQuotaUnitOfMeasurement() As String + Get + Return Me._importQuotaUnitOfMeasurement + End Get + Set + Me._importQuotaUnitOfMeasurement = Value + End Set + End Property + + Public Property importQuotaQualifier() As String + Get + Return Me._importQuotaQualifier + End Get + Set + Me._importQuotaQualifier = Value + End Set + End Property + + Public Property customsProcedure() As String + Get + Return Me._customsProcedure + End Get + Set + Me._customsProcedure = Value + End Set + End Property + + Public Property statisticalCode() As String + Get + Return Me._statisticalCode + End Get + Set + Me._statisticalCode = Value + End Set + End Property + + Public Property endUseIndicator() As String + Get + Return Me._endUseIndicator + End Get + Set + Me._endUseIndicator = Value + End Set + End Property + + Public Property transactionType() As String + Get + Return Me._transactionType + End Get + Set + Me._transactionType = Value + End Set + End Property + + Public Property valuationMethod() As String + Get + Return Me._valuationMethod + End Get + Set + Me._valuationMethod = 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 prefRequestCode() As String + Get + Return Me._prefRequestCode + End Get + Set + Me._prefRequestCode = Value + End Set + End Property + + Public Property Documents() As TMicDocuments + Get + Return Me._documents + End Get + Set + Me._documents = Value + End Set + End Property + + Public Property PreviousDocument() As TMicPreviousDocuments + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = Value + End Set + End Property + + Public Property BOM() As TMicBom + Get + Return Me._bOM + End Get + Set + Me._bOM = Value + End Set + End Property + + Public Property stockType() As String + Get + Return Me._stockType + End Get + Set + Me._stockType = Value + End Set + End Property + + Public Property stockType2() As String + Get + Return Me._stockType2 + End Get + Set + Me._stockType2 = Value + End Set + End Property + + + Public Property stockExpiryDate() As Date + Get + Return Me._stockExpiryDate + End Get + Set + Me._stockExpiryDate = Value + End Set + End Property + + Public Property Package() As TMicPackage + Get + Return Me._package + End Get + Set + Me._package = Value + End Set + End Property + + Public Property accountNumber() As String + Get + Return Me._accountNumber + End Get + Set + Me._accountNumber = Value + End Set + End Property + + Public Property deliveryNote() As String + Get + Return Me._deliveryNote + End Get + Set + Me._deliveryNote = Value + End Set + End Property + + Public Property orderNumber() As String + Get + Return Me._orderNumber + End Get + Set + Me._orderNumber = Value + End Set + End Property + + Public Property orderPosition() As Long + Get + Return Me._orderPosition + End Get + Set + Me._orderPosition = Value + End Set + End Property + + Public Property Receipt() As TMicReceipt + Get + Return Me._receipt + End Get + Set + Me._receipt = Value + End Set + End Property + + Public Property asnNumber() As String + Get + Return Me._asnNumber + End Get + Set + Me._asnNumber = 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 referenceCurrency() As String + Get + Return Me._referenceCurrency + End Get + Set + Me._referenceCurrency = 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 text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property RegistrationNumbers() As TMicImportRegistrationNo + Get + Return Me._registrationNumbers + End Get + Set + Me._registrationNumbers = Value + End Set + End Property + + Public Property CustomerFields() As TMicLinesCustomerFields + Get + Return Me._customerFields + End Get + Set + Me._customerFields = Value + End Set + End Property + + Public Property Attributes() As TMicAttributes + Get + Return Me._attributes + End Get + Set + Me._attributes = Value + End Set + End Property + + Public Property ContainerInfo() As TMicContainerInfo + Get + Return Me._containerInfo + End Get + Set + Me._containerInfo = Value + End Set + End Property + + Public Property Partners() As TMicPartners + Get + Return Me._partners + End Get + Set + Me._partners = Value + End Set + End Property + + Public Property CalculatedValues() As TMicCalculatedValues + Get + Return Me._calculatedValues + End Get + Set + Me._calculatedValues = Value + End Set + End Property + + Public Property CalculatedValuesCust() As TMicCalculatedValuesCust + Get + Return Me._calculatedValuesCust + End Get + Set + Me._calculatedValuesCust = 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 + + Public Property DutySavings() As TMicDutySavings + Get + Return Me._dutySavings + End Get + Set + Me._dutySavings = Value + End Set + End Property + + Public Property OprDetails() As TMicOprInfo + Get + Return Me._oprDetails + End Get + Set + Me._oprDetails = Value + End Set + End Property + + Public Property AdditionalParams() As TMicImportLineAdditionalParams + Get + Return Me._additionalParams + End Get + Set + Me._additionalParams = Value + End Set + End Property + + Public Property uniqueId() As Decimal + Get + Return Me._uniqueId + End Get + Set + Me._uniqueId = Value + End Set + End Property + + Public Property externalProcessing() As String + Get + Return Me._externalProcessing + End Get + Set + Me._externalProcessing = Value + End Set + End Property + + Public Property AdditionalInformation() As TMicAttributes + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + Public Property Intra() As TMicCustIntraLine + Get + Return Me._intra + End Get + Set + Me._intra = Value + End Set + End Property + + Public Property PreSupplier() As TMicPreSupplier + Get + Return Me._preSupplier + End Get + Set + Me._preSupplier = Value + End Set + End Property + + Public Property ucr() As String + Get + Return Me._ucr + End Get + Set + Me._ucr = Value + End Set + End Property + + Public Property cusCode() As String + Get + Return Me._cusCode + End Get + Set + Me._cusCode = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Public Property valuationIndicator() As String + Get + Return Me._valuationIndicator + End Get + Set + Me._valuationIndicator = 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 ReferencePreviousProcedures() As TReferencePreviousProcedures + Get + Return Me._referencePreviousProcedures + End Get + Set + Me._referencePreviousProcedures = Value + End Set + End Property + + Public Property PackagesData() As TMicPackagesData + Get + Return Me._packagesData + End Get + Set + Me._packagesData = Value + End Set + End Property + + Public Property AuthorisationHolders() As TMicAuthHolders + Get + Return Me._authorisationHolders + End Get + Set + Me._authorisationHolders = 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 noCertOrigin() As Boolean + Get + Return Me._noCertOrigin + End Get + Set + Me._noCertOrigin = Value + End Set + End Property + + Public Property manualContribution() As Decimal + Get + Return Me._manualContribution + End Get + Set + Me._manualContribution = Value + End Set + End Property + + Public Property manualContributionCurrency() As String + Get + Return Me._manualContributionCurrency + End Get + Set + Me._manualContributionCurrency = Value + End Set + End Property + + Public Property eudr() As TMicInvoiceLineEudr + Get + Return Me._eudr + End Get + Set + Me._eudr = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLine)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLine 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 TMicInvoiceLine object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLine) + 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 TMicInvoiceLine) 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 TMicInvoiceLine + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLine) + 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 TMicInvoiceLine + Return CType(SerializerXml.Deserialize(s), TMicInvoiceLine) + End Function +#End Region + + ''' + ''' Serializes current TMicInvoiceLine 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 TMicInvoiceLine object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLine 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 TMicInvoiceLine, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLine) + 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 TMicInvoiceLine) 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 TMicInvoiceLine + 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 TMicAdditionalCosts + +#Region "Private fields" + Private _addType As String + + Private _addAmount As Decimal + + Private _addCurrency As String + + Private _addProRating As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property addType() As String + Get + Return Me._addType + End Get + Set + Me._addType = Value + End Set + End Property + + Public Property addAmount() As Decimal + Get + Return Me._addAmount + End Get + Set + Me._addAmount = Value + End Set + End Property + + Public Property addCurrency() As String + Get + Return Me._addCurrency + End Get + Set + Me._addCurrency = Value + End Set + End Property + + Public Property addProRating() As String + Get + Return Me._addProRating + End Get + Set + Me._addProRating = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAdditionalCosts)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAdditionalCosts 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 TMicAdditionalCosts object + ''' + ''' string to deserialize + ''' Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCosts) + 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 TMicAdditionalCosts) 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 TMicAdditionalCosts + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAdditionalCosts) + 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 TMicAdditionalCosts + Return CType(SerializerXml.Deserialize(s), TMicAdditionalCosts) + End Function +#End Region + + ''' + ''' Serializes current TMicAdditionalCosts 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 TMicAdditionalCosts object + ''' + ''' File to load and deserialize + ''' Output TMicAdditionalCosts 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 TMicAdditionalCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAdditionalCosts) + 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 TMicAdditionalCosts) 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 TMicAdditionalCosts + 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 TMicDocuments + +#Region "Private fields" + Private _document As List(Of TMicDocument) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._document = New List(Of TMicDocument)() + End Sub + + + Public Property Document() As List(Of TMicDocument) + Get + Return Me._document + End Get + Set + Me._document = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocuments)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDocuments 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 TMicDocuments object + ''' + ''' string to deserialize + ''' Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocuments) + 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 TMicDocuments) 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 TMicDocuments + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDocuments) + 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 TMicDocuments + Return CType(SerializerXml.Deserialize(s), TMicDocuments) + End Function +#End Region + + ''' + ''' Serializes current TMicDocuments 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 TMicDocuments object + ''' + ''' File to load and deserialize + ''' Output TMicDocuments 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 TMicDocuments, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocuments) + 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 TMicDocuments) 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 TMicDocuments + 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 TMicDocument + +#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 _docValue As Decimal + + Private _docStatUnit As String + + Private _docMeasurementUnitWriteOff As String + + Private _docAdditionalCostsCurrency As String + + Private _docCurrency As String + + Private _docCategory As String + + Private _docWriteOffQuantity As Decimal + + Private _docIssuerCountry As String + + Private _docAvailableFlag As Boolean + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + 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 docValue() As Decimal + Get + Return Me._docValue + End Get + Set + Me._docValue = 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 docMeasurementUnitWriteOff() As String + Get + Return Me._docMeasurementUnitWriteOff + End Get + Set + Me._docMeasurementUnitWriteOff = Value + End Set + End Property + + Public Property docAdditionalCostsCurrency() As String + Get + Return Me._docAdditionalCostsCurrency + End Get + Set + Me._docAdditionalCostsCurrency = 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 docCategory() As String + Get + Return Me._docCategory + End Get + Set + Me._docCategory = Value + End Set + End Property + + Public Property docWriteOffQuantity() As Decimal + Get + Return Me._docWriteOffQuantity + End Get + Set + Me._docWriteOffQuantity = Value + End Set + End Property + + Public Property docIssuerCountry() As String + Get + Return Me._docIssuerCountry + End Get + Set + Me._docIssuerCountry = Value + End Set + End Property + + Public Property docAvailableFlag() As Boolean + Get + Return Me._docAvailableFlag + End Get + Set + Me._docAvailableFlag = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDocument)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDocument 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 TMicDocument object + ''' + ''' string to deserialize + ''' Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocument) + 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 TMicDocument) 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 TMicDocument + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDocument) + 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 TMicDocument + Return CType(SerializerXml.Deserialize(s), TMicDocument) + End Function +#End Region + + ''' + ''' Serializes current TMicDocument 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 TMicDocument object + ''' + ''' File to load and deserialize + ''' Output TMicDocument 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 TMicDocument, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDocument) + 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 TMicDocument) 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 TMicDocument + 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 TMicAttributes + +#Region "Private fields" + Private _attribute As List(Of TMicAttribute) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._attribute = New List(Of TMicAttribute)() + End Sub + + + Public Property Attribute() As List(Of TMicAttribute) + Get + Return Me._attribute + End Get + Set + Me._attribute = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttributes)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAttributes 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 TMicAttributes object + ''' + ''' string to deserialize + ''' Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttributes) + 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 TMicAttributes) 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 TMicAttributes + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAttributes) + 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 TMicAttributes + Return CType(SerializerXml.Deserialize(s), TMicAttributes) + End Function +#End Region + + ''' + ''' Serializes current TMicAttributes 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 TMicAttributes object + ''' + ''' File to load and deserialize + ''' Output TMicAttributes 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 TMicAttributes, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttributes) + 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 TMicAttributes) 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 TMicAttributes + 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 TMicAttribute + +#Region "Private fields" + Private _attrType As String + + Private _attrText As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property attrType() As String + Get + Return Me._attrType + End Get + Set + Me._attrType = Value + End Set + End Property + + Public Property attrText() As String + Get + Return Me._attrText + End Get + Set + Me._attrText = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAttribute)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAttribute 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 TMicAttribute object + ''' + ''' string to deserialize + ''' Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttribute) + 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 TMicAttribute) 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 TMicAttribute + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAttribute) + 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 TMicAttribute + Return CType(SerializerXml.Deserialize(s), TMicAttribute) + End Function +#End Region + + ''' + ''' Serializes current TMicAttribute 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 TMicAttribute object + ''' + ''' File to load and deserialize + ''' Output TMicAttribute 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 TMicAttribute, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAttribute) + 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 TMicAttribute) 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 TMicAttribute + 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 TMicPartners + +#Region "Private fields" + Private _partner As List(Of TMicPartner) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._partner = New List(Of TMicPartner)() + End Sub + + + Public Property Partner() As List(Of TMicPartner) + Get + Return Me._partner + End Get + Set + Me._partner = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartners)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartners 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 TMicPartners object + ''' + ''' string to deserialize + ''' Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartners) + 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 TMicPartners) 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 TMicPartners + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartners) + 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 TMicPartners + Return CType(SerializerXml.Deserialize(s), TMicPartners) + End Function +#End Region + + ''' + ''' Serializes current TMicPartners 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 TMicPartners object + ''' + ''' File to load and deserialize + ''' Output TMicPartners 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 TMicPartners, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartners) + 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 TMicPartners) 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 TMicPartners + 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 TMicPartner + +#Region "Private fields" + Private _partnerType As String + + Private _partnerAddress As TMicAddress + + Private _partnerRelation As String + + Private _partnerInfo As String + + Private _partnerTelephone As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _partnerRole As String + + Private _customerFields As TMicPartnerCustomerFields + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._customerFields = New TMicPartnerCustomerFields() + Me._partnerAddress = New TMicAddress() + End Sub + + Public Property partnerType() As String + Get + Return Me._partnerType + End Get + Set + Me._partnerType = Value + End Set + End Property + + Public Property PartnerAddress() As TMicAddress + 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 partnerInfo() As String + Get + Return Me._partnerInfo + End Get + Set + Me._partnerInfo = Value + End Set + End Property + + Public Property partnerTelephone() As String + Get + Return Me._partnerTelephone + End Get + Set + Me._partnerTelephone = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Public Property partnerRole() As String + Get + Return Me._partnerRole + End Get + Set + Me._partnerRole = Value + End Set + End Property + + Public Property CustomerFields() As TMicPartnerCustomerFields + 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(TMicPartner)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartner 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 TMicPartner object + ''' + ''' string to deserialize + ''' Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartner) + 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 TMicPartner) 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 TMicPartner + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartner) + 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 TMicPartner + Return CType(SerializerXml.Deserialize(s), TMicPartner) + End Function +#End Region + + ''' + ''' Serializes current TMicPartner 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 TMicPartner object + ''' + ''' File to load and deserialize + ''' Output TMicPartner 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 TMicPartner, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartner) + 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 TMicPartner) 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 TMicPartner + 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 TMicPartnerCustomerFields + +#Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = Value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = Value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = Value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = Value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = Value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = Value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = Value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = Value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = Value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = Value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = Value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = Value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = Value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = Value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = Value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = Value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = Value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = Value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = Value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = Value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = Value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = Value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = Value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = Value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = Value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = Value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = Value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = Value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = Value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = Value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = Value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = Value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = Value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = Value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = Value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = Value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = Value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = Value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicPartnerCustomerFields)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicPartnerCustomerFields 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 TMicPartnerCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields) 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 TMicPartnerCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields + Return CType(SerializerXml.Deserialize(s), TMicPartnerCustomerFields) + End Function +#End Region + + ''' + ''' Serializes current TMicPartnerCustomerFields 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 TMicPartnerCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicPartnerCustomerFields 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 TMicPartnerCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicPartnerCustomerFields) + 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 TMicPartnerCustomerFields) 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 TMicPartnerCustomerFields + 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 TMicInvoiceLineEudr + +#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(TMicInvoiceLineEudr)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLineEudr 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 TMicInvoiceLineEudr object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr) 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 TMicInvoiceLineEudr + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr + Return CType(SerializerXml.Deserialize(s), TMicInvoiceLineEudr) + End Function +#End Region + + ''' + ''' Serializes current TMicInvoiceLineEudr 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 TMicInvoiceLineEudr object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLineEudr 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 TMicInvoiceLineEudr, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLineEudr) + 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 TMicInvoiceLineEudr) 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 TMicInvoiceLineEudr + 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 TMicInvoiceLines + +#Region "Private fields" + Private _line As List(Of TMicInvoiceLine) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._line = New List(Of TMicInvoiceLine)() + End Sub + + + Public Property Line() As List(Of TMicInvoiceLine) + Get + Return Me._line + End Get + Set + Me._line = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInvoiceLines)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInvoiceLines 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 TMicInvoiceLines object + ''' + ''' string to deserialize + ''' Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLines) + 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 TMicInvoiceLines) 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 TMicInvoiceLines + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInvoiceLines) + 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 TMicInvoiceLines + Return CType(SerializerXml.Deserialize(s), TMicInvoiceLines) + End Function +#End Region + + ''' + ''' Serializes current TMicInvoiceLines 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 TMicInvoiceLines object + ''' + ''' File to load and deserialize + ''' Output TMicInvoiceLines 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 TMicInvoiceLines, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInvoiceLines) + 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 TMicInvoiceLines) 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 TMicInvoiceLines + 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 TMicCustIntra + +#Region "Private fields" + Private _vendorVatId As String + + Private _statisticalProcedure As String + + Private _internalReference As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property vendorVatId() As String + Get + Return Me._vendorVatId + End Get + Set + Me._vendorVatId = Value + End Set + End Property + + Public Property statisticalProcedure() As String + Get + Return Me._statisticalProcedure + End Get + Set + Me._statisticalProcedure = Value + End Set + End Property + + Public Property internalReference() As String + Get + Return Me._internalReference + End Get + Set + Me._internalReference = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCustIntra)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCustIntra 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 TMicCustIntra object + ''' + ''' string to deserialize + ''' Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntra) + 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 TMicCustIntra) 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 TMicCustIntra + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCustIntra) + 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 TMicCustIntra + Return CType(SerializerXml.Deserialize(s), TMicCustIntra) + End Function +#End Region + + ''' + ''' Serializes current TMicCustIntra 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 TMicCustIntra object + ''' + ''' File to load and deserialize + ''' Output TMicCustIntra 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 TMicCustIntra, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCustIntra) + 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 TMicCustIntra) 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 TMicCustIntra + 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 TMicAtlasCompletionSumDEntry + +#Region "Private fields" + Private _idType As String + + Private _quantity As Long + + Private _packageType As String + + Private _registrationNumber As String + + Private _lineNumber As Long + + Private _depositor As String + + Private _spoType As String + + Private _spo As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property idType() As String + Get + Return Me._idType + End Get + Set + Me._idType = Value + End Set + End Property + + Public Property quantity() As Long + Get + Return Me._quantity + End Get + Set + Me._quantity = Value + End Set + End Property + + Public Property packageType() As String + Get + Return Me._packageType + End Get + Set + Me._packageType = Value + End Set + End Property + + Public Property registrationNumber() As String + Get + Return Me._registrationNumber + End Get + Set + Me._registrationNumber = Value + End Set + End Property + + Public Property lineNumber() As Long + Get + Return Me._lineNumber + End Get + Set + Me._lineNumber = Value + End Set + End Property + + Public Property depositor() As String + Get + Return Me._depositor + End Get + Set + Me._depositor = Value + End Set + End Property + + Public Property spoType() As String + Get + Return Me._spoType + End Get + Set + Me._spoType = Value + End Set + End Property + + Public Property spo() As String + Get + Return Me._spo + End Get + Set + Me._spo = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumDEntry)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry object + ''' + ''' string to deserialize + ''' Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry) 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 TMicAtlasCompletionSumDEntry + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry + Return CType(SerializerXml.Deserialize(s), TMicAtlasCompletionSumDEntry) + End Function +#End Region + + ''' + ''' Serializes current TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry object + ''' + ''' File to load and deserialize + ''' Output TMicAtlasCompletionSumDEntry 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 TMicAtlasCompletionSumDEntry, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumDEntry) + 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 TMicAtlasCompletionSumDEntry) 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 TMicAtlasCompletionSumDEntry + 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 TMicAtlasCompletionSumD + +#Region "Private fields" + Private _atlasCompletionSumD As List(Of TMicAtlasCompletionSumDEntry) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._atlasCompletionSumD = New List(Of TMicAtlasCompletionSumDEntry)() + End Sub + + + Public Property AtlasCompletionSumD() As List(Of TMicAtlasCompletionSumDEntry) + Get + Return Me._atlasCompletionSumD + End Get + Set + Me._atlasCompletionSumD = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicAtlasCompletionSumD)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD object + ''' + ''' string to deserialize + ''' Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD) 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 TMicAtlasCompletionSumD + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD + Return CType(SerializerXml.Deserialize(s), TMicAtlasCompletionSumD) + End Function +#End Region + + ''' + ''' Serializes current TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD object + ''' + ''' File to load and deserialize + ''' Output TMicAtlasCompletionSumD 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 TMicAtlasCompletionSumD, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicAtlasCompletionSumD) + 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 TMicAtlasCompletionSumD) 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 TMicAtlasCompletionSumD + 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 TMicContainer + +#Region "Private fields" + Private _containerIndicator As String + + Private _containerNumber As String + + Private _containerType As String + + Private _containerLCLIndicator As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property containerIndicator() As String + Get + Return Me._containerIndicator + End Get + Set + Me._containerIndicator = Value + End Set + End Property + + Public Property containerNumber() As String + Get + Return Me._containerNumber + End Get + Set + Me._containerNumber = Value + End Set + End Property + + Public Property containerType() As String + Get + Return Me._containerType + End Get + Set + Me._containerType = Value + End Set + End Property + + Public Property containerLCLIndicator() As String + Get + Return Me._containerLCLIndicator + End Get + Set + Me._containerLCLIndicator = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicContainer)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicContainer 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 TMicContainer object + ''' + ''' string to deserialize + ''' Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainer) + 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 TMicContainer) 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 TMicContainer + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicContainer) + 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 TMicContainer + Return CType(SerializerXml.Deserialize(s), TMicContainer) + End Function +#End Region + + ''' + ''' Serializes current TMicContainer 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 TMicContainer object + ''' + ''' File to load and deserialize + ''' Output TMicContainer 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 TMicContainer, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicContainer) + 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 TMicContainer) 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 TMicContainer + 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 TMicImportCustomerFields + +#Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _number1 As Decimal + + Private _number2 As Decimal + + Private _number3 As Decimal + + Private _number4 As Decimal + + Private _number5 As Decimal + + Private _number6 As Decimal + + Private _number7 As Decimal + + Private _number8 As Decimal + + Private _number9 As Decimal + + Private _number10 As Decimal + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = Value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = Value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = Value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = Value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = Value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = Value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = Value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = Value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = Value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = Value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = Value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = Value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = Value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = Value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = Value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = Value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = Value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = Value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = Value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = Value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = Value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = Value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = Value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = Value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = Value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = Value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = Value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = Value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = Value + End Set + End Property + + Public Property number1() As Decimal + Get + Return Me._number1 + End Get + Set + Me._number1 = Value + End Set + End Property + + Public Property number2() As Decimal + Get + Return Me._number2 + End Get + Set + Me._number2 = Value + End Set + End Property + + Public Property number3() As Decimal + Get + Return Me._number3 + End Get + Set + Me._number3 = Value + End Set + End Property + + Public Property number4() As Decimal + Get + Return Me._number4 + End Get + Set + Me._number4 = Value + End Set + End Property + + Public Property number5() As Decimal + Get + Return Me._number5 + End Get + Set + Me._number5 = Value + End Set + End Property + + Public Property number6() As Decimal + Get + Return Me._number6 + End Get + Set + Me._number6 = Value + End Set + End Property + + Public Property number7() As Decimal + Get + Return Me._number7 + End Get + Set + Me._number7 = Value + End Set + End Property + + Public Property number8() As Decimal + Get + Return Me._number8 + End Get + Set + Me._number8 = Value + End Set + End Property + + Public Property number9() As Decimal + Get + Return Me._number9 + End Get + Set + Me._number9 = Value + End Set + End Property + + Public Property number10() As Decimal + Get + Return Me._number10 + End Get + Set + Me._number10 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportCustomerFields)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportCustomerFields 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 TMicImportCustomerFields object + ''' + ''' string to deserialize + ''' Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportCustomerFields) + 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 TMicImportCustomerFields) 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 TMicImportCustomerFields + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportCustomerFields) + 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 TMicImportCustomerFields + Return CType(SerializerXml.Deserialize(s), TMicImportCustomerFields) + End Function +#End Region + + ''' + ''' Serializes current TMicImportCustomerFields 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 TMicImportCustomerFields object + ''' + ''' File to load and deserialize + ''' Output TMicImportCustomerFields 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 TMicImportCustomerFields, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportCustomerFields) + 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 TMicImportCustomerFields) 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 TMicImportCustomerFields + 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 TMicImportPaymentInfo + +#Region "Private fields" + Private _paymentType As String + + Private _paymentDate As Date + + Private _paymentBankCode As String + + Private _paymentBankBranchCode As String + + Private _paymentCurrency As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property paymentType() As String + Get + Return Me._paymentType + End Get + Set + Me._paymentType = Value + End Set + End Property + + Public Property paymentDate() As Date + Get + Return Me._paymentDate + End Get + Set + Me._paymentDate = Value + End Set + End Property + + Public Property paymentBankCode() As String + Get + Return Me._paymentBankCode + End Get + Set + Me._paymentBankCode = Value + End Set + End Property + + Public Property paymentBankBranchCode() As String + Get + Return Me._paymentBankBranchCode + End Get + Set + Me._paymentBankBranchCode = Value + End Set + End Property + + Public Property paymentCurrency() As String + Get + Return Me._paymentCurrency + End Get + Set + Me._paymentCurrency = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicImportPaymentInfo)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicImportPaymentInfo 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 TMicImportPaymentInfo object + ''' + ''' string to deserialize + ''' Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportPaymentInfo) + 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 TMicImportPaymentInfo) 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 TMicImportPaymentInfo + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicImportPaymentInfo) + 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 TMicImportPaymentInfo + Return CType(SerializerXml.Deserialize(s), TMicImportPaymentInfo) + End Function +#End Region + + ''' + ''' Serializes current TMicImportPaymentInfo 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 TMicImportPaymentInfo object + ''' + ''' File to load and deserialize + ''' Output TMicImportPaymentInfo 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 TMicImportPaymentInfo, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicImportPaymentInfo) + 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 TMicImportPaymentInfo) 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 TMicImportPaymentInfo + 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 TMicInsuranceCostsInv + +#Region "Private fields" + Private _insAmount As Decimal + + Private _insCurrency As String + + Private _insProRating As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property insAmount() As Decimal + Get + Return Me._insAmount + End Get + Set + Me._insAmount = Value + End Set + End Property + + Public Property insCurrency() As String + Get + Return Me._insCurrency + End Get + Set + Me._insCurrency = Value + End Set + End Property + + Public Property insProRating() As String + Get + Return Me._insProRating + End Get + Set + Me._insProRating = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCostsInv)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInsuranceCostsInv 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 TMicInsuranceCostsInv object + ''' + ''' string to deserialize + ''' Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv) 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 TMicInsuranceCostsInv + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv + Return CType(SerializerXml.Deserialize(s), TMicInsuranceCostsInv) + End Function +#End Region + + ''' + ''' Serializes current TMicInsuranceCostsInv 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 TMicInsuranceCostsInv object + ''' + ''' File to load and deserialize + ''' Output TMicInsuranceCostsInv 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 TMicInsuranceCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCostsInv) + 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 TMicInsuranceCostsInv) 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 TMicInsuranceCostsInv + 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 TMicFreightCostsInv + +#Region "Private fields" + Private _frtAmount As Decimal + + Private _frtCurrency As String + + Private _frtInternational As Decimal + + Private _frtEuNational As Decimal + + Private _frtInland As Decimal + + Private _frtProRating As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property frtAmount() As Decimal + Get + Return Me._frtAmount + End Get + Set + Me._frtAmount = Value + End Set + End Property + + Public Property frtCurrency() As String + Get + Return Me._frtCurrency + End Get + Set + Me._frtCurrency = Value + End Set + End Property + + Public Property frtInternational() As Decimal + Get + Return Me._frtInternational + End Get + Set + Me._frtInternational = Value + End Set + End Property + + Public Property frtEuNational() As Decimal + Get + Return Me._frtEuNational + End Get + Set + Me._frtEuNational = Value + End Set + End Property + + Public Property frtInland() As Decimal + Get + Return Me._frtInland + End Get + Set + Me._frtInland = Value + End Set + End Property + + Public Property frtProRating() As String + Get + Return Me._frtProRating + End Get + Set + Me._frtProRating = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicFreightCostsInv)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicFreightCostsInv 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 TMicFreightCostsInv object + ''' + ''' string to deserialize + ''' Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsInv) + 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 TMicFreightCostsInv) 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 TMicFreightCostsInv + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCostsInv) + 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 TMicFreightCostsInv + Return CType(SerializerXml.Deserialize(s), TMicFreightCostsInv) + End Function +#End Region + + ''' + ''' Serializes current TMicFreightCostsInv 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 TMicFreightCostsInv object + ''' + ''' File to load and deserialize + ''' Output TMicFreightCostsInv 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 TMicFreightCostsInv, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCostsInv) + 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 TMicFreightCostsInv) 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 TMicFreightCostsInv + 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 TMicRebate + +#Region "Private fields" + Private _rebAmount As Decimal + + Private _rebCurrency As String + + Private _rebProRating As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property rebAmount() As Decimal + Get + Return Me._rebAmount + End Get + Set + Me._rebAmount = Value + End Set + End Property + + Public Property rebCurrency() As String + Get + Return Me._rebCurrency + End Get + Set + Me._rebCurrency = Value + End Set + End Property + + Public Property rebProRating() As String + Get + Return Me._rebProRating + End Get + Set + Me._rebProRating = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicRebate)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicRebate 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 TMicRebate object + ''' + ''' string to deserialize + ''' Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebate) + 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 TMicRebate) 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 TMicRebate + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicRebate) + 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 TMicRebate + Return CType(SerializerXml.Deserialize(s), TMicRebate) + End Function +#End Region + + ''' + ''' Serializes current TMicRebate 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 TMicRebate object + ''' + ''' File to load and deserialize + ''' Output TMicRebate 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 TMicRebate, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicRebate) + 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 TMicRebate) 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 TMicRebate + 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 TMicDelTerm + +#Region "Private fields" + Private _code As String + + Private _desc As String + + Private _calculationOfFreightCosts As String + + Private _code2 As String + + Private _text 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 + + Public Property calculationOfFreightCosts() As String + Get + Return Me._calculationOfFreightCosts + End Get + Set + Me._calculationOfFreightCosts = Value + End Set + End Property + + Public Property code2() As String + Get + Return Me._code2 + End Get + Set + Me._code2 = 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(TMicDelTerm)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDelTerm 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 TMicDelTerm object + ''' + ''' string to deserialize + ''' Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDelTerm) + 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 TMicDelTerm) 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 TMicDelTerm + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDelTerm) + 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 TMicDelTerm + Return CType(SerializerXml.Deserialize(s), TMicDelTerm) + End Function +#End Region + + ''' + ''' Serializes current TMicDelTerm 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 TMicDelTerm object + ''' + ''' File to load and deserialize + ''' Output TMicDelTerm 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 TMicDelTerm, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDelTerm) + 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 TMicDelTerm) 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 TMicDelTerm + 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 MicCustImportMessage + +#Region "Private fields" + Private _shipment As TMicShipment + + Private _invoice As List(Of TMicInvoice) + + Private _cancellation As TMicCancellation + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._cancellation = New TMicCancellation() + Me._invoice = New List(Of TMicInvoice)() + Me._shipment = New TMicShipment() + End Sub + + Public Property Shipment() As TMicShipment + Get + Return Me._shipment + End Get + Set + Me._shipment = Value + End Set + End Property + + + Public Property Invoice() As List(Of TMicInvoice) + Get + Return Me._invoice + End Get + Set + Me._invoice = Value + End Set + End Property + + Public Property Cancellation() As TMicCancellation + Get + Return Me._cancellation + End Get + Set + Me._cancellation = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(MicCustImportMessage)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize MicCustImportMessage 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 MicCustImportMessage object + ''' + ''' string to deserialize + ''' Output MicCustImportMessage 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 MicCustImportMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportMessage) + 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 MicCustImportMessage) 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 MicCustImportMessage + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), MicCustImportMessage) + 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 MicCustImportMessage + Return CType(SerializerXml.Deserialize(s), MicCustImportMessage) + End Function +#End Region + + ''' + ''' Serializes current MicCustImportMessage 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 MicCustImportMessage object + ''' + ''' File to load and deserialize + ''' Output MicCustImportMessage 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 MicCustImportMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, MicCustImportMessage) + 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 MicCustImportMessage) 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 MicCustImportMessage + 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 TMicShipment + +#Region "Private fields" + Private _company As String + + Private _plant As String + + Private _shipmentId As String + + Private _shipmentPartial As String + + Private _shipmentVersion As String + + Private _documentNumber As Decimal + + Private _shipmentHead As TMicShipmentHead + + Private _containers As TMicContainerInfo + + Private _documents As TMicDocuments + + Private _attributes As TMicAttributes + + Private _partners As TMicPartners + + Private _previousDocuments As TMicPreviousDocuments + + Private _atlasCompletionSumDs As TMicAtlasCompletionSumD + + Private _additionalInformation As TMicAttributes + + Private _authorisationHolders As TMicAuthHolders + + Private _defermentAccounts As TMicDeferAccs + + Private _guarantees As TMicGuarantees + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._guarantees = New TMicGuarantees() + Me._defermentAccounts = New TMicDeferAccs() + Me._authorisationHolders = New TMicAuthHolders() + Me._additionalInformation = New TMicAttributes() + Me._atlasCompletionSumDs = New TMicAtlasCompletionSumD() + Me._previousDocuments = New TMicPreviousDocuments() + Me._partners = New TMicPartners() + Me._attributes = New TMicAttributes() + Me._documents = New TMicDocuments() + Me._containers = New TMicContainerInfo() + Me._shipmentHead = New TMicShipmentHead() + Me._shipmentVersion = "1" + Me._documentNumber = CType(1D, Decimal) + 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 shipmentPartial() As String + Get + Return Me._shipmentPartial + End Get + Set + Me._shipmentPartial = 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 documentNumber() As Decimal + Get + Return Me._documentNumber + End Get + Set + Me._documentNumber = Value + End Set + End Property + + Public Property ShipmentHead() As TMicShipmentHead + Get + Return Me._shipmentHead + End Get + Set + Me._shipmentHead = Value + End Set + End Property + + Public Property Containers() As TMicContainerInfo + Get + Return Me._containers + End Get + Set + Me._containers = Value + End Set + End Property + + Public Property Documents() As TMicDocuments + Get + Return Me._documents + End Get + Set + Me._documents = Value + End Set + End Property + + Public Property Attributes() As TMicAttributes + Get + Return Me._attributes + End Get + Set + Me._attributes = Value + End Set + End Property + + Public Property Partners() As TMicPartners + Get + Return Me._partners + End Get + Set + Me._partners = Value + End Set + End Property + + Public Property PreviousDocuments() As TMicPreviousDocuments + Get + Return Me._previousDocuments + End Get + Set + Me._previousDocuments = Value + End Set + End Property + + Public Property AtlasCompletionSumDs() As TMicAtlasCompletionSumD + Get + Return Me._atlasCompletionSumDs + End Get + Set + Me._atlasCompletionSumDs = Value + End Set + End Property + + Public Property AdditionalInformation() As TMicAttributes + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + Public Property AuthorisationHolders() As TMicAuthHolders + Get + Return Me._authorisationHolders + End Get + Set + Me._authorisationHolders = Value + End Set + End Property + + Public Property DefermentAccounts() As TMicDeferAccs + Get + Return Me._defermentAccounts + End Get + Set + Me._defermentAccounts = Value + End Set + End Property + + Public Property Guarantees() As TMicGuarantees + Get + Return Me._guarantees + End Get + Set + Me._guarantees = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicShipment)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicShipment 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 TMicShipment object + ''' + ''' string to deserialize + ''' Output TMicShipment 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 TMicShipment, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicShipment) + 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 TMicShipment) 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 TMicShipment + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicShipment) + 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 TMicShipment + Return CType(SerializerXml.Deserialize(s), TMicShipment) + End Function +#End Region + + ''' + ''' Serializes current TMicShipment 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 TMicShipment object + ''' + ''' File to load and deserialize + ''' Output TMicShipment 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 TMicShipment, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicShipment) + 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 TMicShipment) 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 TMicShipment + 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 TMicShipmentHead + +#Region "Private fields" + Private _shipmentType As TMicShipmentHeadShipmentType + + Private _customsDate As Date + + Private _declType As TMicDeclType + + Private _mrn As String + + Private _grossWeight As Decimal + + Private _departurePlace As String + + Private _dispatchCountry As String + + Private _lastDispatchCountry As String + + Private _destinationPlace As String + + Private _destinationRegion As String + + Private _officeEntry As String + + Private _importState As String + + Private _substituteFlag As String + + Private _typeOfImport As String + + Private _authorizationNumber As String + + Private _placeOfDispatchDescription As String + + Private _typeOfAirTransportation As String + + Private _code1 As String + + Private _motBorder As TMicMot + + Private _motBorderCrossing As TMicMot + + Private _motInland As TMicMot + + Private _containerIndicator As String + + Private _container As TMicContainer + + Private _freight As TMicFreightCosts + + Private _insurance As TMicInsuranceCosts + + Private _additionalCosts As List(Of TMicAdditionalCosts) + + Private _additionalCostVAT As Decimal + + Private _text As String + + Private _exportDate As Date + + Private _importDate As Date + + Private _estArrivalDate As Date + + Private _partyConst As String + + Private _period As String + + Private _customerFields As TMicImportCustomerFields + + Private _countryDestination As String + + Private _clearenceType As String + + Private _previousDocType As String + + Private _previousDocNumber As String + + Private _customsOfficeOfDestination As String + + Private _carrierNumber As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private _supervisingOffice As String + + Private _typeIdentificationOfTransportArrival As String + + Private _portInspectionOrganizationCode As String + + Private _licensingOrganizationCode As String + + Private _goodsLocation As String + + Private _destinationPort As String + + Private _entryPort As String + + Private _departurePort As String + + Private _destinationInspectionOrganizationCode As String + + Private _receivingOrganizationCode As String + + Private _arrivalMeansType As String + + Private _arrivalMeansIdNo As String + + Private _additionalStatisticalCurrency As String + + Private _additionalStatisticalValue As Decimal + + Private _broker As String + + Private _waybillNumber As String + + Private _waybillDate As Date + + Private _houseWaybillNumber As String + + Private _houseWaybillDate As Date + + Private _locGoods As TMicLocationOfGoods + + Private _deferredPayment As String + + Private _presentationsCustomsOffice As String + + Private _paymentType As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._locGoods = New TMicLocationOfGoods() + Me._customerFields = New TMicImportCustomerFields() + Me._additionalCosts = New List(Of TMicAdditionalCosts)() + Me._insurance = New TMicInsuranceCosts() + Me._freight = New TMicFreightCosts() + Me._container = New TMicContainer() + Me._motInland = New TMicMot() + Me._motBorderCrossing = New TMicMot() + Me._motBorder = New TMicMot() + Me._declType = New TMicDeclType() + Me._shipmentType = TMicShipmentHeadShipmentType.E + Me._containerIndicator = "0" + End Sub + + + Public Property shipmentType() As TMicShipmentHeadShipmentType + Get + Return Me._shipmentType + End Get + Set + Me._shipmentType = Value + End Set + End Property + + + Public Property customsDate() As Date + Get + Return Me._customsDate + End Get + Set + Me._customsDate = Value + End Set + End Property + + Public Property declType() As TMicDeclType + Get + Return Me._declType + End Get + Set + Me._declType = 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 grossWeight() As Decimal + Get + Return Me._grossWeight + End Get + Set + Me._grossWeight = Value + End Set + End Property + + Public Property departurePlace() As String + Get + Return Me._departurePlace + End Get + Set + Me._departurePlace = Value + End Set + End Property + + Public Property dispatchCountry() As String + Get + Return Me._dispatchCountry + End Get + Set + Me._dispatchCountry = Value + End Set + End Property + + Public Property lastDispatchCountry() As String + Get + Return Me._lastDispatchCountry + End Get + Set + Me._lastDispatchCountry = Value + End Set + End Property + + Public Property destinationPlace() As String + Get + Return Me._destinationPlace + End Get + Set + Me._destinationPlace = Value + End Set + End Property + + Public Property destinationRegion() As String + Get + Return Me._destinationRegion + End Get + Set + Me._destinationRegion = Value + End Set + End Property + + Public Property officeEntry() As String + Get + Return Me._officeEntry + End Get + Set + Me._officeEntry = Value + End Set + End Property + + Public Property importState() As String + Get + Return Me._importState + End Get + Set + Me._importState = Value + End Set + End Property + + Public Property substituteFlag() As String + Get + Return Me._substituteFlag + End Get + Set + Me._substituteFlag = Value + End Set + End Property + + Public Property typeOfImport() As String + Get + Return Me._typeOfImport + End Get + Set + Me._typeOfImport = Value + End Set + End Property + + Public Property authorizationNumber() As String + Get + Return Me._authorizationNumber + End Get + Set + Me._authorizationNumber = Value + End Set + End Property + + Public Property placeOfDispatchDescription() As String + Get + Return Me._placeOfDispatchDescription + End Get + Set + Me._placeOfDispatchDescription = Value + End Set + End Property + + Public Property typeOfAirTransportation() As String + Get + Return Me._typeOfAirTransportation + End Get + Set + Me._typeOfAirTransportation = Value + End Set + End Property + + Public Property code1() As String + Get + Return Me._code1 + End Get + Set + Me._code1 = Value + End Set + End Property + + Public Property MotBorder() As TMicMot + Get + Return Me._motBorder + End Get + Set + Me._motBorder = Value + End Set + End Property + + Public Property MotBorderCrossing() As TMicMot + Get + Return Me._motBorderCrossing + End Get + Set + Me._motBorderCrossing = Value + End Set + End Property + + Public Property MotInland() As TMicMot + Get + Return Me._motInland + End Get + Set + Me._motInland = Value + End Set + End Property + + + Public Property containerIndicator() As String + Get + Return Me._containerIndicator + End Get + Set + Me._containerIndicator = Value + End Set + End Property + + Public Property Container() As TMicContainer + Get + Return Me._container + End Get + Set + Me._container = Value + End Set + End Property + + Public Property Freight() As TMicFreightCosts + Get + Return Me._freight + End Get + Set + Me._freight = Value + End Set + End Property + + Public Property Insurance() As TMicInsuranceCosts + Get + Return Me._insurance + End Get + Set + Me._insurance = Value + End Set + End Property + + + Public Property AdditionalCosts() As List(Of TMicAdditionalCosts) + Get + Return Me._additionalCosts + End Get + Set + Me._additionalCosts = Value + End Set + End Property + + Public Property additionalCostVAT() As Decimal + Get + Return Me._additionalCostVAT + End Get + Set + Me._additionalCostVAT = 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 exportDate() As Date + Get + Return Me._exportDate + End Get + Set + Me._exportDate = Value + End Set + End Property + + + Public Property importDate() As Date + Get + Return Me._importDate + End Get + Set + Me._importDate = Value + End Set + End Property + + Public Property estArrivalDate() As Date + Get + Return Me._estArrivalDate + End Get + Set + Me._estArrivalDate = 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 period() As String + Get + Return Me._period + End Get + Set + Me._period = Value + End Set + End Property + + Public Property CustomerFields() As TMicImportCustomerFields + Get + Return Me._customerFields + End Get + Set + Me._customerFields = Value + End Set + End Property + + Public Property countryDestination() As String + Get + Return Me._countryDestination + End Get + Set + Me._countryDestination = Value + End Set + End Property + + Public Property clearenceType() As String + Get + Return Me._clearenceType + End Get + Set + Me._clearenceType = Value + End Set + End Property + + Public Property previousDocType() As String + Get + Return Me._previousDocType + End Get + Set + Me._previousDocType = Value + End Set + End Property + + Public Property previousDocNumber() As String + Get + Return Me._previousDocNumber + End Get + Set + Me._previousDocNumber = Value + End Set + End Property + + Public Property customsOfficeOfDestination() As String + Get + Return Me._customsOfficeOfDestination + End Get + Set + Me._customsOfficeOfDestination = Value + End Set + End Property + + Public Property carrierNumber() As String + Get + Return Me._carrierNumber + End Get + Set + Me._carrierNumber = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Public Property supervisingOffice() As String + Get + Return Me._supervisingOffice + End Get + Set + Me._supervisingOffice = Value + End Set + End Property + + Public Property typeIdentificationOfTransportArrival() As String + Get + Return Me._typeIdentificationOfTransportArrival + End Get + Set + Me._typeIdentificationOfTransportArrival = Value + End Set + End Property + + Public Property portInspectionOrganizationCode() As String + Get + Return Me._portInspectionOrganizationCode + End Get + Set + Me._portInspectionOrganizationCode = Value + End Set + End Property + + Public Property licensingOrganizationCode() As String + Get + Return Me._licensingOrganizationCode + End Get + Set + Me._licensingOrganizationCode = Value + End Set + End Property + + Public Property goodsLocation() As String + Get + Return Me._goodsLocation + End Get + Set + Me._goodsLocation = Value + End Set + End Property + + Public Property destinationPort() As String + Get + Return Me._destinationPort + End Get + Set + Me._destinationPort = Value + End Set + End Property + + Public Property entryPort() As String + Get + Return Me._entryPort + End Get + Set + Me._entryPort = Value + End Set + End Property + + Public Property departurePort() As String + Get + Return Me._departurePort + End Get + Set + Me._departurePort = Value + End Set + End Property + + Public Property destinationInspectionOrganizationCode() As String + Get + Return Me._destinationInspectionOrganizationCode + End Get + Set + Me._destinationInspectionOrganizationCode = Value + End Set + End Property + + Public Property receivingOrganizationCode() As String + Get + Return Me._receivingOrganizationCode + End Get + Set + Me._receivingOrganizationCode = Value + End Set + End Property + + Public Property arrivalMeansType() As String + Get + Return Me._arrivalMeansType + End Get + Set + Me._arrivalMeansType = Value + End Set + End Property + + Public Property arrivalMeansIdNo() As String + Get + Return Me._arrivalMeansIdNo + End Get + Set + Me._arrivalMeansIdNo = Value + End Set + End Property + + Public Property additionalStatisticalCurrency() As String + Get + Return Me._additionalStatisticalCurrency + End Get + Set + Me._additionalStatisticalCurrency = Value + End Set + End Property + + Public Property additionalStatisticalValue() As Decimal + Get + Return Me._additionalStatisticalValue + End Get + Set + Me._additionalStatisticalValue = 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 locGoods() As TMicLocationOfGoods + Get + Return Me._locGoods + End Get + Set + Me._locGoods = Value + End Set + End Property + + Public Property deferredPayment() As String + Get + Return Me._deferredPayment + End Get + Set + Me._deferredPayment = Value + End Set + End Property + + Public Property presentationsCustomsOffice() As String + Get + Return Me._presentationsCustomsOffice + End Get + Set + Me._presentationsCustomsOffice = Value + End Set + End Property + + Public Property paymentType() As String + Get + Return Me._paymentType + End Get + Set + Me._paymentType = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicShipmentHead)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicShipmentHead 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 TMicShipmentHead object + ''' + ''' string to deserialize + ''' Output TMicShipmentHead 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 TMicShipmentHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicShipmentHead) + 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 TMicShipmentHead) 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 TMicShipmentHead + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicShipmentHead) + 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 TMicShipmentHead + Return CType(SerializerXml.Deserialize(s), TMicShipmentHead) + End Function +#End Region + + ''' + ''' Serializes current TMicShipmentHead 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 TMicShipmentHead object + ''' + ''' File to load and deserialize + ''' Output TMicShipmentHead 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 TMicShipmentHead, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicShipmentHead) + 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 TMicShipmentHead) 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 TMicShipmentHead + 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 TMicShipmentHeadShipmentType + + E + + B + + U + + X + + I + End Enum + + + Partial Public Class TMicDeclType + +#Region "Private fields" + Private _type1 As String + + Private _type2 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 + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeclType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDeclType 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 TMicDeclType object + ''' + ''' string to deserialize + ''' Output TMicDeclType 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 TMicDeclType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeclType) + 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 TMicDeclType) 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 TMicDeclType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeclType) + 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 TMicDeclType + Return CType(SerializerXml.Deserialize(s), TMicDeclType) + End Function +#End Region + + ''' + ''' Serializes current TMicDeclType 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 TMicDeclType object + ''' + ''' File to load and deserialize + ''' Output TMicDeclType 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 TMicDeclType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeclType) + 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 TMicDeclType) 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 TMicDeclType + 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 TMicMot + +#Region "Private fields" + Private _motMode As String + + Private _meansOfTransport As String + + Private _motCountry As String + + Private _motVehicle As String + + Private _motTransferName As String + + Private _meansOfTransportDescription As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property motMode() As String + Get + Return Me._motMode + End Get + Set + Me._motMode = Value + End Set + End Property + + Public Property meansOfTransport() As String + Get + Return Me._meansOfTransport + End Get + Set + Me._meansOfTransport = Value + End Set + End Property + + Public Property motCountry() As String + Get + Return Me._motCountry + End Get + Set + Me._motCountry = Value + End Set + End Property + + Public Property motVehicle() As String + Get + Return Me._motVehicle + End Get + Set + Me._motVehicle = Value + End Set + End Property + + Public Property motTransferName() As String + Get + Return Me._motTransferName + End Get + Set + Me._motTransferName = Value + End Set + End Property + + Public Property meansOfTransportDescription() As String + Get + Return Me._meansOfTransportDescription + End Get + Set + Me._meansOfTransportDescription = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicMot)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicMot 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 TMicMot object + ''' + ''' string to deserialize + ''' Output TMicMot 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 TMicMot, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicMot) + 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 TMicMot) 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 TMicMot + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicMot) + 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 TMicMot + Return CType(SerializerXml.Deserialize(s), TMicMot) + End Function +#End Region + + ''' + ''' Serializes current TMicMot 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 TMicMot object + ''' + ''' File to load and deserialize + ''' Output TMicMot 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 TMicMot, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicMot) + 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 TMicMot) 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 TMicMot + 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 TMicFreightCosts + +#Region "Private fields" + Private _frtAmount As Decimal + + Private _frtCurrency As String + + Private _frtInternational As Decimal + + Private _frtEuNational As Decimal + + Private _frtInland As Decimal + + Private _frtProRating As String + + 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 frtAmount() As Decimal + Get + Return Me._frtAmount + End Get + Set + Me._frtAmount = Value + End Set + End Property + + Public Property frtCurrency() As String + Get + Return Me._frtCurrency + End Get + Set + Me._frtCurrency = Value + End Set + End Property + + Public Property frtInternational() As Decimal + Get + Return Me._frtInternational + End Get + Set + Me._frtInternational = Value + End Set + End Property + + Public Property frtEuNational() As Decimal + Get + Return Me._frtEuNational + End Get + Set + Me._frtEuNational = Value + End Set + End Property + + Public Property frtInland() As Decimal + Get + Return Me._frtInland + End Get + Set + Me._frtInland = Value + End Set + End Property + + Public Property frtProRating() As String + Get + Return Me._frtProRating + End Get + Set + Me._frtProRating = 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(TMicFreightCosts)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicFreightCosts 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 TMicFreightCosts object + ''' + ''' string to deserialize + ''' Output TMicFreightCosts 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 TMicFreightCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCosts) + 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 TMicFreightCosts) 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 TMicFreightCosts + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicFreightCosts) + 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 TMicFreightCosts + Return CType(SerializerXml.Deserialize(s), TMicFreightCosts) + End Function +#End Region + + ''' + ''' Serializes current TMicFreightCosts 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 TMicFreightCosts object + ''' + ''' File to load and deserialize + ''' Output TMicFreightCosts 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 TMicFreightCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicFreightCosts) + 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 TMicFreightCosts) 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 TMicFreightCosts + 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 TMicInsuranceCosts + +#Region "Private fields" + Private _insAmount As Decimal + + Private _insCurrency As String + + Private _insProRating As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property insAmount() As Decimal + Get + Return Me._insAmount + End Get + Set + Me._insAmount = Value + End Set + End Property + + Public Property insCurrency() As String + Get + Return Me._insCurrency + End Get + Set + Me._insCurrency = Value + End Set + End Property + + Public Property insProRating() As String + Get + Return Me._insProRating + End Get + Set + Me._insProRating = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInsuranceCosts)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInsuranceCosts 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 TMicInsuranceCosts object + ''' + ''' string to deserialize + ''' Output TMicInsuranceCosts 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 TMicInsuranceCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCosts) + 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 TMicInsuranceCosts) 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 TMicInsuranceCosts + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInsuranceCosts) + 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 TMicInsuranceCosts + Return CType(SerializerXml.Deserialize(s), TMicInsuranceCosts) + End Function +#End Region + + ''' + ''' Serializes current TMicInsuranceCosts 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 TMicInsuranceCosts object + ''' + ''' File to load and deserialize + ''' Output TMicInsuranceCosts 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 TMicInsuranceCosts, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInsuranceCosts) + 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 TMicInsuranceCosts) 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 TMicInsuranceCosts + 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 TMicLocationOfGoods + +#Region "Private fields" + Private _qual As String + + Private _authNo As String + + Private _additionIdentifier As String + + Private _type As String + + Private _customsOffice As String + + Private _country As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + 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 type() As String + Get + Return Me._type + End Get + Set + Me._type = Value + End Set + End Property + + Public Property customsOffice() As String + 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(TMicLocationOfGoods)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicLocationOfGoods 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 TMicLocationOfGoods object + ''' + ''' string to deserialize + ''' Output TMicLocationOfGoods 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 TMicLocationOfGoods, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLocationOfGoods) + 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 TMicLocationOfGoods) 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 TMicLocationOfGoods + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicLocationOfGoods) + 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 TMicLocationOfGoods + Return CType(SerializerXml.Deserialize(s), TMicLocationOfGoods) + End Function +#End Region + + ''' + ''' Serializes current TMicLocationOfGoods 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 TMicLocationOfGoods object + ''' + ''' File to load and deserialize + ''' Output TMicLocationOfGoods 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 TMicLocationOfGoods, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicLocationOfGoods) + 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 TMicLocationOfGoods) 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 TMicLocationOfGoods + 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 TMicDeferAccs + +#Region "Private fields" + Private _defermentAccount As TMicDeferAcc + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._defermentAccount = New TMicDeferAcc() + End Sub + + Public Property DefermentAccount() As TMicDeferAcc + Get + Return Me._defermentAccount + End Get + Set + Me._defermentAccount = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeferAccs)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDeferAccs 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 TMicDeferAccs object + ''' + ''' string to deserialize + ''' Output TMicDeferAccs 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 TMicDeferAccs, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeferAccs) + 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 TMicDeferAccs) 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 TMicDeferAccs + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeferAccs) + 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 TMicDeferAccs + Return CType(SerializerXml.Deserialize(s), TMicDeferAccs) + End Function +#End Region + + ''' + ''' Serializes current TMicDeferAccs 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 TMicDeferAccs object + ''' + ''' File to load and deserialize + ''' Output TMicDeferAccs 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 TMicDeferAccs, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeferAccs) + 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 TMicDeferAccs) 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 TMicDeferAccs + 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 TMicDeferAcc + +#Region "Private fields" + Private _accountNumber1 As String + + Private _accountNumber2 As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property accountNumber1() As String + Get + Return Me._accountNumber1 + End Get + Set + Me._accountNumber1 = Value + End Set + End Property + + Public Property accountNumber2() As String + Get + Return Me._accountNumber2 + End Get + Set + Me._accountNumber2 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicDeferAcc)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicDeferAcc 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 TMicDeferAcc object + ''' + ''' string to deserialize + ''' Output TMicDeferAcc 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 TMicDeferAcc, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeferAcc) + 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 TMicDeferAcc) 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 TMicDeferAcc + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicDeferAcc) + 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 TMicDeferAcc + Return CType(SerializerXml.Deserialize(s), TMicDeferAcc) + End Function +#End Region + + ''' + ''' Serializes current TMicDeferAcc 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 TMicDeferAcc object + ''' + ''' File to load and deserialize + ''' Output TMicDeferAcc 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 TMicDeferAcc, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicDeferAcc) + 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 TMicDeferAcc) 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 TMicDeferAcc + 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 TMicGuarantees + +#Region "Private fields" + Private _guarantee As List(Of TMicGuarantee) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._guarantee = New List(Of TMicGuarantee)() + End Sub + + + Public Property Guarantee() As List(Of TMicGuarantee) + Get + Return Me._guarantee + End Get + Set + Me._guarantee = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicGuarantees)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicGuarantees 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 TMicGuarantees object + ''' + ''' string to deserialize + ''' Output TMicGuarantees 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 TMicGuarantees, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicGuarantees) + 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 TMicGuarantees) 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 TMicGuarantees + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicGuarantees) + 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 TMicGuarantees + Return CType(SerializerXml.Deserialize(s), TMicGuarantees) + End Function +#End Region + + ''' + ''' Serializes current TMicGuarantees 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 TMicGuarantees object + ''' + ''' File to load and deserialize + ''' Output TMicGuarantees 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 TMicGuarantees, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicGuarantees) + 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 TMicGuarantees) 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 TMicGuarantees + 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 TMicGuarantee + +#Region "Private fields" + Private _guaranteeNumber As String + + Private _guaranteeCode As String + + Private _guaranteeType As String + + Private _guaranteeAmount As Decimal + + Private _guaranteeCurrency As String + + Private _guaranteeReference As String + + Private _guaranteeCustomsOffice As String + + Private _localBase As Decimal + + Private _factoringBase As String + + Private _customsRate As Decimal + + Private _guaranteeOwner As String + + Private _creationUser As String + + Private _creationDate As Date + + Private _modificationUser As String + + Private _modificationDate As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property guaranteeNumber() As String + Get + Return Me._guaranteeNumber + End Get + Set + Me._guaranteeNumber = Value + End Set + End Property + + Public Property guaranteeCode() As String + Get + Return Me._guaranteeCode + End Get + Set + Me._guaranteeCode = Value + End Set + End Property + + Public Property guaranteeType() As String + Get + Return Me._guaranteeType + End Get + Set + Me._guaranteeType = Value + End Set + End Property + + Public Property guaranteeAmount() As Decimal + Get + Return Me._guaranteeAmount + End Get + Set + Me._guaranteeAmount = Value + End Set + End Property + + Public Property guaranteeCurrency() As String + Get + Return Me._guaranteeCurrency + End Get + Set + Me._guaranteeCurrency = Value + End Set + End Property + + Public Property guaranteeReference() As String + Get + Return Me._guaranteeReference + End Get + Set + Me._guaranteeReference = Value + End Set + End Property + + Public Property guaranteeCustomsOffice() As String + Get + Return Me._guaranteeCustomsOffice + End Get + Set + Me._guaranteeCustomsOffice = Value + End Set + End Property + + Public Property localBase() As Decimal + Get + Return Me._localBase + End Get + Set + Me._localBase = Value + End Set + End Property + + Public Property factoringBase() As String + Get + Return Me._factoringBase + End Get + Set + Me._factoringBase = Value + End Set + End Property + + Public Property customsRate() As Decimal + Get + Return Me._customsRate + End Get + Set + Me._customsRate = Value + End Set + End Property + + Public Property guaranteeOwner() As String + Get + Return Me._guaranteeOwner + End Get + Set + Me._guaranteeOwner = Value + End Set + End Property + + Public Property creationUser() As String + Get + Return Me._creationUser + End Get + Set + Me._creationUser = Value + End Set + End Property + + Public Property creationDate() As Date + Get + Return Me._creationDate + End Get + Set + Me._creationDate = Value + End Set + End Property + + Public Property modificationUser() As String + Get + Return Me._modificationUser + End Get + Set + Me._modificationUser = Value + End Set + End Property + + Public Property modificationDate() As Date + Get + Return Me._modificationDate + End Get + Set + Me._modificationDate = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicGuarantee)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicGuarantee 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 TMicGuarantee object + ''' + ''' string to deserialize + ''' Output TMicGuarantee 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 TMicGuarantee, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicGuarantee) + 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 TMicGuarantee) 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 TMicGuarantee + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicGuarantee) + 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 TMicGuarantee + Return CType(SerializerXml.Deserialize(s), TMicGuarantee) + End Function +#End Region + + ''' + ''' Serializes current TMicGuarantee 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 TMicGuarantee object + ''' + ''' File to load and deserialize + ''' Output TMicGuarantee 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 TMicGuarantee, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicGuarantee) + 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 TMicGuarantee) 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 TMicGuarantee + 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 TMicCancellation + +#Region "Private fields" + Private _mrn As String + + Private _generatedLocalReferenceNumber As String + + Private _cancelType As String + + Private _cancelReason As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property mrn() As String + Get + Return Me._mrn + End Get + Set + Me._mrn = Value + End Set + End Property + + Public Property generatedLocalReferenceNumber() As String + Get + Return Me._generatedLocalReferenceNumber + End Get + Set + Me._generatedLocalReferenceNumber = Value + End Set + End Property + + Public Property cancelType() As String + Get + Return Me._cancelType + End Get + Set + Me._cancelType = Value + End Set + End Property + + Public Property cancelReason() As String + Get + Return Me._cancelReason + End Get + Set + Me._cancelReason = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicCancellation)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicCancellation 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 TMicCancellation object + ''' + ''' string to deserialize + ''' Output TMicCancellation 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 TMicCancellation, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCancellation) + 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 TMicCancellation) 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 TMicCancellation + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicCancellation) + 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 TMicCancellation + Return CType(SerializerXml.Deserialize(s), TMicCancellation) + End Function +#End Region + + ''' + ''' Serializes current TMicCancellation 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 TMicCancellation object + ''' + ''' File to load and deserialize + ''' Output TMicCancellation 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 TMicCancellation, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicCancellation) + 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 TMicCancellation) 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 TMicCancellation + 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/MicCustImportShipment.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.xsd similarity index 66% rename from VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.xsd rename to VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.xsd index 3187c37e..0a0a846b 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.xsd +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicCustImportMessage.xsd @@ -1,18 +1,20 @@ - - - - - - - - + + + + + + + Schema for MIC-CUST import messages. Copyright 2007, by MIC Customs Solutions. All rights reserved. + MIC-CUST Version 4.4.2 + + - Root element of import shipment messages - - + Root element of the import message + + true @@ -25,8 +27,11 @@ + + Import shipment type + - + Root element of the import message @@ -44,29 +49,50 @@ - + + + + Import invoice + Einfuhrrechnung + + + false + + 0-n + + + + + + + + + - Import invoice - Einfuhrrechnung + Cancellation message + Stornierungsnachricht - false + true - 0-n + + + + + - - - + + Import shipment type @@ -151,7 +177,7 @@ true - String1..2 + String1..3 MIC_EAVSDG EASSDGPART @@ -162,7 +188,7 @@ - + @@ -170,7 +196,7 @@ - Shipment version/An unique version id + An unique version id Versionsnummer @@ -214,7 +240,7 @@ - + @@ -232,7 +258,7 @@ - + Containers @@ -250,7 +276,7 @@ - + Shipment documents @@ -268,7 +294,7 @@ - + Shipment attributes @@ -286,11 +312,11 @@ - + Shipment business partner - Sendungsgeschaeftspartner + Sendungsgeschäftspartner @@ -305,7 +331,7 @@ - + Shipment previous documents @@ -323,7 +349,7 @@ - + Shipment completion parts of summary declaration @@ -341,11 +367,11 @@ - + Shipment additional information - Zusaetzliche Information auf Sendungsebene + Zusätzliche Information auf Sendungsebene false @@ -359,8 +385,8 @@ - - + + @@ -377,8 +403,8 @@ - - + + @@ -395,7 +421,7 @@ - + @@ -412,10 +438,10 @@ - + - + @@ -432,7 +458,7 @@ MIC_EINSDG EFSTYP - + @@ -445,7 +471,8 @@ - + Declaration Date/The customs date @@ -463,7 +490,8 @@ - + Type of declaration @@ -548,7 +576,7 @@ - + @@ -565,7 +593,7 @@ MIC_EAVSDG EASHELD MIC_EINSDG - EFSABGORT + EFSHELD @@ -606,7 +634,7 @@ false - String1..20 + String1..35 MIC_EAVSDG EASBSTORT @@ -640,7 +668,7 @@ - + @@ -675,7 +703,7 @@ false - String1..2 + String1..8 MIC_EAVSDG EASBDL @@ -686,7 +714,7 @@ - + @@ -759,7 +787,8 @@ - + Place Of Dispatch Description @@ -805,7 +834,30 @@ - + + + + Shipment Code + Sendungscode + + + false + String1..2 + + MIC_EAVSDG + EASCODE + MIC_EINSDG + EFSCODE + + + + + + + + + + The mode of transportation at the border @@ -816,18 +868,18 @@ MIC_EAVSDG - motMode:EASVKZGR, meansOfTransport:EASVKMART, motCountry:EASVKMLD, motVehicle:EASVKMGRK, meansOfTransportDescription:EASVKMINBEZ + motMode:EASVKZGR, meansOfTransport:EASVKMART, motCountry:EASVKMLD, motVehicle:EASVKMGRK, motTransferName:EASMOTNAME, meansOfTransportDescription:EASVKMINBEZ MIC_EINSDG motMode:EFSVKZGR, meansOfTransport:EFSVKMART, motCountry:EFSVKMLD, motVehicle:EFSVKMGRK, meansOfTransportDescription:EFSVKMINBEZ - + The mode of transport information at border crossing - Verkehrszweig bei Grenzueberschreitung + Verkehrszweig bei Grenzüberschreitung false @@ -841,7 +893,7 @@ - + The inland mode of transport information @@ -882,7 +934,7 @@ - + @@ -900,7 +952,7 @@ - + Shipment freight costs @@ -918,7 +970,8 @@ - + Shipment insurance costs @@ -936,7 +989,7 @@ - + Shipment additional costs @@ -982,11 +1035,11 @@ Position additions - Zusuetzliche Angaben + Zusätzliche Angaben false - String1..80 + String1..400 MIC_EAVSDG EASINFO @@ -997,7 +1050,7 @@ - + @@ -1037,7 +1090,7 @@ - + The estimated date of arrival. @@ -1059,7 +1112,7 @@ Related Party Indicator/Type of representation (direct, indirect, ...) - Kz. Vertretungsverhaeltnis + Kz. Vertretungsverhältnis false @@ -1101,7 +1154,7 @@ - + Customer specific fields @@ -1234,7 +1287,8 @@ - + Carrier Number @@ -1257,7 +1311,8 @@ - + Created by @@ -1275,7 +1330,8 @@ - + Created on @@ -1293,11 +1349,12 @@ - + Modified by - Geaendert von + Geändert von false @@ -1311,11 +1368,12 @@ - + Modified on - Geaendert am + Geändert am false @@ -1333,7 +1391,7 @@ Supervising customs office - Ueberwachungszollstelle + Überwachungszollstelle false @@ -1355,7 +1413,6 @@ Supervising customs office Type of identification of transport on arrival - Art der Transportidentifikation bei Ankunft false @@ -1371,51 +1428,452 @@ - - - - - - - Authorisation holders - - - - false - - 0-n - - - - - - - - - + + - Attribute as name/value pair - - - - true - - - MIC_CUST_WB_EU_AUTH_HOLDER - - MIC_CUST_EU_AUTH_HOLDER - - + Port Inspection and Quarantine Organization + false + String1..10 + + MIC_EAVSDG + EASPORTINSPECTIONORGCODE + MIC_EINSDG + EFSPORTINSPECTIONORGCODE + + + + + + + + + + + + + Licensing Authority + false + String1..10 + + MIC_EAVSDG + EASLICENSINGORGCODE + MIC_EINSDG + EFSLICENSINGORGCODE + + + + + + + + + + + + + Licensing Authority + false + String1..35 + + MIC_EAVSDG + EASWARENORT + MIC_EINSDG + EFSWARENORT + + + + + + + + + + + + + Destination Por + false + String1..8 + + MIC_EAVSDG + EASDESTINATIONPORT + MIC_EINSDG + EFSDESTINATIONPORT + + + + + + + + + + + + + Entry Port + false + String1..8 + + MIC_EAVSDG + EASENTRYPORT + MIC_EINSDG + EFSENTRYPORT + + + + + + + + + + + + + Departure Port + false + String1..8 + + MIC_EAVSDG + EASDEPARTUREPORT + MIC_EINSDG + EFSDEPARTUREPORT + + + + + + + + + + + + + Destination Inspection and Quarantine Organization + false + String1..10 + + MIC_EAVSDG + EASDESTINATIONINSPORGCODE + MIC_EINSDG + EFSDESTINATIONINSPORGCODE + + + + + + + + + + + + + Inspection and Quarantine Receiving Agency + false + String1..10 + + MIC_EAVSDG + EASRECEIVINGINSPECTIONORGCODE + MIC_EINSDG + EFSRECEIVINGINSPECTIONORGCODE + + + + + + + + + + + + + Type of identification of means of transport at arrival + false + String1..2 + + MIC_EAVSDG + EASARRIVALMEANSTYPE + MIC_EINSDG + EFSARRIVALMEANSTYPE + + + + + + + + + + + + + Identification of means of transport at arrival + false + String1..35 + + MIC_EAVSDG + EASARRIVALMEANSIDNO + MIC_EINSDG + EFSARRIVALMEANSIDNO + + + + + + + + + + + + + Additional statistical value currency + Währung für Zuschlag statistischer Wert + + + false + String1..3 + + MIC_EAVSDG + EASADDITIONALSTATISTICALCUR + MIC_EINSDG + EFSADDITIONALSTATISTICALCUR + + + + + + + + + + + + + Add. statistical value + Zuschlag statistischer Wert + + + false + Decimal(17,4) + + MIC_EAVSDG + EASADDITIONALSTATISTICALVALUE + MIC_EINSDG + EFSADDITIONALSTATISTICALVALUE + + + + + + + + + + + + + + The message broker used for customs declarations + Der Nachrichtenbroker, welcher für die Zollkommunikation verwendet wurde + + + false + String1..30 + + MIC_EAVSDG + EASBROKER + MIC_EINSDG + EFSBROKER + + + + + + + + + + + + + Waybill Number + BOL/AWB Nummer + + + false + String1..20 + + MIC_EAVSDG + EASWBNR + MIC_EINSDG + EFSWBNR + + + + + + + + + + + + + Waybill Date + BOL/AWB Datum + + + false + xs:date + + MIC_EAVSDG + EASWBDAT + MIC_EINSDG + EFSWBDAT + + + + + House Waybill Number + HBOL/HAWB Nummer + + + false + String1..20 + + MIC_EAVSDG + EASHWBNR + MIC_EINSDG + EFSHWBNR + + + + + + + + + + + + + House Waybill Date + HBOL/HAWB Datum + + + false + xs:date + + MIC_EAVSDG + EASHWBDAT + MIC_EINSDG + EFSHWBDAT + + + + + + + + Place of loading + Ladeort Ref: EH-Pap Feld 30 + + Ort, an dem die Waren verladen und ggf. Verschlüsse angebracht werden + false + + 1 + + + + + + + + + + + + Deferred payment account + Zahlungsaufschubkonto + + + false + String1..35 + + MIC_EAVSDG + EASDEFERREDPAYMENT + MIC_EINSDG + EFSDEFERREDPAYMENT + + + + + + + + + + + + + Presentations customs office + Gestellungszollstelle + + + false + String8 + + MIC_EAVSDG + EASPRESENTATIONSCUSTOMSOFFICE + MIC_EINSDG + EFSPRESENTATIONSCUSTOMSOFFICE + + + + + + + + + + + + + Type of payment + Zahlungsart + + + false + String1..2 + + MIC_EAVSDG + EASZAHLTYP + MIC_EINSDG + EFSZAHLTYP + + + + + + + + + - + - Deferment accounts + @@ -1430,7 +1888,7 @@ - + Attribute as name/value pair @@ -1450,10 +1908,10 @@ - + - Guarantees + @@ -1468,7 +1926,7 @@ - + Attribute as name/value pair @@ -1487,57 +1945,105 @@ - - - - Authorisation holder type - + + - + - Authorisation type code - Bewilligungsart-Code - - - true - String1..4 - - MIC_CUST_WB_EU_AUTH_HOLDER - WBATYPECD - MIC_CUST_EU_AUTH_HOLDER - AUHTYP - + Movement Reference Number (MRN) + Movement Reference Number (MRN) + + + true + String1..18 + + + + + + + + + + - + + + + - + - Identifier/EORI of authorisation holder - Identifikation - - - true - String1..17 - - MIC_CUST_WB_EU_AUTH_HOLDER - WBAID - MIC_CUST_EU_AUTH_HOLDER - AUHID - + Generated Local Reference Number + Identifier that the sending system (MIC) has to generate and is used + until the authorities are sending back an MRN, doesn't exist in WB + + false + String0..22 + + MIC_EINPOS + EFPLOCALREFERENCENUMBER + - + + + + + + + Type of cancelation + Stornierungstyp + + + true + String + + + + + + + + + + + + + + + + + Reason of cancellation + Stornierungsgrund + + + true + String + + + + + + + + + + + + + - + Deferment account type @@ -1586,7 +2092,7 @@ - + Guarantee type @@ -1599,7 +2105,7 @@ false - String1..38 + String1..35 MIC_CUST_WB_GUARANTEE WBGGRN @@ -1609,7 +2115,7 @@ - + @@ -1682,7 +2188,7 @@ Guarantee amount currency - Sicherheitsbetragswaehrung + Sicherheitsbetragswährung false @@ -1745,7 +2251,7 @@ Guarantee Local Base - Basis in Mandantenwaehrung + Basis in Mandantenwährung false @@ -1810,6 +2316,248 @@ + + + + Owner + Eigentümer + + + false + String1..17 + + MIC_CUST_WB_GUARANTEE + WBGUAOWNER + MIC_CUST_GUARANTEE + GUAOWNER + + + + + + + + + + + Created by + Erstellt von + + + false + String1..12 + + MIC_CUST_WB_GUARANTEE + WBGCREUSER + MIC_CUST_GUARANTEE + GUACREUSER + + + + + + + + Created on + Erstellt am + + + false + Xs:datetime + + MIC_CUST_WB_GUARANTEE + WBGCREDAT + MIC_CUST_GUARANTEE + GUACREDAT + + + + + + + + Modified by + Geändert von + + + false + String1..12 + + MIC_CUST_WB_GUARANTEE + WBGUSER + MIC_CUST_GUARANTEE + GUAUSER + + + + + + + + Modified on + Geändert am + + + false + Xs:datetime + + MIC_CUST_WB_GUARANTEE + WBGUSEDAT + MIC_CUST_GUARANTEE + GUAUSEDAT + + + + - \ No newline at end of file + + + location of goods + + + + + + Qualifier of Identification + Art der Ortsbestimmung + + + true + String1 + + MIC_EAVSDG + easlocationidentifierqual + MIC_EINSDG + efslocationidentifierqual + + + + + + + + + + + + + Authorisation Number + Bewilligungsnummer + + + false + String1..35 + + MIC_EAVSDG + easlocationauthno + MIC_EINSDG + efslocationauthno + + + + + + + + + + + + + Additional Identifier + Zusätzliche Kennung + + + false + String1..4 + + MIC_EAVSDG + easlocationadditionidentifier + MIC_EINSDG + efslocationadditionidentifier + + + + + + + + + + + + + Type of goods location + Typ des Warenorts + + + false + String1 + + MIC_EAVSDG + easlocationtype + MIC_EINSDG + efslocationtype + + + + + + + + + + + + + Goods location customs office + Warenort Zollstelle + + + false + String1..8 + + MIC_EAVSDG + easlocationcustomsoffice + MIC_EINSDG + efslocationcustomsoffice + + + + + + + + + + + + + Goods location country + Warenort Land + + + false + String1..8 + + MIC_EAVSDG + easlocationcountry + MIC_EINSDG + efslocationcountry + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.Designer.vb new file mode 100644 index 00000000..69837e52 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.Designer.vb @@ -0,0 +1,2300 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"MicInterface","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 MicInterface + + + Partial Public Class sendData + +#Region "Private fields" + Private _micInterfaceRequest As TMicInterface + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._micInterfaceRequest = New TMicInterface() + End Sub + + Public Property MicInterfaceRequest() As TMicInterface + Get + Return Me._micInterfaceRequest + End Get + Set + Me._micInterfaceRequest = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(sendData)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize sendData 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 sendData object + ''' + ''' string to deserialize + ''' Output sendData 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 sendData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, sendData) + 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 sendData) 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 sendData + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), sendData) + 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 sendData + Return CType(SerializerXml.Deserialize(s), sendData) + End Function +#End Region + + ''' + ''' Serializes current sendData 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 sendData object + ''' + ''' File to load and deserialize + ''' Output sendData 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 sendData, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, sendData) + 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 sendData) 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 sendData + 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 TMicInterface + +#Region "Private fields" + Private _connection As TMicInterfaceConnection + + Private _messages As List(Of TMicInterfaceMessage) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._messages = New List(Of TMicInterfaceMessage)() + Me._connection = New TMicInterfaceConnection() + End Sub + + Public Property Connection() As TMicInterfaceConnection + Get + Return Me._connection + End Get + Set + Me._connection = Value + End Set + End Property + + + Public Property Messages() As List(Of TMicInterfaceMessage) + Get + Return Me._messages + End Get + Set + Me._messages = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInterface)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterface 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 TMicInterface object + ''' + ''' string to deserialize + ''' Output TMicInterface 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 TMicInterface, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterface) + 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 TMicInterface) 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 TMicInterface + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterface) + 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 TMicInterface + Return CType(SerializerXml.Deserialize(s), TMicInterface) + End Function +#End Region + + ''' + ''' Serializes current TMicInterface 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 TMicInterface object + ''' + ''' File to load and deserialize + ''' Output TMicInterface 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 TMicInterface, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterface) + 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 TMicInterface) 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 TMicInterface + 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 TMicInterfaceConnection + +#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(TMicInterfaceConnection)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceConnection 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 TMicInterfaceConnection object + ''' + ''' string to deserialize + ''' Output TMicInterfaceConnection 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 TMicInterfaceConnection, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceConnection) + 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 TMicInterfaceConnection) 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 TMicInterfaceConnection + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceConnection) + 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 TMicInterfaceConnection + Return CType(SerializerXml.Deserialize(s), TMicInterfaceConnection) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceConnection 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 TMicInterfaceConnection object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceConnection 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 TMicInterfaceConnection, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceConnection) + 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 TMicInterfaceConnection) 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 TMicInterfaceConnection + 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 TMicInterfaceMessageAction + +#Region "Private fields" + Private _code As String + + Private _parameter As List(Of TMicInterfaceMessageActionParameter) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._parameter = New List(Of TMicInterfaceMessageActionParameter)() + End Sub + + Public Property code() As String + Get + Return Me._code + End Get + Set + Me._code = Value + End Set + End Property + + + Public Property parameter() As List(Of TMicInterfaceMessageActionParameter) + Get + Return Me._parameter + End Get + Set + Me._parameter = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInterfaceMessageAction)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceMessageAction 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 TMicInterfaceMessageAction object + ''' + ''' string to deserialize + ''' Output TMicInterfaceMessageAction 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 TMicInterfaceMessageAction, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageAction) + 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 TMicInterfaceMessageAction) 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 TMicInterfaceMessageAction + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceMessageAction) + 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 TMicInterfaceMessageAction + Return CType(SerializerXml.Deserialize(s), TMicInterfaceMessageAction) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceMessageAction 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 TMicInterfaceMessageAction object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceMessageAction 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 TMicInterfaceMessageAction, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageAction) + 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 TMicInterfaceMessageAction) 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 TMicInterfaceMessageAction + 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 TMicInterfaceMessageActionParameter + +#Region "Private fields" + Private _key As String + + Private _value As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + 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(TMicInterfaceMessageActionParameter)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceMessageActionParameter 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 TMicInterfaceMessageActionParameter object + ''' + ''' string to deserialize + ''' Output TMicInterfaceMessageActionParameter 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 TMicInterfaceMessageActionParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageActionParameter) + 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 TMicInterfaceMessageActionParameter) 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 TMicInterfaceMessageActionParameter + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceMessageActionParameter) + 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 TMicInterfaceMessageActionParameter + Return CType(SerializerXml.Deserialize(s), TMicInterfaceMessageActionParameter) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceMessageActionParameter 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 TMicInterfaceMessageActionParameter object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceMessageActionParameter 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 TMicInterfaceMessageActionParameter, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageActionParameter) + 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 TMicInterfaceMessageActionParameter) 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 TMicInterfaceMessageActionParameter + 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 TMicInterfaceMessageEnvelope + +#Region "Private fields" + Private _messageID As String + + Private _partyID As String + + Private _schemaID As String + + Private _transActionID As String + + Private _sequenceNum As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property messageID() As String + Get + Return Me._messageID + End Get + Set + Me._messageID = Value + End Set + End Property + + Public Property partyID() As String + Get + Return Me._partyID + End Get + Set + Me._partyID = Value + End Set + End Property + + Public Property schemaID() As String + Get + Return Me._schemaID + End Get + Set + Me._schemaID = Value + End Set + End Property + + Public Property transActionID() As String + Get + Return Me._transActionID + End Get + Set + Me._transActionID = Value + End Set + End Property + + + Public Property sequenceNum() As String + Get + Return Me._sequenceNum + End Get + Set + Me._sequenceNum = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInterfaceMessageEnvelope)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceMessageEnvelope 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 TMicInterfaceMessageEnvelope object + ''' + ''' string to deserialize + ''' Output TMicInterfaceMessageEnvelope 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 TMicInterfaceMessageEnvelope, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageEnvelope) + 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 TMicInterfaceMessageEnvelope) 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 TMicInterfaceMessageEnvelope + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceMessageEnvelope) + 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 TMicInterfaceMessageEnvelope + Return CType(SerializerXml.Deserialize(s), TMicInterfaceMessageEnvelope) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceMessageEnvelope 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 TMicInterfaceMessageEnvelope object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceMessageEnvelope 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 TMicInterfaceMessageEnvelope, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageEnvelope) + 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 TMicInterfaceMessageEnvelope) 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 TMicInterfaceMessageEnvelope + 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 TMicInterfaceMessage + +#Region "Private fields" + Private _envelope As TMicInterfaceMessageEnvelope + + Private _actionCode As TMicInterfaceMessageAction + + Private _body As TMicInterfaceMessageBody + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._body = New TMicInterfaceMessageBody() + Me._actionCode = New TMicInterfaceMessageAction() + Me._envelope = New TMicInterfaceMessageEnvelope() + End Sub + + Public Property Envelope() As TMicInterfaceMessageEnvelope + Get + Return Me._envelope + End Get + Set + Me._envelope = Value + End Set + End Property + + Public Property ActionCode() As TMicInterfaceMessageAction + Get + Return Me._actionCode + End Get + Set + Me._actionCode = Value + End Set + End Property + + Public Property Body() As TMicInterfaceMessageBody + Get + Return Me._body + End Get + Set + Me._body = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TMicInterfaceMessage)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceMessage 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 TMicInterfaceMessage object + ''' + ''' string to deserialize + ''' Output TMicInterfaceMessage 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 TMicInterfaceMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessage) + 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 TMicInterfaceMessage) 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 TMicInterfaceMessage + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceMessage) + 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 TMicInterfaceMessage + Return CType(SerializerXml.Deserialize(s), TMicInterfaceMessage) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceMessage 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 TMicInterfaceMessage object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceMessage 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 TMicInterfaceMessage, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessage) + 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 TMicInterfaceMessage) 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 TMicInterfaceMessage + 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 TMicInterfaceMessageBody + +#Region "Private fields" + Private _messageType As String + + Private _value As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + + Public Property messageType() As String + Get + Return Me._messageType + End Get + Set + Me._messageType = 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(TMicInterfaceMessageBody)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TMicInterfaceMessageBody 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 TMicInterfaceMessageBody object + ''' + ''' string to deserialize + ''' Output TMicInterfaceMessageBody 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 TMicInterfaceMessageBody, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageBody) + 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 TMicInterfaceMessageBody) 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 TMicInterfaceMessageBody + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TMicInterfaceMessageBody) + 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 TMicInterfaceMessageBody + Return CType(SerializerXml.Deserialize(s), TMicInterfaceMessageBody) + End Function +#End Region + + ''' + ''' Serializes current TMicInterfaceMessageBody 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 TMicInterfaceMessageBody object + ''' + ''' File to load and deserialize + ''' Output TMicInterfaceMessageBody 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 TMicInterfaceMessageBody, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TMicInterfaceMessageBody) + 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 TMicInterfaceMessageBody) 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 TMicInterfaceMessageBody + 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 sendDataResponse + +#Region "Private fields" + Private _micInterfaceResponse As TMicInterface + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._micInterfaceResponse = New TMicInterface() + End Sub + + Public Property MicInterfaceResponse() As TMicInterface + Get + Return Me._micInterfaceResponse + End Get + Set + Me._micInterfaceResponse = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(sendDataResponse)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize sendDataResponse 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 sendDataResponse object + ''' + ''' string to deserialize + ''' Output sendDataResponse 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 sendDataResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, sendDataResponse) + 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 sendDataResponse) 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 sendDataResponse + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), sendDataResponse) + 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 sendDataResponse + Return CType(SerializerXml.Deserialize(s), sendDataResponse) + End Function +#End Region + + ''' + ''' Serializes current sendDataResponse 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 sendDataResponse object + ''' + ''' File to load and deserialize + ''' Output sendDataResponse 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 sendDataResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, sendDataResponse) + 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 sendDataResponse) 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 sendDataResponse + 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 getDataForPartnerID + +#Region "Private fields" + Private _partnerID As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property partnerID() As String + Get + Return Me._partnerID + End Get + Set + Me._partnerID = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(getDataForPartnerID)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize getDataForPartnerID 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 getDataForPartnerID object + ''' + ''' string to deserialize + ''' Output getDataForPartnerID 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 getDataForPartnerID, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataForPartnerID) + 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 getDataForPartnerID) 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 getDataForPartnerID + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), getDataForPartnerID) + 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 getDataForPartnerID + Return CType(SerializerXml.Deserialize(s), getDataForPartnerID) + End Function +#End Region + + ''' + ''' Serializes current getDataForPartnerID 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 getDataForPartnerID object + ''' + ''' File to load and deserialize + ''' Output getDataForPartnerID 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 getDataForPartnerID, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataForPartnerID) + 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 getDataForPartnerID) 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 getDataForPartnerID + 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 getDataForTransActionID + +#Region "Private fields" + Private _transActionID As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property transActionID() As String + Get + Return Me._transActionID + End Get + Set + Me._transActionID = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(getDataForTransActionID)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize getDataForTransActionID 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 getDataForTransActionID object + ''' + ''' string to deserialize + ''' Output getDataForTransActionID 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 getDataForTransActionID, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataForTransActionID) + 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 getDataForTransActionID) 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 getDataForTransActionID + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), getDataForTransActionID) + 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 getDataForTransActionID + Return CType(SerializerXml.Deserialize(s), getDataForTransActionID) + End Function +#End Region + + ''' + ''' Serializes current getDataForTransActionID 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 getDataForTransActionID object + ''' + ''' File to load and deserialize + ''' Output getDataForTransActionID 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 getDataForTransActionID, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataForTransActionID) + 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 getDataForTransActionID) 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 getDataForTransActionID + 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 getDataResponse + +#Region "Private fields" + Private _micInterfaceResponse As TMicInterface + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._micInterfaceResponse = New TMicInterface() + End Sub + + Public Property MicInterfaceResponse() As TMicInterface + Get + Return Me._micInterfaceResponse + End Get + Set + Me._micInterfaceResponse = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(getDataResponse)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize getDataResponse 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 getDataResponse object + ''' + ''' string to deserialize + ''' Output getDataResponse 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 getDataResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataResponse) + 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 getDataResponse) 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 getDataResponse + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), getDataResponse) + 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 getDataResponse + Return CType(SerializerXml.Deserialize(s), getDataResponse) + End Function +#End Region + + ''' + ''' Serializes current getDataResponse 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 getDataResponse object + ''' + ''' File to load and deserialize + ''' Output getDataResponse 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 getDataResponse, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, getDataResponse) + 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 getDataResponse) 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 getDataResponse + 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_IMPORT/MicInterface.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.xsd new file mode 100644 index 00000000..87196be7 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_IMPORT/MicInterface.xsd @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Connection Details: are used to identify the communicationg system. + + + + + + + + + + Connection Details: are used to identify the communicationg system. + + + + + + + + + + Connection Details: are used to identify the communicationg system. + + + + + + + + + + Connection Details: are used to identify the communicationg system. + + + + + + Set of Interface-Messages + + + + + + + Details of the connection to the ERP-System + + + + + ConnectionID of the MIC-Interface WebService + + + + + + + + + + The partnerID is a unique ID provided by the MIC-System and classify the + ERP-System of the customer. This information is given by MIC. + + + + + + Creationdate/time of the Message in the ERP-System + + + + + + + MIC Inteface Messages (able to contain multible messages) + + + + + Interface-Message + + + + + + + MIC Interface Message + + + + + Message-Envelope: description of the provided message + + + + + The ActionCode definies the autmoatic process in the MIC-Application. + + + + + + Interface-Message + + + + + + + + + + + + + + MIC Interface Message Envelope: description of the single message + + + + + Unique Message ID + + + + + partyID is used as a separations of departments or single messagegroups + + + + + + Versionnumber. Information provided by MIC + + + + + Unique Identifier of a transaction (declaration) e.g. MRN or LRN + + + + + + Running number of the transActionID + + + + + + + Action Requested for automatic processing + + + + + code + + + + + additional parameters + + + + + + + + + + + Type: xs:date + + + + + + Type: xs:dateTime + + + + + + Envelope:Unique transactionId used for communication with at.mic.edis.ws.test + + + + + + + + + Envelope:running count + + + + + + envelope:Unique Message ID used for communication in message envelope + + + + + + + + + Envelope:code of message schema version + + + + + + + + Envelope: communication partner + + + + + + + + + Keyname of the parameter + + + + + + + + + Value of the parameterkey + + + + + + + + + Action request for automatic processing + + + + + + + + + ConnectionID of the MIC-Webservice + + + + + + + + + XML Interface Message + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.Designer.vb new file mode 100644 index 00000000..3d2cfdca --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.Designer.vb @@ -0,0 +1,10283 @@ +'' ------------------------------------------------------------------------------ +'' +'' Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com +'' {"TargetFramework":"Net48","NameSpace":"MicNctsTransitDeclarationP5","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 MicNctsTransitDeclarationP5 + + + Partial Public Class TransitDeclaration + +#Region "Private fields" + Private _transitDeclarationHeader As TransitDeclarationHeaderType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._transitDeclarationHeader = New TransitDeclarationHeaderType() + End Sub + + Public Property TransitDeclarationHeader() As TransitDeclarationHeaderType + Get + Return Me._transitDeclarationHeader + End Get + Set + Me._transitDeclarationHeader = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclaration)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclaration 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 TransitDeclaration object + ''' + ''' string to deserialize + ''' Output TransitDeclaration 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 TransitDeclaration, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclaration) + 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 TransitDeclaration) 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 TransitDeclaration + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclaration) + 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 TransitDeclaration + Return CType(SerializerXml.Deserialize(s), TransitDeclaration) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclaration 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 TransitDeclaration object + ''' + ''' File to load and deserialize + ''' Output TransitDeclaration 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 TransitDeclaration, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclaration) + 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 TransitDeclaration) 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 TransitDeclaration + 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 TransitDeclarationHeaderType + +#Region "Private fields" + Private _company As String + + Private _plant As String + + Private _localReferenceNumber As String + + Private _referenceNumberUniqueConsignmentReference As String + + Private _templateName As String + + Private _createdFor As String + + Private _useAsTemplate As Boolean + + Private _declarationType As String + + Private _transitDeclarationType As String + + Private _additionalDeclarationType As String + + Private _month As String + + Private _declarationDate As Date + + Private _limitDate As Date + + Private _security As String + + Private _reducedDatasetIndicator As Boolean + + Private _specificCircumstanceIndicator As String + + Private _bindingItinerary As Boolean + + Private _customsOfficeOfDeparture As String + + Private _customsOfficeOfDestinationDeclared As String + + Private _tirCarnetNumber As String + + Private _signingInformation As String + + Private _holderOfTheTransitProcedure As HolderOfTheTransitProcedureType + + Private _representative As TransitDeclarationRepresentativeType + + Private _authorisation As List(Of AuthorisationType) + + Private _guarantee As List(Of GuaranteeType) + + Private _consignment As TransitDeclarationConsignmentType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._consignment = New TransitDeclarationConsignmentType() + Me._guarantee = New List(Of GuaranteeType)() + Me._authorisation = New List(Of AuthorisationType)() + Me._representative = New TransitDeclarationRepresentativeType() + Me._holderOfTheTransitProcedure = New HolderOfTheTransitProcedureType() + 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 localReferenceNumber() As String + Get + Return Me._localReferenceNumber + End Get + Set + Me._localReferenceNumber = Value + End Set + End Property + + Public Property referenceNumberUniqueConsignmentReference() As String + Get + Return Me._referenceNumberUniqueConsignmentReference + End Get + Set + Me._referenceNumberUniqueConsignmentReference = Value + End Set + End Property + + Public Property templateName() As String + Get + Return Me._templateName + End Get + Set + Me._templateName = Value + End Set + End Property + + Public Property createdFor() As String + Get + Return Me._createdFor + End Get + Set + Me._createdFor = Value + End Set + End Property + + Public Property useAsTemplate() As Boolean + Get + Return Me._useAsTemplate + End Get + Set + Me._useAsTemplate = Value + End Set + End Property + + Public Property declarationType() As String + Get + Return Me._declarationType + End Get + Set + Me._declarationType = Value + End Set + End Property + + Public Property transitDeclarationType() As String + Get + Return Me._transitDeclarationType + End Get + Set + Me._transitDeclarationType = Value + End Set + End Property + + Public Property additionalDeclarationType() As String + Get + Return Me._additionalDeclarationType + End Get + Set + Me._additionalDeclarationType = Value + End Set + End Property + + Public Property month() As String + Get + Return Me._month + End Get + Set + Me._month = Value + End Set + End Property + + + Public Property declarationDate() As Date + Get + Return Me._declarationDate + End Get + Set + Me._declarationDate = Value + End Set + End Property + + + Public Property limitDate() As Date + Get + Return Me._limitDate + End Get + Set + Me._limitDate = 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 reducedDatasetIndicator() As Boolean + Get + Return Me._reducedDatasetIndicator + End Get + Set + Me._reducedDatasetIndicator = Value + End Set + End Property + + Public Property specificCircumstanceIndicator() As String + Get + Return Me._specificCircumstanceIndicator + End Get + Set + Me._specificCircumstanceIndicator = Value + End Set + End Property + + Public Property bindingItinerary() As Boolean + Get + Return Me._bindingItinerary + End Get + Set + Me._bindingItinerary = Value + End Set + End Property + + Public Property customsOfficeOfDeparture() As String + Get + Return Me._customsOfficeOfDeparture + End Get + Set + Me._customsOfficeOfDeparture = Value + End Set + End Property + + Public Property customsOfficeOfDestinationDeclared() As String + Get + Return Me._customsOfficeOfDestinationDeclared + End Get + Set + Me._customsOfficeOfDestinationDeclared = Value + End Set + End Property + + Public Property tirCarnetNumber() As String + Get + Return Me._tirCarnetNumber + End Get + Set + Me._tirCarnetNumber = Value + End Set + End Property + + Public Property signingInformation() As String + Get + Return Me._signingInformation + End Get + Set + Me._signingInformation = Value + End Set + End Property + + Public Property holderOfTheTransitProcedure() As HolderOfTheTransitProcedureType + Get + Return Me._holderOfTheTransitProcedure + End Get + Set + Me._holderOfTheTransitProcedure = Value + End Set + End Property + + Public Property representative() As TransitDeclarationRepresentativeType + Get + Return Me._representative + End Get + Set + Me._representative = Value + End Set + End Property + + + Public Property authorisation() As List(Of AuthorisationType) + Get + Return Me._authorisation + End Get + Set + Me._authorisation = Value + End Set + End Property + + + Public Property guarantee() As List(Of GuaranteeType) + Get + Return Me._guarantee + End Get + Set + Me._guarantee = Value + End Set + End Property + + Public Property consignment() As TransitDeclarationConsignmentType + Get + Return Me._consignment + End Get + Set + Me._consignment = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationHeaderType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclarationHeaderType 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 TransitDeclarationHeaderType object + ''' + ''' string to deserialize + ''' Output TransitDeclarationHeaderType 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 TransitDeclarationHeaderType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationHeaderType) + 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 TransitDeclarationHeaderType) 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 TransitDeclarationHeaderType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationHeaderType) + 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 TransitDeclarationHeaderType + Return CType(SerializerXml.Deserialize(s), TransitDeclarationHeaderType) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclarationHeaderType 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 TransitDeclarationHeaderType object + ''' + ''' File to load and deserialize + ''' Output TransitDeclarationHeaderType 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 TransitDeclarationHeaderType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationHeaderType) + 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 TransitDeclarationHeaderType) 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 TransitDeclarationHeaderType + 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 HolderOfTheTransitProcedureType + +#Region "Private fields" + Private _addressNumber As String + + Private _identificationNumber As String + + Private _tirHolderIdentificationNumber As String + + Private _name As String + + Private _address As AddressType + + Private _contactPerson As ContactPersonType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._address = New AddressType() + End Sub + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = 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 tirHolderIdentificationNumber() As String + Get + Return Me._tirHolderIdentificationNumber + End Get + Set + Me._tirHolderIdentificationNumber = 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 address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + 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(HolderOfTheTransitProcedureType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HolderOfTheTransitProcedureType 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 HolderOfTheTransitProcedureType object + ''' + ''' string to deserialize + ''' Output HolderOfTheTransitProcedureType 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 HolderOfTheTransitProcedureType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HolderOfTheTransitProcedureType) + 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 HolderOfTheTransitProcedureType) 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 HolderOfTheTransitProcedureType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HolderOfTheTransitProcedureType) + 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 HolderOfTheTransitProcedureType + Return CType(SerializerXml.Deserialize(s), HolderOfTheTransitProcedureType) + End Function +#End Region + + ''' + ''' Serializes current HolderOfTheTransitProcedureType 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 HolderOfTheTransitProcedureType object + ''' + ''' File to load and deserialize + ''' Output HolderOfTheTransitProcedureType 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 HolderOfTheTransitProcedureType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HolderOfTheTransitProcedureType) + 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 HolderOfTheTransitProcedureType) 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 HolderOfTheTransitProcedureType + 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 AddressType + +#Region "Private fields" + Private _streetAndNumber As String + + Private _postcode As String + + Private _city As String + + Private _country As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property streetAndNumber() As String + Get + Return Me._streetAndNumber + End Get + Set + Me._streetAndNumber = Value + End Set + End Property + + Public Property postcode() As String + Get + Return Me._postcode + End Get + Set + Me._postcode = Value + End Set + End Property + + Public Property city() As String + Get + Return Me._city + End Get + Set + Me._city = 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(AddressType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize AddressType 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 AddressType object + ''' + ''' string to deserialize + ''' Output AddressType 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 AddressType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AddressType) + 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 AddressType) 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 AddressType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AddressType) + 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 AddressType + Return CType(SerializerXml.Deserialize(s), AddressType) + End Function +#End Region + + ''' + ''' Serializes current AddressType 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 AddressType object + ''' + ''' File to load and deserialize + ''' Output AddressType 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 AddressType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AddressType) + 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 AddressType) 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 AddressType + 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 DangerousGoodsOfConsignmentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _unDangerousGoodsNumber As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property unDangerousGoodsNumber() As String + Get + Return Me._unDangerousGoodsNumber + End Get + Set + Me._unDangerousGoodsNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DangerousGoodsOfConsignmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize DangerousGoodsOfConsignmentType 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 DangerousGoodsOfConsignmentType object + ''' + ''' string to deserialize + ''' Output DangerousGoodsOfConsignmentType 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 DangerousGoodsOfConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, DangerousGoodsOfConsignmentType) + 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 DangerousGoodsOfConsignmentType) 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 DangerousGoodsOfConsignmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DangerousGoodsOfConsignmentType) + 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 DangerousGoodsOfConsignmentType + Return CType(SerializerXml.Deserialize(s), DangerousGoodsOfConsignmentType) + End Function +#End Region + + ''' + ''' Serializes current DangerousGoodsOfConsignmentType 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 DangerousGoodsOfConsignmentType object + ''' + ''' File to load and deserialize + ''' Output DangerousGoodsOfConsignmentType 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 DangerousGoodsOfConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, DangerousGoodsOfConsignmentType) + 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 DangerousGoodsOfConsignmentType) 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 DangerousGoodsOfConsignmentType + 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 ConsignmentItemPackagingType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _typeOfPackages As String + + Private _numberOfPackages As Integer + + Private _shippingMarks As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property typeOfPackages() As String + Get + Return Me._typeOfPackages + End Get + Set + Me._typeOfPackages = Value + End Set + End Property + + Public Property numberOfPackages() As Integer + Get + Return Me._numberOfPackages + End Get + Set + Me._numberOfPackages = Value + End Set + End Property + + Public Property shippingMarks() As String + Get + Return Me._shippingMarks + End Get + Set + Me._shippingMarks = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ConsignmentItemPackagingType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ConsignmentItemPackagingType 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 ConsignmentItemPackagingType object + ''' + ''' string to deserialize + ''' Output ConsignmentItemPackagingType 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 ConsignmentItemPackagingType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ConsignmentItemPackagingType) + 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 ConsignmentItemPackagingType) 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 ConsignmentItemPackagingType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemPackagingType) + 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 ConsignmentItemPackagingType + Return CType(SerializerXml.Deserialize(s), ConsignmentItemPackagingType) + End Function +#End Region + + ''' + ''' Serializes current ConsignmentItemPackagingType 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 ConsignmentItemPackagingType object + ''' + ''' File to load and deserialize + ''' Output ConsignmentItemPackagingType 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 ConsignmentItemPackagingType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ConsignmentItemPackagingType) + 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 ConsignmentItemPackagingType) 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 ConsignmentItemPackagingType + 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 ConsignmentItemType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _goodsItemNumber As Integer + + Private _declarationGoodsItemNumber As Integer + + Private _declarationType As String + + Private _partNumber As String + + Private _descriptionOfGoods As String + + Private _cusCode As String + + Private _commodityCode As String + + Private _grossMass As Decimal + + Private _netMass As Decimal + + Private _countryOfDispatch As String + + Private _countryOfDestination As String + + Private _referenceNumberUniqueConsignmentReference As String + + Private _packaging As List(Of ConsignmentItemPackagingType) + + Private _dangerousGoodsOfConsignment As List(Of DangerousGoodsOfConsignmentType) + + Private _consignee As OperatorWithContactAndSubsidiaryType + + Private _supplementaryUnits As Decimal + + Private _statisticalValue As Decimal + + Private _statisticalQuantity As Decimal + + Private _foreignStatisticalValue As Decimal + + Private _foreignCurrency As String + + Private _methodOfPayment As String + + Private _previousDocument As List(Of ItemPreviousDocumentType) + + Private _supportingDocument As List(Of SupportingDocumentType) + + Private _transportDocument As List(Of TransportDocumentType) + + Private _additionalInformation As List(Of AdditionalInformationType) + + Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) + + Private _additionalReference As List(Of AdditionalReferenceType) + + Private _customerFields As CustomerFieldsType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._customerFields = New CustomerFieldsType() + Me._additionalReference = New List(Of AdditionalReferenceType)() + Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() + Me._additionalInformation = New List(Of AdditionalInformationType)() + Me._transportDocument = New List(Of TransportDocumentType)() + Me._supportingDocument = New List(Of SupportingDocumentType)() + Me._previousDocument = New List(Of ItemPreviousDocumentType)() + Me._consignee = New OperatorWithContactAndSubsidiaryType() + Me._dangerousGoodsOfConsignment = New List(Of DangerousGoodsOfConsignmentType)() + Me._packaging = New List(Of ConsignmentItemPackagingType)() + End Sub + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property goodsItemNumber() As Integer + Get + Return Me._goodsItemNumber + End Get + Set + Me._goodsItemNumber = Value + End Set + End Property + + Public Property declarationGoodsItemNumber() As Integer + Get + Return Me._declarationGoodsItemNumber + End Get + Set + Me._declarationGoodsItemNumber = Value + End Set + End Property + + Public Property declarationType() As String + Get + Return Me._declarationType + End Get + Set + Me._declarationType = Value + End Set + End Property + + Public Property partNumber() As String + Get + Return Me._partNumber + End Get + Set + Me._partNumber = Value + End Set + End Property + + Public Property descriptionOfGoods() As String + Get + Return Me._descriptionOfGoods + End Get + Set + Me._descriptionOfGoods = Value + End Set + End Property + + Public Property cusCode() As String + Get + Return Me._cusCode + End Get + Set + Me._cusCode = Value + End Set + End Property + + Public Property commodityCode() As String + Get + Return Me._commodityCode + End Get + Set + Me._commodityCode = 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 netMass() As Decimal + Get + Return Me._netMass + End Get + Set + Me._netMass = Value + End Set + End Property + + Public Property countryOfDispatch() As String + Get + Return Me._countryOfDispatch + End Get + Set + Me._countryOfDispatch = Value + End Set + End Property + + Public Property countryOfDestination() As String + Get + Return Me._countryOfDestination + End Get + Set + Me._countryOfDestination = Value + End Set + End Property + + Public Property referenceNumberUniqueConsignmentReference() As String + Get + Return Me._referenceNumberUniqueConsignmentReference + End Get + Set + Me._referenceNumberUniqueConsignmentReference = Value + End Set + End Property + + + Public Property packaging() As List(Of ConsignmentItemPackagingType) + Get + Return Me._packaging + End Get + Set + Me._packaging = Value + End Set + End Property + + + Public Property dangerousGoodsOfConsignment() As List(Of DangerousGoodsOfConsignmentType) + Get + Return Me._dangerousGoodsOfConsignment + End Get + Set + Me._dangerousGoodsOfConsignment = Value + End Set + End Property + + Public Property consignee() As OperatorWithContactAndSubsidiaryType + Get + Return Me._consignee + End Get + Set + Me._consignee = Value + End Set + End Property + + Public Property supplementaryUnits() As Decimal + Get + Return Me._supplementaryUnits + End Get + Set + Me._supplementaryUnits = Value + End Set + End Property + + Public Property statisticalValue() As Decimal + Get + Return Me._statisticalValue + End Get + Set + Me._statisticalValue = 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 foreignStatisticalValue() As Decimal + Get + Return Me._foreignStatisticalValue + End Get + Set + Me._foreignStatisticalValue = Value + End Set + End Property + + Public Property foreignCurrency() As String + Get + Return Me._foreignCurrency + End Get + Set + Me._foreignCurrency = Value + End Set + End Property + + Public Property methodOfPayment() As String + Get + Return Me._methodOfPayment + End Get + Set + Me._methodOfPayment = Value + End Set + End Property + + + Public Property previousDocument() As List(Of ItemPreviousDocumentType) + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = Value + End Set + End Property + + + Public Property supportingDocument() As List(Of SupportingDocumentType) + Get + Return Me._supportingDocument + End Get + Set + Me._supportingDocument = Value + End Set + End Property + + + Public Property transportDocument() As List(Of TransportDocumentType) + Get + Return Me._transportDocument + End Get + Set + Me._transportDocument = Value + End Set + End Property + + + Public Property additionalInformation() As List(Of AdditionalInformationType) + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + + Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) + Get + Return Me._additionalSupplyChainActor + End Get + Set + Me._additionalSupplyChainActor = Value + End Set + End Property + + + Public Property additionalReference() As List(Of AdditionalReferenceType) + Get + Return Me._additionalReference + End Get + Set + Me._additionalReference = Value + End Set + End Property + + Public Property customerFields() As CustomerFieldsType + 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(ConsignmentItemType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ConsignmentItemType 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 ConsignmentItemType object + ''' + ''' string to deserialize + ''' Output ConsignmentItemType 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 ConsignmentItemType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ConsignmentItemType) + 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 ConsignmentItemType) 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 ConsignmentItemType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ConsignmentItemType) + 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 ConsignmentItemType + Return CType(SerializerXml.Deserialize(s), ConsignmentItemType) + End Function +#End Region + + ''' + ''' Serializes current ConsignmentItemType 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 ConsignmentItemType object + ''' + ''' File to load and deserialize + ''' Output ConsignmentItemType 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 ConsignmentItemType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ConsignmentItemType) + 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 ConsignmentItemType) 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 ConsignmentItemType + 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 OperatorWithContactAndSubsidiaryType + +#Region "Private fields" + Private _addressNumber As String + + Private _identificationNumber As String + + Private _subsidiaryNumber As String + + Private _name As String + + Private _address As AddressType + + Private _contactPerson As ContactPersonType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._address = New AddressType() + End Sub + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = 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 subsidiaryNumber() As String + Get + Return Me._subsidiaryNumber + End Get + Set + Me._subsidiaryNumber = 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 address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + 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(OperatorWithContactAndSubsidiaryType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize OperatorWithContactAndSubsidiaryType 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 OperatorWithContactAndSubsidiaryType object + ''' + ''' string to deserialize + ''' Output OperatorWithContactAndSubsidiaryType 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 OperatorWithContactAndSubsidiaryType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, OperatorWithContactAndSubsidiaryType) + 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 OperatorWithContactAndSubsidiaryType) 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 OperatorWithContactAndSubsidiaryType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), OperatorWithContactAndSubsidiaryType) + 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 OperatorWithContactAndSubsidiaryType + Return CType(SerializerXml.Deserialize(s), OperatorWithContactAndSubsidiaryType) + End Function +#End Region + + ''' + ''' Serializes current OperatorWithContactAndSubsidiaryType 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 OperatorWithContactAndSubsidiaryType object + ''' + ''' File to load and deserialize + ''' Output OperatorWithContactAndSubsidiaryType 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 OperatorWithContactAndSubsidiaryType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, OperatorWithContactAndSubsidiaryType) + 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 OperatorWithContactAndSubsidiaryType) 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 OperatorWithContactAndSubsidiaryType + 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 ContactPersonType + +#Region "Private fields" + Private _name As String + + Private _phoneNumber As String + + Private _emailAddress As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property name() As String + Get + Return Me._name + End Get + Set + Me._name = Value + End Set + End Property + + Public Property phoneNumber() As String + Get + Return Me._phoneNumber + End Get + Set + Me._phoneNumber = Value + End Set + End Property + + Public Property emailAddress() As String + Get + Return Me._emailAddress + End Get + Set + Me._emailAddress = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ContactPersonType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ContactPersonType 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 ContactPersonType object + ''' + ''' string to deserialize + ''' Output ContactPersonType 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 ContactPersonType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ContactPersonType) + 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 ContactPersonType) 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 ContactPersonType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ContactPersonType) + 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 ContactPersonType + Return CType(SerializerXml.Deserialize(s), ContactPersonType) + End Function +#End Region + + ''' + ''' Serializes current ContactPersonType 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 ContactPersonType object + ''' + ''' File to load and deserialize + ''' Output ContactPersonType 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 ContactPersonType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ContactPersonType) + 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 ContactPersonType) 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 ContactPersonType + 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 ItemPreviousDocumentType + Inherits PreviousDocumentType + +#Region "Private fields" + Private _previousDocumentTypeOfPackages As String + + Private _previousDocumentNumberOfPackages As Integer + + Private _previousDocumentMeasurementUnit As String + + Private _previousDocumentQuantity As Decimal + + Private _depreciatedAmountOfGuarantee As Long + + Private _authorisationSpecialProcedure As String + + Private _commodityCodeOfEarlyExportedEqualMaterial As String + + Private _earlyExportOfEqualMaterial As String + + Private _partNumberOfPreviousDocument As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property previousDocumentTypeOfPackages() As String + Get + Return Me._previousDocumentTypeOfPackages + End Get + Set + Me._previousDocumentTypeOfPackages = Value + End Set + End Property + + Public Property previousDocumentNumberOfPackages() As Integer + Get + Return Me._previousDocumentNumberOfPackages + End Get + Set + Me._previousDocumentNumberOfPackages = Value + End Set + End Property + + Public Property previousDocumentMeasurementUnit() As String + Get + Return Me._previousDocumentMeasurementUnit + End Get + Set + Me._previousDocumentMeasurementUnit = Value + End Set + End Property + + Public Property previousDocumentQuantity() As Decimal + Get + Return Me._previousDocumentQuantity + End Get + Set + Me._previousDocumentQuantity = Value + End Set + End Property + + Public Property depreciatedAmountOfGuarantee() As Long + Get + Return Me._depreciatedAmountOfGuarantee + End Get + Set + Me._depreciatedAmountOfGuarantee = Value + End Set + End Property + + Public Property authorisationSpecialProcedure() As String + Get + Return Me._authorisationSpecialProcedure + End Get + Set + Me._authorisationSpecialProcedure = Value + End Set + End Property + + Public Property commodityCodeOfEarlyExportedEqualMaterial() As String + Get + Return Me._commodityCodeOfEarlyExportedEqualMaterial + End Get + Set + Me._commodityCodeOfEarlyExportedEqualMaterial = Value + End Set + End Property + + Public Property earlyExportOfEqualMaterial() As String + Get + Return Me._earlyExportOfEqualMaterial + End Get + Set + Me._earlyExportOfEqualMaterial = Value + End Set + End Property + + Public Property partNumberOfPreviousDocument() As String + Get + Return Me._partNumberOfPreviousDocument + End Get + Set + Me._partNumberOfPreviousDocument = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ItemPreviousDocumentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ItemPreviousDocumentType 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 ItemPreviousDocumentType object + ''' + ''' string to deserialize + ''' Output ItemPreviousDocumentType 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 ItemPreviousDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ItemPreviousDocumentType) + 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 ItemPreviousDocumentType) 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 ItemPreviousDocumentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ItemPreviousDocumentType) + 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 ItemPreviousDocumentType + Return CType(SerializerXml.Deserialize(s), ItemPreviousDocumentType) + End Function +#End Region + + ''' + ''' Serializes current ItemPreviousDocumentType 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 ItemPreviousDocumentType object + ''' + ''' File to load and deserialize + ''' Output ItemPreviousDocumentType 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 ItemPreviousDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ItemPreviousDocumentType) + 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 ItemPreviousDocumentType) 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 ItemPreviousDocumentType + 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 PreviousDocumentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _previousDocumentType As String + + Private _previousDocumentReference As String + + Private _previousDocumentGoodsItemNumber As Long + + Private _previousDocumentGoodsItemNumberString As String + + Private _previousDocumentComplementOfInformation As String + + Private _temporaryStorage As Boolean + + Private _previousDocumentSid As Long + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property previousDocumentType() As String + Get + Return Me._previousDocumentType + End Get + Set + Me._previousDocumentType = Value + End Set + End Property + + Public Property previousDocumentReference() As String + Get + Return Me._previousDocumentReference + End Get + Set + Me._previousDocumentReference = Value + End Set + End Property + + Public Property previousDocumentGoodsItemNumber() As Long + Get + Return Me._previousDocumentGoodsItemNumber + End Get + Set + Me._previousDocumentGoodsItemNumber = Value + End Set + End Property + + Public Property previousDocumentGoodsItemNumberString() As String + Get + Return Me._previousDocumentGoodsItemNumberString + End Get + Set + Me._previousDocumentGoodsItemNumberString = Value + End Set + End Property + + Public Property previousDocumentComplementOfInformation() As String + Get + Return Me._previousDocumentComplementOfInformation + End Get + Set + Me._previousDocumentComplementOfInformation = Value + End Set + End Property + + Public Property temporaryStorage() As Boolean + Get + Return Me._temporaryStorage + End Get + Set + Me._temporaryStorage = Value + End Set + End Property + + Public Property previousDocumentSid() As Long + Get + Return Me._previousDocumentSid + End Get + Set + Me._previousDocumentSid = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PreviousDocumentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PreviousDocumentType 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 PreviousDocumentType object + ''' + ''' string to deserialize + ''' Output PreviousDocumentType 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 PreviousDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PreviousDocumentType) + 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 PreviousDocumentType) 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 PreviousDocumentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PreviousDocumentType) + 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 PreviousDocumentType + Return CType(SerializerXml.Deserialize(s), PreviousDocumentType) + End Function +#End Region + + ''' + ''' Serializes current PreviousDocumentType 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 PreviousDocumentType object + ''' + ''' File to load and deserialize + ''' Output PreviousDocumentType 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 PreviousDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PreviousDocumentType) + 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 PreviousDocumentType) 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 PreviousDocumentType + 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 SupportingDocumentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _supportingDocumentType As String + + Private _supportingDocumentReference As String + + Private _supportingDocumentLineItemNumber As Integer + + Private _supportingDocumentComplementOfInformation As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property supportingDocumentType() As String + Get + Return Me._supportingDocumentType + End Get + Set + Me._supportingDocumentType = Value + End Set + End Property + + Public Property supportingDocumentReference() As String + Get + Return Me._supportingDocumentReference + End Get + Set + Me._supportingDocumentReference = Value + End Set + End Property + + Public Property supportingDocumentLineItemNumber() As Integer + Get + Return Me._supportingDocumentLineItemNumber + End Get + Set + Me._supportingDocumentLineItemNumber = Value + End Set + End Property + + Public Property supportingDocumentComplementOfInformation() As String + Get + Return Me._supportingDocumentComplementOfInformation + End Get + Set + Me._supportingDocumentComplementOfInformation = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SupportingDocumentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize SupportingDocumentType 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 SupportingDocumentType object + ''' + ''' string to deserialize + ''' Output SupportingDocumentType 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 SupportingDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SupportingDocumentType) + 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 SupportingDocumentType) 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 SupportingDocumentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SupportingDocumentType) + 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 SupportingDocumentType + Return CType(SerializerXml.Deserialize(s), SupportingDocumentType) + End Function +#End Region + + ''' + ''' Serializes current SupportingDocumentType 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 SupportingDocumentType object + ''' + ''' File to load and deserialize + ''' Output SupportingDocumentType 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 SupportingDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SupportingDocumentType) + 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 SupportingDocumentType) 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 SupportingDocumentType + 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 TransportDocumentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _transportDocumentType As String + + Private _transportDocumentReference As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property transportDocumentType() As String + Get + Return Me._transportDocumentType + End Get + Set + Me._transportDocumentType = Value + End Set + End Property + + Public Property transportDocumentReference() As String + Get + Return Me._transportDocumentReference + End Get + Set + Me._transportDocumentReference = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransportDocumentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransportDocumentType 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 TransportDocumentType object + ''' + ''' string to deserialize + ''' Output TransportDocumentType 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 TransportDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransportDocumentType) + 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 TransportDocumentType) 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 TransportDocumentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportDocumentType) + 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 TransportDocumentType + Return CType(SerializerXml.Deserialize(s), TransportDocumentType) + End Function +#End Region + + ''' + ''' Serializes current TransportDocumentType 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 TransportDocumentType object + ''' + ''' File to load and deserialize + ''' Output TransportDocumentType 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 TransportDocumentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransportDocumentType) + 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 TransportDocumentType) 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 TransportDocumentType + 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 AdditionalInformationType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _additionalInformationCode As String + + Private _additionalInformationText As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property additionalInformationCode() As String + Get + Return Me._additionalInformationCode + End Get + Set + Me._additionalInformationCode = Value + End Set + End Property + + Public Property additionalInformationText() As String + Get + Return Me._additionalInformationText + End Get + Set + Me._additionalInformationText = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalInformationType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize AdditionalInformationType 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 AdditionalInformationType object + ''' + ''' string to deserialize + ''' Output AdditionalInformationType 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 AdditionalInformationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalInformationType) + 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 AdditionalInformationType) 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 AdditionalInformationType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalInformationType) + 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 AdditionalInformationType + Return CType(SerializerXml.Deserialize(s), AdditionalInformationType) + End Function +#End Region + + ''' + ''' Serializes current AdditionalInformationType 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 AdditionalInformationType object + ''' + ''' File to load and deserialize + ''' Output AdditionalInformationType 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 AdditionalInformationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalInformationType) + 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 AdditionalInformationType) 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 AdditionalInformationType + 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 AdditionalSupplyChainActorType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _role As String + + Private _supplyChainActorId As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property role() As String + Get + Return Me._role + End Get + Set + Me._role = Value + End Set + End Property + + Public Property supplyChainActorId() As String + Get + Return Me._supplyChainActorId + End Get + Set + Me._supplyChainActorId = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalSupplyChainActorType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType object + ''' + ''' string to deserialize + ''' Output AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalSupplyChainActorType) + 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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalSupplyChainActorType) + 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 AdditionalSupplyChainActorType + Return CType(SerializerXml.Deserialize(s), AdditionalSupplyChainActorType) + End Function +#End Region + + ''' + ''' Serializes current AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType object + ''' + ''' File to load and deserialize + ''' Output AdditionalSupplyChainActorType 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 AdditionalSupplyChainActorType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalSupplyChainActorType) + 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 AdditionalSupplyChainActorType) 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 AdditionalSupplyChainActorType + 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 AdditionalReferenceType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _additionalReferenceType As String + + Private _additionalReferenceReference As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property additionalReferenceType() As String + Get + Return Me._additionalReferenceType + End Get + Set + Me._additionalReferenceType = Value + End Set + End Property + + Public Property additionalReferenceReference() As String + Get + Return Me._additionalReferenceReference + End Get + Set + Me._additionalReferenceReference = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AdditionalReferenceType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize AdditionalReferenceType 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 AdditionalReferenceType object + ''' + ''' string to deserialize + ''' Output AdditionalReferenceType 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 AdditionalReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalReferenceType) + 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 AdditionalReferenceType) 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 AdditionalReferenceType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AdditionalReferenceType) + 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 AdditionalReferenceType + Return CType(SerializerXml.Deserialize(s), AdditionalReferenceType) + End Function +#End Region + + ''' + ''' Serializes current AdditionalReferenceType 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 AdditionalReferenceType object + ''' + ''' File to load and deserialize + ''' Output AdditionalReferenceType 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 AdditionalReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AdditionalReferenceType) + 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 AdditionalReferenceType) 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 AdditionalReferenceType + 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 CustomerFieldsType + +#Region "Private fields" + Private _text1 As String + + Private _text2 As String + + Private _text3 As String + + Private _text4 As String + + Private _text5 As String + + Private _text6 As String + + Private _text7 As String + + Private _text8 As String + + Private _text9 As String + + Private _text10 As String + + Private _num1 As Decimal + + Private _num2 As Decimal + + Private _num3 As Decimal + + Private _num4 As Decimal + + Private _num5 As Decimal + + Private _num6 As Decimal + + Private _num7 As Decimal + + Private _num8 As Decimal + + Private _num9 As Decimal + + Private _num10 As Decimal + + Private _flag1 As Boolean + + Private _flag2 As Boolean + + Private _flag3 As Boolean + + Private _flag4 As Boolean + + Private _flag5 As Boolean + + Private _flag6 As Boolean + + Private _flag7 As Boolean + + Private _flag8 As Boolean + + Private _flag9 As Boolean + + Private _flag10 As Boolean + + Private _date1 As Date + + Private _date2 As Date + + Private _date3 As Date + + Private _date4 As Date + + Private _date5 As Date + + Private _date6 As Date + + Private _date7 As Date + + Private _date8 As Date + + Private _date9 As Date + + Private _date10 As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property text1() As String + Get + Return Me._text1 + End Get + Set + Me._text1 = Value + End Set + End Property + + Public Property text2() As String + Get + Return Me._text2 + End Get + Set + Me._text2 = Value + End Set + End Property + + Public Property text3() As String + Get + Return Me._text3 + End Get + Set + Me._text3 = Value + End Set + End Property + + Public Property text4() As String + Get + Return Me._text4 + End Get + Set + Me._text4 = Value + End Set + End Property + + Public Property text5() As String + Get + Return Me._text5 + End Get + Set + Me._text5 = Value + End Set + End Property + + Public Property text6() As String + Get + Return Me._text6 + End Get + Set + Me._text6 = Value + End Set + End Property + + Public Property text7() As String + Get + Return Me._text7 + End Get + Set + Me._text7 = Value + End Set + End Property + + Public Property text8() As String + Get + Return Me._text8 + End Get + Set + Me._text8 = Value + End Set + End Property + + Public Property text9() As String + Get + Return Me._text9 + End Get + Set + Me._text9 = Value + End Set + End Property + + Public Property text10() As String + Get + Return Me._text10 + End Get + Set + Me._text10 = Value + End Set + End Property + + Public Property num1() As Decimal + Get + Return Me._num1 + End Get + Set + Me._num1 = Value + End Set + End Property + + Public Property num2() As Decimal + Get + Return Me._num2 + End Get + Set + Me._num2 = Value + End Set + End Property + + Public Property num3() As Decimal + Get + Return Me._num3 + End Get + Set + Me._num3 = Value + End Set + End Property + + Public Property num4() As Decimal + Get + Return Me._num4 + End Get + Set + Me._num4 = Value + End Set + End Property + + Public Property num5() As Decimal + Get + Return Me._num5 + End Get + Set + Me._num5 = Value + End Set + End Property + + Public Property num6() As Decimal + Get + Return Me._num6 + End Get + Set + Me._num6 = Value + End Set + End Property + + Public Property num7() As Decimal + Get + Return Me._num7 + End Get + Set + Me._num7 = Value + End Set + End Property + + Public Property num8() As Decimal + Get + Return Me._num8 + End Get + Set + Me._num8 = Value + End Set + End Property + + Public Property num9() As Decimal + Get + Return Me._num9 + End Get + Set + Me._num9 = Value + End Set + End Property + + Public Property num10() As Decimal + Get + Return Me._num10 + End Get + Set + Me._num10 = Value + End Set + End Property + + Public Property flag1() As Boolean + Get + Return Me._flag1 + End Get + Set + Me._flag1 = Value + End Set + End Property + + Public Property flag2() As Boolean + Get + Return Me._flag2 + End Get + Set + Me._flag2 = Value + End Set + End Property + + Public Property flag3() As Boolean + Get + Return Me._flag3 + End Get + Set + Me._flag3 = Value + End Set + End Property + + Public Property flag4() As Boolean + Get + Return Me._flag4 + End Get + Set + Me._flag4 = Value + End Set + End Property + + Public Property flag5() As Boolean + Get + Return Me._flag5 + End Get + Set + Me._flag5 = Value + End Set + End Property + + Public Property flag6() As Boolean + Get + Return Me._flag6 + End Get + Set + Me._flag6 = Value + End Set + End Property + + Public Property flag7() As Boolean + Get + Return Me._flag7 + End Get + Set + Me._flag7 = Value + End Set + End Property + + Public Property flag8() As Boolean + Get + Return Me._flag8 + End Get + Set + Me._flag8 = Value + End Set + End Property + + Public Property flag9() As Boolean + Get + Return Me._flag9 + End Get + Set + Me._flag9 = Value + End Set + End Property + + Public Property flag10() As Boolean + Get + Return Me._flag10 + End Get + Set + Me._flag10 = Value + End Set + End Property + + Public Property date1() As Date + Get + Return Me._date1 + End Get + Set + Me._date1 = Value + End Set + End Property + + Public Property date2() As Date + Get + Return Me._date2 + End Get + Set + Me._date2 = Value + End Set + End Property + + Public Property date3() As Date + Get + Return Me._date3 + End Get + Set + Me._date3 = Value + End Set + End Property + + Public Property date4() As Date + Get + Return Me._date4 + End Get + Set + Me._date4 = Value + End Set + End Property + + Public Property date5() As Date + Get + Return Me._date5 + End Get + Set + Me._date5 = Value + End Set + End Property + + Public Property date6() As Date + Get + Return Me._date6 + End Get + Set + Me._date6 = Value + End Set + End Property + + Public Property date7() As Date + Get + Return Me._date7 + End Get + Set + Me._date7 = Value + End Set + End Property + + Public Property date8() As Date + Get + Return Me._date8 + End Get + Set + Me._date8 = Value + End Set + End Property + + Public Property date9() As Date + Get + Return Me._date9 + End Get + Set + Me._date9 = Value + End Set + End Property + + Public Property date10() As Date + Get + Return Me._date10 + End Get + Set + Me._date10 = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomerFieldsType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CustomerFieldsType 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 CustomerFieldsType object + ''' + ''' string to deserialize + ''' Output CustomerFieldsType 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 CustomerFieldsType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CustomerFieldsType) + 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 CustomerFieldsType) 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 CustomerFieldsType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomerFieldsType) + 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 CustomerFieldsType + Return CType(SerializerXml.Deserialize(s), CustomerFieldsType) + End Function +#End Region + + ''' + ''' Serializes current CustomerFieldsType 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 CustomerFieldsType object + ''' + ''' File to load and deserialize + ''' Output CustomerFieldsType 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 CustomerFieldsType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CustomerFieldsType) + 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 CustomerFieldsType) 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 CustomerFieldsType + 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 HouseConsignmentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _countryOfDispatch As String + + Private _countryOfDestination As String + + Private _grossMass As Decimal + + Private _referenceNumberUniqueConsignmentReference As String + + Private _consignor As OperatorWithContactAndSubsidiaryType + + Private _consignee As OperatorWithContactAndSubsidiaryType + + Private _methodOfPayment As String + + Private _previousDocument As List(Of PreviousDocumentType) + + Private _supportingDocument As List(Of SupportingDocumentType) + + Private _transportDocument As List(Of TransportDocumentType) + + Private _additionalReference As List(Of AdditionalReferenceType) + + Private _additionalInformation As List(Of AdditionalInformationType) + + Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) + + Private _customerFields As CustomerFieldsType + + Private _consignmentItem As List(Of ConsignmentItemType) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._consignmentItem = New List(Of ConsignmentItemType)() + Me._customerFields = New CustomerFieldsType() + Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() + Me._additionalInformation = New List(Of AdditionalInformationType)() + Me._additionalReference = New List(Of AdditionalReferenceType)() + Me._transportDocument = New List(Of TransportDocumentType)() + Me._supportingDocument = New List(Of SupportingDocumentType)() + Me._previousDocument = New List(Of PreviousDocumentType)() + Me._consignee = New OperatorWithContactAndSubsidiaryType() + Me._consignor = New OperatorWithContactAndSubsidiaryType() + End Sub + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property countryOfDispatch() As String + Get + Return Me._countryOfDispatch + End Get + Set + Me._countryOfDispatch = Value + End Set + End Property + + Public Property countryOfDestination() As String + Get + Return Me._countryOfDestination + End Get + Set + Me._countryOfDestination = 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 referenceNumberUniqueConsignmentReference() As String + Get + Return Me._referenceNumberUniqueConsignmentReference + End Get + Set + Me._referenceNumberUniqueConsignmentReference = Value + End Set + End Property + + Public Property consignor() As OperatorWithContactAndSubsidiaryType + Get + Return Me._consignor + End Get + Set + Me._consignor = Value + End Set + End Property + + Public Property consignee() As OperatorWithContactAndSubsidiaryType + Get + Return Me._consignee + End Get + Set + Me._consignee = Value + End Set + End Property + + Public Property methodOfPayment() As String + Get + Return Me._methodOfPayment + End Get + Set + Me._methodOfPayment = Value + End Set + End Property + + + Public Property previousDocument() As List(Of PreviousDocumentType) + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = Value + End Set + End Property + + + Public Property supportingDocument() As List(Of SupportingDocumentType) + Get + Return Me._supportingDocument + End Get + Set + Me._supportingDocument = Value + End Set + End Property + + + Public Property transportDocument() As List(Of TransportDocumentType) + Get + Return Me._transportDocument + End Get + Set + Me._transportDocument = Value + End Set + End Property + + + Public Property additionalReference() As List(Of AdditionalReferenceType) + Get + Return Me._additionalReference + End Get + Set + Me._additionalReference = Value + End Set + End Property + + + Public Property additionalInformation() As List(Of AdditionalInformationType) + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + + Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) + Get + Return Me._additionalSupplyChainActor + End Get + Set + Me._additionalSupplyChainActor = Value + End Set + End Property + + Public Property customerFields() As CustomerFieldsType + Get + Return Me._customerFields + End Get + Set + Me._customerFields = Value + End Set + End Property + + + Public Property consignmentItem() As List(Of ConsignmentItemType) + Get + Return Me._consignmentItem + End Get + Set + Me._consignmentItem = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HouseConsignmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize HouseConsignmentType 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 HouseConsignmentType object + ''' + ''' string to deserialize + ''' Output HouseConsignmentType 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 HouseConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HouseConsignmentType) + 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 HouseConsignmentType) 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 HouseConsignmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HouseConsignmentType) + 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 HouseConsignmentType + Return CType(SerializerXml.Deserialize(s), HouseConsignmentType) + End Function +#End Region + + ''' + ''' Serializes current HouseConsignmentType 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 HouseConsignmentType object + ''' + ''' File to load and deserialize + ''' Output HouseConsignmentType 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 HouseConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, HouseConsignmentType) + 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 HouseConsignmentType) 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 HouseConsignmentType + 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 PortInformationType + +#Region "Private fields" + Private _documentType As String + + Private _bookingReference As String + + Private _port As String + + Private _terminal As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property documentType() As String + Get + Return Me._documentType + End Get + Set + Me._documentType = Value + End Set + End Property + + Public Property bookingReference() As String + Get + Return Me._bookingReference + End Get + Set + Me._bookingReference = Value + End Set + End Property + + Public Property port() As String + Get + Return Me._port + End Get + Set + Me._port = Value + End Set + End Property + + Public Property terminal() As String + Get + Return Me._terminal + End Get + Set + Me._terminal = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PortInformationType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PortInformationType 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 PortInformationType object + ''' + ''' string to deserialize + ''' Output PortInformationType 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 PortInformationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PortInformationType) + 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 PortInformationType) 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 PortInformationType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PortInformationType) + 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 PortInformationType + Return CType(SerializerXml.Deserialize(s), PortInformationType) + End Function +#End Region + + ''' + ''' Serializes current PortInformationType 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 PortInformationType object + ''' + ''' File to load and deserialize + ''' Output PortInformationType 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 PortInformationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PortInformationType) + 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 PortInformationType) 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 PortInformationType + 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 TransitDeclarationPartnerType + +#Region "Private fields" + Private _type As String + + Private _status As String + + Private _addressNumber As String + + Private _identificationNumber As String + + Private _name As String + + Private _representativeRin As String + + Private _address As AddressType + + Private _contactPerson As ContactPersonType + + Private _tirHolderIdentificationNumber As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._address = New AddressType() + End Sub + + Public Property type() As String + Get + Return Me._type + End Get + Set + Me._type = Value + End Set + End Property + + Public Property status() As String + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = 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 name() As String + Get + Return Me._name + End Get + Set + Me._name = Value + End Set + End Property + + Public Property representativeRin() As String + Get + Return Me._representativeRin + End Get + Set + Me._representativeRin = Value + End Set + End Property + + Public Property address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + Get + Return Me._contactPerson + End Get + Set + Me._contactPerson = Value + End Set + End Property + + Public Property tirHolderIdentificationNumber() As String + Get + Return Me._tirHolderIdentificationNumber + End Get + Set + Me._tirHolderIdentificationNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationPartnerType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclarationPartnerType 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 TransitDeclarationPartnerType object + ''' + ''' string to deserialize + ''' Output TransitDeclarationPartnerType 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 TransitDeclarationPartnerType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationPartnerType) + 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 TransitDeclarationPartnerType) 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 TransitDeclarationPartnerType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationPartnerType) + 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 TransitDeclarationPartnerType + Return CType(SerializerXml.Deserialize(s), TransitDeclarationPartnerType) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclarationPartnerType 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 TransitDeclarationPartnerType object + ''' + ''' File to load and deserialize + ''' Output TransitDeclarationPartnerType 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 TransitDeclarationPartnerType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationPartnerType) + 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 TransitDeclarationPartnerType) 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 TransitDeclarationPartnerType + 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 IncidentGoodsReferenceType + +#Region "Private fields" + Private _headerId As String + + Private _sequenceNumber As Integer + + Private _transportEquipmentGoodsReferenceDeclarationGoodsItemNumber As Integer + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property headerId() As String + Get + Return Me._headerId + End Get + Set + Me._headerId = Value + End Set + End Property + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property transportEquipmentGoodsReferenceDeclarationGoodsItemNumber() As Integer + Get + Return Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + End Get + Set + Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentGoodsReferenceType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IncidentGoodsReferenceType 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 IncidentGoodsReferenceType object + ''' + ''' string to deserialize + ''' Output IncidentGoodsReferenceType 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 IncidentGoodsReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentGoodsReferenceType) + 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 IncidentGoodsReferenceType) 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 IncidentGoodsReferenceType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentGoodsReferenceType) + 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 IncidentGoodsReferenceType + Return CType(SerializerXml.Deserialize(s), IncidentGoodsReferenceType) + End Function +#End Region + + ''' + ''' Serializes current IncidentGoodsReferenceType 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 IncidentGoodsReferenceType object + ''' + ''' File to load and deserialize + ''' Output IncidentGoodsReferenceType 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 IncidentGoodsReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentGoodsReferenceType) + 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 IncidentGoodsReferenceType) 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 IncidentGoodsReferenceType + 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 IncidentSealType + +#Region "Private fields" + Private _headerId As String + + Private _sequenceNumber As Integer + + Private _sealsIdentifier As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property headerId() As String + Get + Return Me._headerId + End Get + Set + Me._headerId = Value + End Set + End Property + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property sealsIdentifier() As String + Get + Return Me._sealsIdentifier + End Get + Set + Me._sealsIdentifier = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentSealType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IncidentSealType 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 IncidentSealType object + ''' + ''' string to deserialize + ''' Output IncidentSealType 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 IncidentSealType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentSealType) + 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 IncidentSealType) 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 IncidentSealType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentSealType) + 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 IncidentSealType + Return CType(SerializerXml.Deserialize(s), IncidentSealType) + End Function +#End Region + + ''' + ''' Serializes current IncidentSealType 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 IncidentSealType object + ''' + ''' File to load and deserialize + ''' Output IncidentSealType 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 IncidentSealType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentSealType) + 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 IncidentSealType) 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 IncidentSealType + 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 IncidentTransportEquipmentType + +#Region "Private fields" + Private _headerId As String + + Private _sequenceNumber As Integer + + Private _containerIdentificationNumber As String + + Private _numberOfSeals As Integer + + Private _seal As List(Of IncidentSealType) + + Private _goodsReference As List(Of IncidentGoodsReferenceType) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._goodsReference = New List(Of IncidentGoodsReferenceType)() + Me._seal = New List(Of IncidentSealType)() + End Sub + + Public Property headerId() As String + Get + Return Me._headerId + End Get + Set + Me._headerId = Value + End Set + End Property + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property containerIdentificationNumber() As String + Get + Return Me._containerIdentificationNumber + End Get + Set + Me._containerIdentificationNumber = Value + End Set + End Property + + Public Property numberOfSeals() As Integer + Get + Return Me._numberOfSeals + End Get + Set + Me._numberOfSeals = Value + End Set + End Property + + + Public Property seal() As List(Of IncidentSealType) + Get + Return Me._seal + End Get + Set + Me._seal = Value + End Set + End Property + + + Public Property goodsReference() As List(Of IncidentGoodsReferenceType) + 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(IncidentTransportEquipmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IncidentTransportEquipmentType 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 IncidentTransportEquipmentType object + ''' + ''' string to deserialize + ''' Output IncidentTransportEquipmentType 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 IncidentTransportEquipmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentTransportEquipmentType) + 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 IncidentTransportEquipmentType) 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 IncidentTransportEquipmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentTransportEquipmentType) + 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 IncidentTransportEquipmentType + Return CType(SerializerXml.Deserialize(s), IncidentTransportEquipmentType) + End Function +#End Region + + ''' + ''' Serializes current IncidentTransportEquipmentType 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 IncidentTransportEquipmentType object + ''' + ''' File to load and deserialize + ''' Output IncidentTransportEquipmentType 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 IncidentTransportEquipmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentTransportEquipmentType) + 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 IncidentTransportEquipmentType) 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 IncidentTransportEquipmentType + 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 IncidentType + +#Region "Private fields" + Private _transportEquipment As List(Of IncidentTransportEquipmentType) + + Private _headerId As String + + Private _sequenceNumber As Integer + + Private _incidentNotificationDateAndTime As Date + + Private _customsOfficeOfIncidentRegistration As String + + Private _code As Integer + + Private _text As String + + Private _endorsementDate As Date + + Private _endorsementAuthority As String + + Private _endorsementPlace As String + + Private _endorsementCountry As String + + Private _locationQualifierOfIdentification As String + + Private _locationUNLocode As String + + Private _locationCountry As String + + Private _locationGNSSLatitude As String + + Private _locationGNSSLongitude As String + + Private _locationAddressStreetAndNumber As String + + Private _locationAddressPostcode As String + + Private _locationAddressCity As String + + Private _containerIndicator As Boolean + + Private _transportMeansTypeOfIdentification As String + + Private _transportMeansIdentificationNumber As String + + Private _transportMeansNationality As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._transportEquipment = New List(Of IncidentTransportEquipmentType)() + End Sub + + + Public Property transportEquipment() As List(Of IncidentTransportEquipmentType) + Get + Return Me._transportEquipment + End Get + Set + Me._transportEquipment = Value + End Set + End Property + + Public Property headerId() As String + Get + Return Me._headerId + End Get + Set + Me._headerId = Value + End Set + End Property + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property incidentNotificationDateAndTime() As Date + Get + Return Me._incidentNotificationDateAndTime + End Get + Set + Me._incidentNotificationDateAndTime = Value + End Set + End Property + + Public Property customsOfficeOfIncidentRegistration() As String + Get + Return Me._customsOfficeOfIncidentRegistration + End Get + Set + Me._customsOfficeOfIncidentRegistration = Value + End Set + End Property + + Public Property code() As Integer + Get + Return Me._code + End Get + Set + Me._code = 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 endorsementDate() As Date + Get + Return Me._endorsementDate + End Get + Set + Me._endorsementDate = Value + End Set + End Property + + Public Property endorsementAuthority() As String + Get + Return Me._endorsementAuthority + End Get + Set + Me._endorsementAuthority = Value + End Set + End Property + + Public Property endorsementPlace() As String + Get + Return Me._endorsementPlace + End Get + Set + Me._endorsementPlace = Value + End Set + End Property + + Public Property endorsementCountry() As String + Get + Return Me._endorsementCountry + End Get + Set + Me._endorsementCountry = Value + End Set + End Property + + Public Property locationQualifierOfIdentification() As String + Get + Return Me._locationQualifierOfIdentification + End Get + Set + Me._locationQualifierOfIdentification = Value + End Set + End Property + + Public Property locationUNLocode() As String + Get + Return Me._locationUNLocode + End Get + Set + Me._locationUNLocode = Value + End Set + End Property + + Public Property locationCountry() As String + Get + Return Me._locationCountry + End Get + Set + Me._locationCountry = Value + End Set + End Property + + Public Property locationGNSSLatitude() As String + Get + Return Me._locationGNSSLatitude + End Get + Set + Me._locationGNSSLatitude = Value + End Set + End Property + + Public Property locationGNSSLongitude() As String + Get + Return Me._locationGNSSLongitude + End Get + Set + Me._locationGNSSLongitude = Value + End Set + End Property + + Public Property locationAddressStreetAndNumber() As String + Get + Return Me._locationAddressStreetAndNumber + End Get + Set + Me._locationAddressStreetAndNumber = Value + End Set + End Property + + Public Property locationAddressPostcode() As String + Get + Return Me._locationAddressPostcode + End Get + Set + Me._locationAddressPostcode = Value + End Set + End Property + + Public Property locationAddressCity() As String + Get + Return Me._locationAddressCity + End Get + Set + Me._locationAddressCity = Value + End Set + End Property + + Public Property containerIndicator() As Boolean + Get + Return Me._containerIndicator + End Get + Set + Me._containerIndicator = Value + End Set + End Property + + Public Property transportMeansTypeOfIdentification() As String + Get + Return Me._transportMeansTypeOfIdentification + End Get + Set + Me._transportMeansTypeOfIdentification = Value + End Set + End Property + + Public Property transportMeansIdentificationNumber() As String + Get + Return Me._transportMeansIdentificationNumber + End Get + Set + Me._transportMeansIdentificationNumber = Value + End Set + End Property + + Public Property transportMeansNationality() As String + Get + Return Me._transportMeansNationality + End Get + Set + Me._transportMeansNationality = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IncidentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize IncidentType 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 IncidentType object + ''' + ''' string to deserialize + ''' Output IncidentType 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 IncidentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentType) + 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 IncidentType) 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 IncidentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IncidentType) + 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 IncidentType + Return CType(SerializerXml.Deserialize(s), IncidentType) + End Function +#End Region + + ''' + ''' Serializes current IncidentType 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 IncidentType object + ''' + ''' File to load and deserialize + ''' Output IncidentType 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 IncidentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, IncidentType) + 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 IncidentType) 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 IncidentType + 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 CarrierType + +#Region "Private fields" + Private _addressNumber As String + + Private _identificationNumber As String + + Private _subsidiaryNumber As String + + Private _name As String + + Private _address As AddressType + + Private _contactPerson As ContactPersonType + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._address = New AddressType() + End Sub + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = 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 subsidiaryNumber() As String + Get + Return Me._subsidiaryNumber + End Get + Set + Me._subsidiaryNumber = 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 address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + 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(CarrierType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CarrierType 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 CarrierType object + ''' + ''' string to deserialize + ''' Output CarrierType 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 CarrierType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CarrierType) + 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 CarrierType) 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 CarrierType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CarrierType) + 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 CarrierType + Return CType(SerializerXml.Deserialize(s), CarrierType) + End Function +#End Region + + ''' + ''' Serializes current CarrierType 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 CarrierType object + ''' + ''' File to load and deserialize + ''' Output CarrierType 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 CarrierType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CarrierType) + 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 CarrierType) 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 CarrierType + 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 CountryOfRoutingOfConsignmentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _country As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = 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(CountryOfRoutingOfConsignmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CountryOfRoutingOfConsignmentType 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 CountryOfRoutingOfConsignmentType object + ''' + ''' string to deserialize + ''' Output CountryOfRoutingOfConsignmentType 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 CountryOfRoutingOfConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CountryOfRoutingOfConsignmentType) + 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 CountryOfRoutingOfConsignmentType) 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 CountryOfRoutingOfConsignmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CountryOfRoutingOfConsignmentType) + 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 CountryOfRoutingOfConsignmentType + Return CType(SerializerXml.Deserialize(s), CountryOfRoutingOfConsignmentType) + End Function +#End Region + + ''' + ''' Serializes current CountryOfRoutingOfConsignmentType 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 CountryOfRoutingOfConsignmentType object + ''' + ''' File to load and deserialize + ''' Output CountryOfRoutingOfConsignmentType 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 CountryOfRoutingOfConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CountryOfRoutingOfConsignmentType) + 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 CountryOfRoutingOfConsignmentType) 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 CountryOfRoutingOfConsignmentType + 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 CustomsOfficeOfTransitDeclaredType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _customsOfficeOfTransitDeclared As String + + Private _arrivalDateAndTimeEstimated As Date + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property customsOfficeOfTransitDeclared() As String + Get + Return Me._customsOfficeOfTransitDeclared + End Get + Set + Me._customsOfficeOfTransitDeclared = Value + End Set + End Property + + Public Property arrivalDateAndTimeEstimated() As Date + Get + Return Me._arrivalDateAndTimeEstimated + End Get + Set + Me._arrivalDateAndTimeEstimated = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CustomsOfficeOfTransitDeclaredType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize CustomsOfficeOfTransitDeclaredType 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 CustomsOfficeOfTransitDeclaredType object + ''' + ''' string to deserialize + ''' Output CustomsOfficeOfTransitDeclaredType 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 CustomsOfficeOfTransitDeclaredType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType) + 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 CustomsOfficeOfTransitDeclaredType) 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 CustomsOfficeOfTransitDeclaredType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CustomsOfficeOfTransitDeclaredType) + 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 CustomsOfficeOfTransitDeclaredType + Return CType(SerializerXml.Deserialize(s), CustomsOfficeOfTransitDeclaredType) + End Function +#End Region + + ''' + ''' Serializes current CustomsOfficeOfTransitDeclaredType 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 CustomsOfficeOfTransitDeclaredType object + ''' + ''' File to load and deserialize + ''' Output CustomsOfficeOfTransitDeclaredType 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 CustomsOfficeOfTransitDeclaredType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, CustomsOfficeOfTransitDeclaredType) + 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 CustomsOfficeOfTransitDeclaredType) 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 CustomsOfficeOfTransitDeclaredType + 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 ActiveTransportMeansType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _typeOfIdentificationAtBorderCrossing As String + + Private _identificationNumberAtBorderCrossing As String + + Private _nationalityAtBorderCrossing As String + + Private _conveyanceReferenceNumber As String + + Private _customsOfficeAtBorderDeclared As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property typeOfIdentificationAtBorderCrossing() As String + Get + Return Me._typeOfIdentificationAtBorderCrossing + End Get + Set + Me._typeOfIdentificationAtBorderCrossing = Value + End Set + End Property + + Public Property identificationNumberAtBorderCrossing() As String + Get + Return Me._identificationNumberAtBorderCrossing + End Get + Set + Me._identificationNumberAtBorderCrossing = Value + End Set + End Property + + Public Property nationalityAtBorderCrossing() As String + Get + Return Me._nationalityAtBorderCrossing + End Get + Set + Me._nationalityAtBorderCrossing = Value + End Set + End Property + + Public Property conveyanceReferenceNumber() As String + Get + Return Me._conveyanceReferenceNumber + End Get + Set + Me._conveyanceReferenceNumber = Value + End Set + End Property + + Public Property customsOfficeAtBorderDeclared() As String + Get + Return Me._customsOfficeAtBorderDeclared + End Get + Set + Me._customsOfficeAtBorderDeclared = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ActiveTransportMeansType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize ActiveTransportMeansType 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 ActiveTransportMeansType object + ''' + ''' string to deserialize + ''' Output ActiveTransportMeansType 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 ActiveTransportMeansType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ActiveTransportMeansType) + 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 ActiveTransportMeansType) 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 ActiveTransportMeansType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ActiveTransportMeansType) + 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 ActiveTransportMeansType + Return CType(SerializerXml.Deserialize(s), ActiveTransportMeansType) + End Function +#End Region + + ''' + ''' Serializes current ActiveTransportMeansType 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 ActiveTransportMeansType object + ''' + ''' File to load and deserialize + ''' Output ActiveTransportMeansType 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 ActiveTransportMeansType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, ActiveTransportMeansType) + 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 ActiveTransportMeansType) 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 ActiveTransportMeansType + 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 DepartureTransportMeansType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _typeOfIdentificationAtDeparture As String + + Private _identificationNumberAtDeparture As String + + Private _nationalityAtDeparture As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property typeOfIdentificationAtDeparture() As String + Get + Return Me._typeOfIdentificationAtDeparture + End Get + Set + Me._typeOfIdentificationAtDeparture = Value + End Set + End Property + + Public Property identificationNumberAtDeparture() As String + Get + Return Me._identificationNumberAtDeparture + End Get + Set + Me._identificationNumberAtDeparture = Value + End Set + End Property + + Public Property nationalityAtDeparture() As String + Get + Return Me._nationalityAtDeparture + End Get + Set + Me._nationalityAtDeparture = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(DepartureTransportMeansType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize DepartureTransportMeansType 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 DepartureTransportMeansType object + ''' + ''' string to deserialize + ''' Output DepartureTransportMeansType 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 DepartureTransportMeansType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, DepartureTransportMeansType) + 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 DepartureTransportMeansType) 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 DepartureTransportMeansType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), DepartureTransportMeansType) + 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 DepartureTransportMeansType + Return CType(SerializerXml.Deserialize(s), DepartureTransportMeansType) + End Function +#End Region + + ''' + ''' Serializes current DepartureTransportMeansType 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 DepartureTransportMeansType object + ''' + ''' File to load and deserialize + ''' Output DepartureTransportMeansType 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 DepartureTransportMeansType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, DepartureTransportMeansType) + 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 DepartureTransportMeansType) 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 DepartureTransportMeansType + 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 GoodsReferenceType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _transportEquipmentGoodsReferenceDeclarationGoodsItemNumber As Integer + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property transportEquipmentGoodsReferenceDeclarationGoodsItemNumber() As Integer + Get + Return Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + End Get + Set + Me._transportEquipmentGoodsReferenceDeclarationGoodsItemNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GoodsReferenceType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize GoodsReferenceType 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 GoodsReferenceType object + ''' + ''' string to deserialize + ''' Output GoodsReferenceType 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 GoodsReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GoodsReferenceType) + 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 GoodsReferenceType) 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 GoodsReferenceType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GoodsReferenceType) + 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 GoodsReferenceType + Return CType(SerializerXml.Deserialize(s), GoodsReferenceType) + End Function +#End Region + + ''' + ''' Serializes current GoodsReferenceType 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 GoodsReferenceType object + ''' + ''' File to load and deserialize + ''' Output GoodsReferenceType 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 GoodsReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GoodsReferenceType) + 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 GoodsReferenceType) 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 GoodsReferenceType + 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 SealType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _sealsIdentifier As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property sealsIdentifier() As String + Get + Return Me._sealsIdentifier + End Get + Set + Me._sealsIdentifier = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SealType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize SealType 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 SealType object + ''' + ''' string to deserialize + ''' Output SealType 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 SealType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SealType) + 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 SealType) 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 SealType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SealType) + 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 SealType + Return CType(SerializerXml.Deserialize(s), SealType) + End Function +#End Region + + ''' + ''' Serializes current SealType 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 SealType object + ''' + ''' File to load and deserialize + ''' Output SealType 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 SealType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, SealType) + 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 SealType) 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 SealType + 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 TransportEquipmentType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _containerIdentificationNumber As String + + Private _numberOfSeals As Integer + + Private _seal As List(Of SealType) + + Private _goodsReference As List(Of GoodsReferenceType) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._goodsReference = New List(Of GoodsReferenceType)() + Me._seal = New List(Of SealType)() + End Sub + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property containerIdentificationNumber() As String + Get + Return Me._containerIdentificationNumber + End Get + Set + Me._containerIdentificationNumber = Value + End Set + End Property + + Public Property numberOfSeals() As Integer + Get + Return Me._numberOfSeals + End Get + Set + Me._numberOfSeals = Value + End Set + End Property + + + Public Property seal() As List(Of SealType) + Get + Return Me._seal + End Get + Set + Me._seal = Value + End Set + End Property + + + Public Property goodsReference() As List(Of GoodsReferenceType) + 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(TransportEquipmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransportEquipmentType 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 TransportEquipmentType object + ''' + ''' string to deserialize + ''' Output TransportEquipmentType 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 TransportEquipmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransportEquipmentType) + 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 TransportEquipmentType) 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 TransportEquipmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransportEquipmentType) + 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 TransportEquipmentType + Return CType(SerializerXml.Deserialize(s), TransportEquipmentType) + End Function +#End Region + + ''' + ''' Serializes current TransportEquipmentType 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 TransportEquipmentType object + ''' + ''' File to load and deserialize + ''' Output TransportEquipmentType 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 TransportEquipmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransportEquipmentType) + 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 TransportEquipmentType) 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 TransportEquipmentType + 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 PostCodeAddressType + +#Region "Private fields" + Private _houseNumber As String + + Private _postcode As String + + Private _country As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property houseNumber() As String + Get + Return Me._houseNumber + End Get + Set + Me._houseNumber = Value + End Set + End Property + + Public Property postcode() As String + Get + Return Me._postcode + End Get + Set + Me._postcode = 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(PostCodeAddressType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize PostCodeAddressType 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 PostCodeAddressType object + ''' + ''' string to deserialize + ''' Output PostCodeAddressType 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 PostCodeAddressType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PostCodeAddressType) + 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 PostCodeAddressType) 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 PostCodeAddressType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PostCodeAddressType) + 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 PostCodeAddressType + Return CType(SerializerXml.Deserialize(s), PostCodeAddressType) + End Function +#End Region + + ''' + ''' Serializes current PostCodeAddressType 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 PostCodeAddressType object + ''' + ''' File to load and deserialize + ''' Output PostCodeAddressType 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 PostCodeAddressType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, PostCodeAddressType) + 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 PostCodeAddressType) 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 PostCodeAddressType + 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 LocationOfGoodsType + +#Region "Private fields" + Private _typeOfLocation As String + + Private _qualifierOfIdentification As String + + Private _additionalIdentifier As String + + Private _unLocode As String + + Private _authorisationNumber As String + + Private _customsOffice As String + + Private _gnssLatitude As String + + Private _gnssLongitude As String + + Private _economicOperatorIdentificationNumber As String + + Private _address As AddressType + + Private _postCodeAddress As PostCodeAddressType + + Private _contactPerson As ContactPersonType + + Private _addressNumber As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._postCodeAddress = New PostCodeAddressType() + Me._address = New AddressType() + End Sub + + Public Property typeOfLocation() As String + Get + Return Me._typeOfLocation + End Get + Set + Me._typeOfLocation = Value + End Set + End Property + + Public Property qualifierOfIdentification() As String + Get + Return Me._qualifierOfIdentification + End Get + Set + Me._qualifierOfIdentification = Value + End Set + End Property + + Public Property additionalIdentifier() As String + Get + Return Me._additionalIdentifier + End Get + Set + Me._additionalIdentifier = 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 authorisationNumber() As String + Get + Return Me._authorisationNumber + End Get + Set + Me._authorisationNumber = Value + End Set + End Property + + Public Property customsOffice() As String + Get + Return Me._customsOffice + End Get + Set + Me._customsOffice = Value + End Set + End Property + + Public Property gnssLatitude() As String + Get + Return Me._gnssLatitude + End Get + Set + Me._gnssLatitude = Value + End Set + End Property + + Public Property gnssLongitude() As String + Get + Return Me._gnssLongitude + End Get + Set + Me._gnssLongitude = Value + End Set + End Property + + Public Property economicOperatorIdentificationNumber() As String + Get + Return Me._economicOperatorIdentificationNumber + End Get + Set + Me._economicOperatorIdentificationNumber = Value + End Set + End Property + + Public Property address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property postCodeAddress() As PostCodeAddressType + Get + Return Me._postCodeAddress + End Get + Set + Me._postCodeAddress = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + Get + Return Me._contactPerson + End Get + Set + Me._contactPerson = Value + End Set + End Property + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LocationOfGoodsType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize LocationOfGoodsType 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 LocationOfGoodsType object + ''' + ''' string to deserialize + ''' Output LocationOfGoodsType 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 LocationOfGoodsType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, LocationOfGoodsType) + 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 LocationOfGoodsType) 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 LocationOfGoodsType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LocationOfGoodsType) + 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 LocationOfGoodsType + Return CType(SerializerXml.Deserialize(s), LocationOfGoodsType) + End Function +#End Region + + ''' + ''' Serializes current LocationOfGoodsType 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 LocationOfGoodsType object + ''' + ''' File to load and deserialize + ''' Output LocationOfGoodsType 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 LocationOfGoodsType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, LocationOfGoodsType) + 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 LocationOfGoodsType) 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 LocationOfGoodsType + 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 LoadingType + +#Region "Private fields" + Private _country As String + + Private _location As String + + Private _unlocode 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 + + Public Property location() As String + Get + Return Me._location + End Get + Set + Me._location = Value + End Set + End Property + + Public Property unlocode() As String + Get + Return Me._unlocode + End Get + Set + Me._unlocode = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(LoadingType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize LoadingType 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 LoadingType object + ''' + ''' string to deserialize + ''' Output LoadingType 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 LoadingType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, LoadingType) + 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 LoadingType) 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 LoadingType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), LoadingType) + 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 LoadingType + Return CType(SerializerXml.Deserialize(s), LoadingType) + End Function +#End Region + + ''' + ''' Serializes current LoadingType 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 LoadingType object + ''' + ''' File to load and deserialize + ''' Output LoadingType 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 LoadingType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, LoadingType) + 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 LoadingType) 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 LoadingType + 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 TransitDeclarationConsignmentType + +#Region "Private fields" + Private _countryOfDispatch As String + + Private _countryOfDestination As String + + Private _containerIndicator As Boolean + + Private _inlandModeOfTransport As String + + Private _modeOfTransportAtTheBorder As String + + Private _consignmentGrossMass As Decimal + + Private _referenceNumberUniqueConsignmentReference As String + + Private _placeOfLoading As LoadingType + + Private _placeOfUnloading As LoadingType + + Private _locationOfGoods As LocationOfGoodsType + + Private _transportEquipment As List(Of TransportEquipmentType) + + Private _departureTransportMeans As List(Of DepartureTransportMeansType) + + Private _activeTransportMeans As List(Of ActiveTransportMeansType) + + Private _customsOfficeOfTransitDeclared As List(Of CustomsOfficeOfTransitDeclaredType) + + Private _countryOfRoutingOfConsignment As List(Of CountryOfRoutingOfConsignmentType) + + Private _carrier As CarrierType + + Private _consignor As OperatorWithContactAndSubsidiaryType + + Private _consignee As OperatorWithContactAndSubsidiaryType + + Private _previousDocument As List(Of PreviousDocumentType) + + Private _supportingDocument As List(Of SupportingDocumentType) + + Private _transportDocument As List(Of TransportDocumentType) + + Private _additionalInformation As List(Of AdditionalInformationType) + + Private _additionalReference As List(Of AdditionalReferenceType) + + Private _additionalSupplyChainActor As List(Of AdditionalSupplyChainActorType) + + Private _incident As List(Of IncidentType) + + Private _partner As List(Of TransitDeclarationPartnerType) + + Private _methodOfPayment As String + + Private _customerFields As CustomerFieldsType + + Private _closed As Boolean + + Private _worklist As String + + Private _portInformation As PortInformationType + + Private _houseConsignment As List(Of HouseConsignmentType) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._houseConsignment = New List(Of HouseConsignmentType)() + Me._portInformation = New PortInformationType() + Me._customerFields = New CustomerFieldsType() + Me._partner = New List(Of TransitDeclarationPartnerType)() + Me._incident = New List(Of IncidentType)() + Me._additionalSupplyChainActor = New List(Of AdditionalSupplyChainActorType)() + Me._additionalReference = New List(Of AdditionalReferenceType)() + Me._additionalInformation = New List(Of AdditionalInformationType)() + Me._transportDocument = New List(Of TransportDocumentType)() + Me._supportingDocument = New List(Of SupportingDocumentType)() + Me._previousDocument = New List(Of PreviousDocumentType)() + Me._consignee = New OperatorWithContactAndSubsidiaryType() + Me._consignor = New OperatorWithContactAndSubsidiaryType() + Me._carrier = New CarrierType() + Me._countryOfRoutingOfConsignment = New List(Of CountryOfRoutingOfConsignmentType)() + Me._customsOfficeOfTransitDeclared = New List(Of CustomsOfficeOfTransitDeclaredType)() + Me._activeTransportMeans = New List(Of ActiveTransportMeansType)() + Me._departureTransportMeans = New List(Of DepartureTransportMeansType)() + Me._transportEquipment = New List(Of TransportEquipmentType)() + Me._locationOfGoods = New LocationOfGoodsType() + Me._placeOfUnloading = New LoadingType() + Me._placeOfLoading = New LoadingType() + End Sub + + Public Property countryOfDispatch() As String + Get + Return Me._countryOfDispatch + End Get + Set + Me._countryOfDispatch = Value + End Set + End Property + + Public Property countryOfDestination() As String + Get + Return Me._countryOfDestination + End Get + Set + Me._countryOfDestination = Value + End Set + End Property + + Public Property containerIndicator() As Boolean + Get + Return Me._containerIndicator + End Get + Set + Me._containerIndicator = Value + End Set + End Property + + Public Property inlandModeOfTransport() As String + Get + Return Me._inlandModeOfTransport + End Get + Set + Me._inlandModeOfTransport = Value + End Set + End Property + + Public Property modeOfTransportAtTheBorder() As String + Get + Return Me._modeOfTransportAtTheBorder + End Get + Set + Me._modeOfTransportAtTheBorder = Value + End Set + End Property + + Public Property consignmentGrossMass() As Decimal + Get + Return Me._consignmentGrossMass + End Get + Set + Me._consignmentGrossMass = Value + End Set + End Property + + Public Property referenceNumberUniqueConsignmentReference() As String + Get + Return Me._referenceNumberUniqueConsignmentReference + End Get + Set + Me._referenceNumberUniqueConsignmentReference = Value + End Set + End Property + + Public Property placeOfLoading() As LoadingType + Get + Return Me._placeOfLoading + End Get + Set + Me._placeOfLoading = Value + End Set + End Property + + Public Property placeOfUnloading() As LoadingType + Get + Return Me._placeOfUnloading + End Get + Set + Me._placeOfUnloading = Value + End Set + End Property + + Public Property locationOfGoods() As LocationOfGoodsType + Get + Return Me._locationOfGoods + End Get + Set + Me._locationOfGoods = Value + End Set + End Property + + + Public Property transportEquipment() As List(Of TransportEquipmentType) + Get + Return Me._transportEquipment + End Get + Set + Me._transportEquipment = Value + End Set + End Property + + + Public Property departureTransportMeans() As List(Of DepartureTransportMeansType) + Get + Return Me._departureTransportMeans + End Get + Set + Me._departureTransportMeans = Value + End Set + End Property + + + Public Property activeTransportMeans() As List(Of ActiveTransportMeansType) + Get + Return Me._activeTransportMeans + End Get + Set + Me._activeTransportMeans = Value + End Set + End Property + + + Public Property customsOfficeOfTransitDeclared() As List(Of CustomsOfficeOfTransitDeclaredType) + Get + Return Me._customsOfficeOfTransitDeclared + End Get + Set + Me._customsOfficeOfTransitDeclared = Value + End Set + End Property + + + Public Property countryOfRoutingOfConsignment() As List(Of CountryOfRoutingOfConsignmentType) + Get + Return Me._countryOfRoutingOfConsignment + End Get + Set + Me._countryOfRoutingOfConsignment = Value + End Set + End Property + + Public Property carrier() As CarrierType + Get + Return Me._carrier + End Get + Set + Me._carrier = Value + End Set + End Property + + Public Property consignor() As OperatorWithContactAndSubsidiaryType + Get + Return Me._consignor + End Get + Set + Me._consignor = Value + End Set + End Property + + Public Property consignee() As OperatorWithContactAndSubsidiaryType + Get + Return Me._consignee + End Get + Set + Me._consignee = Value + End Set + End Property + + + Public Property previousDocument() As List(Of PreviousDocumentType) + Get + Return Me._previousDocument + End Get + Set + Me._previousDocument = Value + End Set + End Property + + + Public Property supportingDocument() As List(Of SupportingDocumentType) + Get + Return Me._supportingDocument + End Get + Set + Me._supportingDocument = Value + End Set + End Property + + + Public Property transportDocument() As List(Of TransportDocumentType) + Get + Return Me._transportDocument + End Get + Set + Me._transportDocument = Value + End Set + End Property + + + Public Property additionalInformation() As List(Of AdditionalInformationType) + Get + Return Me._additionalInformation + End Get + Set + Me._additionalInformation = Value + End Set + End Property + + + Public Property additionalReference() As List(Of AdditionalReferenceType) + Get + Return Me._additionalReference + End Get + Set + Me._additionalReference = Value + End Set + End Property + + + Public Property additionalSupplyChainActor() As List(Of AdditionalSupplyChainActorType) + Get + Return Me._additionalSupplyChainActor + End Get + Set + Me._additionalSupplyChainActor = Value + End Set + End Property + + + Public Property incident() As List(Of IncidentType) + Get + Return Me._incident + End Get + Set + Me._incident = Value + End Set + End Property + + + Public Property partner() As List(Of TransitDeclarationPartnerType) + Get + Return Me._partner + End Get + Set + Me._partner = Value + End Set + End Property + + Public Property methodOfPayment() As String + Get + Return Me._methodOfPayment + End Get + Set + Me._methodOfPayment = Value + End Set + End Property + + Public Property customerFields() As CustomerFieldsType + Get + Return Me._customerFields + End Get + Set + Me._customerFields = Value + End Set + End Property + + Public Property closed() As Boolean + Get + Return Me._closed + End Get + Set + Me._closed = Value + End Set + End Property + + Public Property worklist() As String + Get + Return Me._worklist + End Get + Set + Me._worklist = Value + End Set + End Property + + Public Property portInformation() As PortInformationType + Get + Return Me._portInformation + End Get + Set + Me._portInformation = Value + End Set + End Property + + + Public Property houseConsignment() As List(Of HouseConsignmentType) + Get + Return Me._houseConsignment + End Get + Set + Me._houseConsignment = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationConsignmentType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclarationConsignmentType 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 TransitDeclarationConsignmentType object + ''' + ''' string to deserialize + ''' Output TransitDeclarationConsignmentType 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 TransitDeclarationConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationConsignmentType) + 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 TransitDeclarationConsignmentType) 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 TransitDeclarationConsignmentType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationConsignmentType) + 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 TransitDeclarationConsignmentType + Return CType(SerializerXml.Deserialize(s), TransitDeclarationConsignmentType) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclarationConsignmentType 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 TransitDeclarationConsignmentType object + ''' + ''' File to load and deserialize + ''' Output TransitDeclarationConsignmentType 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 TransitDeclarationConsignmentType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationConsignmentType) + 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 TransitDeclarationConsignmentType) 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 TransitDeclarationConsignmentType + 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 TransitDeclarationGuaranteeReferenceType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _guaranteeReferenceNumber As String + + Private _accessCode As String + + Private _amountToBeCovered As Decimal + + Private _currency As String + + Private _customsOfficeOfGuarantee As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property guaranteeReferenceNumber() As String + Get + Return Me._guaranteeReferenceNumber + End Get + Set + Me._guaranteeReferenceNumber = Value + End Set + End Property + + Public Property accessCode() As String + Get + Return Me._accessCode + End Get + Set + Me._accessCode = Value + End Set + End Property + + Public Property amountToBeCovered() As Decimal + Get + Return Me._amountToBeCovered + End Get + Set + Me._amountToBeCovered = 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 customsOfficeOfGuarantee() As String + Get + Return Me._customsOfficeOfGuarantee + End Get + Set + Me._customsOfficeOfGuarantee = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationGuaranteeReferenceType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclarationGuaranteeReferenceType 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 TransitDeclarationGuaranteeReferenceType object + ''' + ''' string to deserialize + ''' Output TransitDeclarationGuaranteeReferenceType 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 TransitDeclarationGuaranteeReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationGuaranteeReferenceType) + 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 TransitDeclarationGuaranteeReferenceType) 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 TransitDeclarationGuaranteeReferenceType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationGuaranteeReferenceType) + 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 TransitDeclarationGuaranteeReferenceType + Return CType(SerializerXml.Deserialize(s), TransitDeclarationGuaranteeReferenceType) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclarationGuaranteeReferenceType 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 TransitDeclarationGuaranteeReferenceType object + ''' + ''' File to load and deserialize + ''' Output TransitDeclarationGuaranteeReferenceType 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 TransitDeclarationGuaranteeReferenceType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationGuaranteeReferenceType) + 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 TransitDeclarationGuaranteeReferenceType) 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 TransitDeclarationGuaranteeReferenceType + 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 GuaranteeType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _guaranteeType As String + + Private _otherGuaranteeReference As String + + Private _kindOfCalculation As String + + Private _guaranteeNotValidInCtry As String + + Private _guaranteeReference As List(Of TransitDeclarationGuaranteeReferenceType) + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._guaranteeReference = New List(Of TransitDeclarationGuaranteeReferenceType)() + End Sub + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property guaranteeType() As String + Get + Return Me._guaranteeType + End Get + Set + Me._guaranteeType = Value + End Set + End Property + + Public Property otherGuaranteeReference() As String + Get + Return Me._otherGuaranteeReference + End Get + Set + Me._otherGuaranteeReference = Value + End Set + End Property + + Public Property kindOfCalculation() As String + Get + Return Me._kindOfCalculation + End Get + Set + Me._kindOfCalculation = Value + End Set + End Property + + Public Property guaranteeNotValidInCtry() As String + Get + Return Me._guaranteeNotValidInCtry + End Get + Set + Me._guaranteeNotValidInCtry = Value + End Set + End Property + + + Public Property guaranteeReference() As List(Of TransitDeclarationGuaranteeReferenceType) + Get + Return Me._guaranteeReference + End Get + Set + Me._guaranteeReference = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GuaranteeType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize GuaranteeType 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 GuaranteeType object + ''' + ''' string to deserialize + ''' Output GuaranteeType 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 GuaranteeType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GuaranteeType) + 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 GuaranteeType) 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 GuaranteeType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GuaranteeType) + 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 GuaranteeType + Return CType(SerializerXml.Deserialize(s), GuaranteeType) + End Function +#End Region + + ''' + ''' Serializes current GuaranteeType 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 GuaranteeType object + ''' + ''' File to load and deserialize + ''' Output GuaranteeType 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 GuaranteeType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, GuaranteeType) + 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 GuaranteeType) 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 GuaranteeType + 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 AuthorisationType + +#Region "Private fields" + Private _sequenceNumber As Integer + + Private _authorisationType As String + + Private _authorisationNumber As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Property sequenceNumber() As Integer + Get + Return Me._sequenceNumber + End Get + Set + Me._sequenceNumber = Value + End Set + End Property + + Public Property authorisationType() As String + Get + Return Me._authorisationType + End Get + Set + Me._authorisationType = Value + End Set + End Property + + Public Property authorisationNumber() As String + Get + Return Me._authorisationNumber + End Get + Set + Me._authorisationNumber = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(AuthorisationType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize AuthorisationType 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 AuthorisationType object + ''' + ''' string to deserialize + ''' Output AuthorisationType 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 AuthorisationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AuthorisationType) + 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 AuthorisationType) 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 AuthorisationType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), AuthorisationType) + 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 AuthorisationType + Return CType(SerializerXml.Deserialize(s), AuthorisationType) + End Function +#End Region + + ''' + ''' Serializes current AuthorisationType 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 AuthorisationType object + ''' + ''' File to load and deserialize + ''' Output AuthorisationType 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 AuthorisationType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, AuthorisationType) + 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 AuthorisationType) 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 AuthorisationType + 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 TransitDeclarationRepresentativeType + +#Region "Private fields" + Private _addressNumber As String + + Private _identificationNumber As String + + Private _name As String + + Private _address As AddressType + + Private _contactPerson As ContactPersonType + + Private _status As String + + Private Shared _serializerXml As XmlSerializer +#End Region + + Public Sub New() + MyBase.New + Me._contactPerson = New ContactPersonType() + Me._address = New AddressType() + End Sub + + Public Property addressNumber() As String + Get + Return Me._addressNumber + End Get + Set + Me._addressNumber = 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 name() As String + Get + Return Me._name + End Get + Set + Me._name = Value + End Set + End Property + + Public Property address() As AddressType + Get + Return Me._address + End Get + Set + Me._address = Value + End Set + End Property + + Public Property contactPerson() As ContactPersonType + Get + Return Me._contactPerson + End Get + Set + Me._contactPerson = Value + End Set + End Property + + Public Property status() As String + Get + Return Me._status + End Get + Set + Me._status = Value + End Set + End Property + + Private Shared ReadOnly Property SerializerXml() As XmlSerializer + Get + If (_serializerXml Is Nothing) Then + _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TransitDeclarationRepresentativeType)) + End If + Return _serializerXml + End Get + End Property + +#Region "Serialize/Deserialize" + ''' + ''' Serialize TransitDeclarationRepresentativeType 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 TransitDeclarationRepresentativeType object + ''' + ''' string to deserialize + ''' Output TransitDeclarationRepresentativeType 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 TransitDeclarationRepresentativeType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationRepresentativeType) + 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 TransitDeclarationRepresentativeType) 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 TransitDeclarationRepresentativeType + Dim stringReader As StringReader = Nothing + Try + stringReader = New StringReader(input) + Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TransitDeclarationRepresentativeType) + 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 TransitDeclarationRepresentativeType + Return CType(SerializerXml.Deserialize(s), TransitDeclarationRepresentativeType) + End Function +#End Region + + ''' + ''' Serializes current TransitDeclarationRepresentativeType 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 TransitDeclarationRepresentativeType object + ''' + ''' File to load and deserialize + ''' Output TransitDeclarationRepresentativeType 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 TransitDeclarationRepresentativeType, ByRef exception As System.Exception) As Boolean + exception = Nothing + obj = CType(Nothing, TransitDeclarationRepresentativeType) + 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 TransitDeclarationRepresentativeType) 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 TransitDeclarationRepresentativeType + 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_NCTS/MicNctsTransitDeclarationP5.wsdl b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.wsdl new file mode 100644 index 00000000..d7f5fa85 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.wsdl @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.xsd new file mode 100644 index 00000000..25826195 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MIC_NCTS/MicNctsTransitDeclarationP5.xsd @@ -0,0 +1,5466 @@ + + + + + + Transit Declaration + Versandanmeldung + true + + + + + + + + Transit Declaration Header + Versandanmeldungskopf + + + true + + + + + + + + + + + + Street And Number of the Holder of the Transit Procedure + Street And Number of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurestreetandnumber, Length + 70 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurestreetandnumber, Length + 70 + + String0..70 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurestreetandnumber + + false + + + + + + + Postcode of the Holder of the Transit Procedure + Postcode of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurepostcode, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurepostcode, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurepostcode + + false + + + + + + + City of the Holder of the Transit Procedure + City of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecity, Length 35 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecity, Length 35 + + String0..35 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurecity + + false + + + + + + + Country of the Holder of the Transit Procedure + Country of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecountry, Length 2 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecountry, Length 2 + + String0..2 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurecountry + + false + + + + + + + + + + + Name of the Contact Person of the Holder of the Transit Procedure + Name of the Contact Person of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonname, Length + 70 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonname, Length + 70 + + String0..70 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurecontactpersonname + + false + + + + + + + Phone Number Contact Person of the Holder of the Transit Procedure + Phone Number Contact Person of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonphonenumber, + Length 35 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonphonenumber, + Length 35 + + String0..35 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurecontactpersonphonenumber + + false + + + + + + + E-mail Address Contact Person of the Holder of the Transit Procedure + E-mail Address Contact Person of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonemailaddress, + Length 256 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurecontactpersonemailaddress, + Length 256 + + String0..256 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurecontactpersonemailaddress + + false + + + + + + + + + + + Location of goods postcode address house number + Location of goods postcode address house number + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressHouseNumber, Length + 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressHouseNumber, Length + 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsPostcodeAddressHouseNumber + + false + + + + + + + Location of goods postcode address postcode + Location of goods postcode address postcode + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressPostCode, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressPostCode, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsPostcodeAddressPostCode + + false + + + + + + + Location of goods postcode address country + Location of goods postcode address country + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressCountry, Length 2 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsPostcodeAddressCountry, Length 2 + + String0..2 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsPostcodeAddressCountry + + false + + + + + + + + + + + Country of the Place of Loading + Country of the Place of Loading + Table mic_ncts_eucdm_transit_declaration_header, Column placeofloadingcountry, Length 2 + Table mic_ncts_eucdm_transit_declaration_header, Column placeofloadingcountry, Length 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_header + placeofloadingcountry + + false + + + + + + + Location of the Place of Loading + Location of the Place of Loading + Table mic_ncts_eucdm_transit_declaration_header, Column placeofloadinglocation, Length 35 + Table mic_ncts_eucdm_transit_declaration_header, Column placeofloadinglocation, Length 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_header + placeofloadinglocation + + false + + + + + + + Place of Loading UNLOC Code + Place of Loading UNLOC Code + Table mic_ncts_eucdm_transit_declaration_header, Column placeOfLoadingUnlocode, Length 17 + Table mic_ncts_eucdm_transit_declaration_header, Column placeOfLoadingUnlocode, Length 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_header + placeOfLoadingUnlocode + + false + + + + + + + + + + + Holder Of The Transit Procedure Address Number + Holder Of The Transit Procedure Address Number + Table mic_ncts_eucdm_transit_declaration_header, Column holderOfTheTransitProcedureAddressNumber, Length 15 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderOfTheTransitProcedureAddressNumber, Length 15 + + String0..15 + + mic_ncts_eucdm_transit_declaration_header + holderOfTheTransitProcedureAddressNumber + + false + + + + + + + Identification Number of the Holder of the Transit Procedure + Identification Number of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedureidentificationnumber, + Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedureidentificationnumber, + Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedureidentificationnumber + + false + + + + + + + Tir Holder Identification Number of the Holder of the Transit Procedure + Tir Holder Identification Number of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column + holderofthetransitproceduretirholderidentificationnumber, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column + holderofthetransitproceduretirholderidentificationnumber, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitproceduretirholderidentificationnumber + + false + + + + + + + Name of the Holder of the Transit Procedure + Name of the Holder of the Transit Procedure + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurename, Length 70 + + Table mic_ncts_eucdm_transit_declaration_header, Column holderofthetransitprocedurename, Length 70 + + String0..70 + + mic_ncts_eucdm_transit_declaration_header + holderofthetransitprocedurename + + false + + + + + + + Address of the Holder of the Transit Procedure + Adresse des Inhabers des Versandverfahrens + + + ComplexType + + + + + false + + + + + + + Contact Person of the Holder of the Transit Procedure + Kontaktperson des Inhabers des Versandverfahrens + + + ComplexType + + + + + false + + + + + + + + + + + Representative Address Number + Representative Address Number + Table mic_ncts_eucdm_transit_declaration_header, Column representativeAddressNumber, Length 15 + + Table mic_ncts_eucdm_transit_declaration_header, Column representativeAddressNumber, Length 15 + + String0..15 + + mic_ncts_eucdm_transit_declaration_header + representativeAddressNumber + + false + + + + + + + Identification Number of the Representative + Identification Number of the Representative + Table mic_ncts_eucdm_transit_declaration_header, Column representativeidentificationnumber, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column representativeidentificationnumber, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + representativeidentificationnumber + + false + + + + + + + Representative Name + Representative Name + Table mic_ncts_eucdm_transit_declaration_header, Column representativeName, Length 70 + Table mic_ncts_eucdm_transit_declaration_header, Column representativeName, Length 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_header + representativeName + + false + + + + + + + Address of the Representative + Adresse des Vertreters + + + ComplexType + + + + + false + + + + + + + Contact Person of the Representative + Kontaktperson des Vertreters + + + ComplexType + + + + + false + + + + + + + Representative status + Representative status + Table mic_ncts_eucdm_transit_declaration_header, Column representativestatus, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column representativestatus, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + representativestatus + + false + + + + + + + + + + + Carrier Address Number + Carrier Address Number + Table mic_ncts_eucdm_transit_declaration_header, Column carrierAddressNumber, Length 15 + Table mic_ncts_eucdm_transit_declaration_header, Column carrierAddressNumber, Length 15 + String0..15 + + mic_ncts_eucdm_transit_declaration_header + carrierAddressNumber + + false + + + + + + + Identification Number of the Carrier + Identification Number of the Carrier + Table mic_ncts_eucdm_transit_declaration_header, Column carrieridentificationnumber, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column carrieridentificationnumber, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + carrieridentificationnumber + + false + + + + + + + Subsidiary Number of the Carrier + Subsidiary Number of the Carrier + Table mic_ncts_eucdm_transit_declaration_header, Column carriersubsidiarynumber, Length 4 + Table mic_ncts_eucdm_transit_declaration_header, Column carriersubsidiarynumber, Length 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_header + carriersubsidiarynumber + + false + + + + + + + Name of the Carrier + Name des Beförderers + Table mic_ncts_eucdm_transit_declaration_header, Column carrierName, Length 70 + Table mic_ncts_eucdm_transit_declaration_header, Column carrierName, Length 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_header + carrierName + + false + + + + + + + Address of the Carrier + Adresse des Beförderers + + + ComplexType + + + + + false + + + + + + + Contact Person of the Carrier + Kontaktperson des Beförderers + + + ComplexType + + + + + false + + + + + + + + + + + Consignor Address Number + Consignor Address Number + Table mic_ncts_eucdm_transit_declaration_header, Column consignorAddressNumber, Length 15 + Table mic_ncts_eucdm_transit_declaration_header, Column consignorAddressNumber, Length 15 + String0..15 + + mic_ncts_eucdm_transit_declaration_header + consignorAddressNumber + + false + + + + + + + Identification Number of the Consignor + Identification Number of the Consignor + Table mic_ncts_eucdm_transit_declaration_header, Column consignoridentificationnumber, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column consignoridentificationnumber, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + consignoridentificationnumber + + false + + + + + + + Subsidiary Number of the Consignor + Subsidiary Number of the Consignor + Table mic_ncts_eucdm_transit_declaration_header, Column consignorsubsidiarynumber, Length 4 + Table mic_ncts_eucdm_transit_declaration_header, Column consignorsubsidiarynumber, Length 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_header + consignorsubsidiarynumber + + false + + + + + + + Name of the Consignor + Name of the Consignor + Table mic_ncts_eucdm_transit_declaration_header, Column consignorname, Length 70 + Table mic_ncts_eucdm_transit_declaration_header, Column consignorname, Length 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_header + consignorname + + false + + + + + + + Address of the Operator (Consignor/Consignee) + Adresse des Betreibers (Versender/Empfänger) + + + ComplexType + + + + + false + + + + + + + Contact Person of the Operator (Consignor/Consignee) + Kontaktperson des Betreibers (Versender/Empfänger) + + + ComplexType + + + + + false + + + + + + + + + + + Partner type + Partner Art + + + String0..25 + + mic_ncts_eucdm_transit_declaration_partner + type + + false + + + + + + + Partner status + Partner Status + + + String0..1 + + mic_ncts_eucdm_transit_declaration_partner + status + + false + + + + + + + Partner address number + Partner Adressnummer + + + String0..15 + + mic_ncts_eucdm_transit_declaration_partner + addressNumber + + false + + + + + + + Partner identification number + Partner Identifikationsnummer + + + String0..17 + + mic_ncts_eucdm_transit_declaration_partner + identificationNumber + + false + + + + + + + Partner name + Partner Name + + + String0..70 + + mic_ncts_eucdm_transit_declaration_partner + name + + false + + + + + + + Representative RIN (Representative Identification Number) + Vertreter RIN (Vertreter-Identifikationsnummer) + + + String0..17 + + mic_ncts_eucdm_transit_declaration_partner + representativeRin + + false + + + + + + + Partner address + Partner Adresse + + + ComplexType + + + + + false + + + + + + + Partner contact person + Partner Kontaktperson + + + ComplexType + + + + + false + + + + + + + TIR Holder Identification Number + TIR-Inhaber-Identifikationsnummer + Table mic_ncts_eucdm_transit_declaration_partner, Column tirHolderIdentificationNumber, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_partner, Spalte tirHolderIdentificationNumber, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_partner + tirHolderIdentificationNumber + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_authorisation, Column sequenceNumber, Precision 1 + Tabelle mic_ncts_eucdm_transit_declaration_authorisation, Spalte sequenceNumber, Precision 1 + Integer + + mic_ncts_eucdm_transit_declaration_authorisation + sequenceNumber + 1 + true + + + + + + + Authorisation type + Bewilligungsart + Table mic_ncts_eucdm_transit_declaration_authorisation, Column authorisationType, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_authorisation, Spalte authorisationType, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_authorisation + authorisationType + + false + + + + + + + Authorisation Number + Bewilligungsnummer + Table mic_ncts_eucdm_transit_declaration_authorisation, Column authorisationNumber, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_authorisation, Spalte authorisationNumber, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_authorisation + authorisationNumber + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte sequenceNumber, Precision 2 + Integer + + mic_ncts_eucdm_transit_declaration_guarantee_reference + sequenceNumber + 1 + true + + + + + + + Guarantee reference number + Sicherheitsreferenznummer + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column guaranteeReferenceNumber, Length 24 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte guaranteeReferenceNumber, Länge 24 + String0..24 + + mic_ncts_eucdm_transit_declaration_guarantee_reference + guaranteeReferenceNumber + + false + + + + + + + Access code + Zugangscode + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column accessCode, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte accessCode, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_guarantee_reference + accessCode + + false + + + + + + + Amount to be covered + Zu deckender Betrag + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column amountToBeCovered, Precision 18, Scale 2 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte amountToBeCovered, Precision 18, Dezimalstellen 2 + Decimal18,2 + + mic_ncts_eucdm_transit_declaration_guarantee_reference + amountToBeCovered + + false + + + + + + + Currency code + Währungscode + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column currency, Length 3 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte currency, Länge 3 + String0..3 + + mic_ncts_eucdm_transit_declaration_guarantee_reference + currency + + false + + + + + + + Customs Office of Guarantee + Zollstelle der Sicherheitsleistung + Table mic_ncts_eucdm_transit_declaration_guarantee_reference, Column customsOfficeOfGuarantee, Length 8 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee_reference, Spalte customsOfficeOfGuarantee, Länge 8 + String0..8 + + mic_ncts_eucdm_transit_declaration_guarantee_reference + customsOfficeOfGuarantee + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_guarantee, Column sequenceNumber, Precision 1 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee, Spalte sequenceNumber, Precision 1 + Integer + + mic_ncts_eucdm_transit_declaration_guarantee + sequenceNumber + 1 + true + + + + + + + Guarantee type + Art der Sicherheit + Table mic_ncts_eucdm_transit_declaration_guarantee, Column guaranteeType, Length 1 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee, Spalte guaranteeType, Länge 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_guarantee + guaranteeType + + false + + + + + + + Other guarantee reference number + Sonstige Sicherheitsnummer + Table mic_ncts_eucdm_transit_declaration_guarantee, Column otherGuaranteeReference, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee, Spalte otherGuaranteeReference, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_guarantee + otherGuaranteeReference + + false + + + + + + + Kind of calculation + Berechnungsart + Table mic_ncts_eucdm_transit_declaration_guarantee, Column kindOfCalculation, Length 20 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee, Spalte kindOfCalculation, Länge 20 + String0..20 + + mic_ncts_eucdm_transit_declaration_guarantee + kindOfCalculation + + false + + + + + + + Guarantee not valid in country + Sicherheit nicht gültig in Land + Table mic_ncts_eucdm_transit_declaration_guarantee, Column guaranteeNotValidInCtry, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_guarantee, Spalte guaranteeNotValidInCtry, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_guarantee + guaranteeNotValidInCtry + + false + + + + + + + Guarantee Reference + Sicherheitsreferenz + List of guarantee references for the transit declaration + Liste der Sicherheitsreferenzen für die Versandanmeldung + ComplexType + unbounded + mic_ncts_eucdm_transit_declaration_guarantee_reference + + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Sequence Number of Transport Equipment having discrepancies + Sequenznummer der Transportausrüstung die Unstimmigkeiten enthält + Decimal + + mic_ncts_eucdm_transit_declaration_transport_equipment + sequenceNumber + 1 + true + + + + + + + Container identification number + Container-Identifikationsnummer + Table mic_ncts_eucdm_transit_declaration_transport_equipment, Column containerIdentificationNumber, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_transport_equipment, Spalte containerIdentificationNumber, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_transport_equipment + containerIdentificationNumber + + false + + + + + + + Number of seals attached to the transport equipment + Anzahl der am Transportmittel angebrachten Siegel + Table mic_ncts_eucdm_transit_declaration_transport_equipment, Column numberOfSeals, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_transport_equipment, Spalte numberOfSeals, Precision 2 + Integer + + mic_ncts_eucdm_transit_declaration_transport_equipment + numberOfSeals + + false + + + + + + + Seals + Verschlüsse + Add element only if discrepancies within Seals have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Verschlüssen festgestellt wurden + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_seal + + + false + + + + + + + Reference to goods items transported in this equipment + Verweis auf Warenpositionen, die in diesem Transportmittel befördert werden + + + + + + + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_seal, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_seal, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_seal + sequenceNumber + 1 + true + + + + + + + Unique identifier of the seal + Eindeutige Kennung des Siegels + Table mic_ncts_eucdm_transit_declaration_seal, Column sealsIdentifier, Length 20 + Tabelle mic_ncts_eucdm_transit_declaration_seal, Spalte sealsIdentifier, Länge 20 + String0..20 + + mic_ncts_eucdm_transit_declaration_seal + sealsIdentifier + SEAL123 + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference, Column sequenceNumber, Precision 4 + Tabelle mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference, Spalte sequenceNumber, Präzision 4 + Integer + + mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference + sequenceNumber + 1 + true + + + + + + + Declaration Goods Item Number + Warennummer der Anmeldung + Table mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference, Column transportEquipmentGoodsReferenceDeclarationGoodsItemNumber, Precision 4 + Tabelle mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference, Spalte transportEquipmentGoodsReferenceDeclarationGoodsItemNumber, Präzision 4 + Integer + + mic_ncts_eucdm_transit_declaration_transport_equipment_goods_reference + transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + 1 + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_departure_transport_means, Column sequenceNumber, Precision 3 + Tabelle mic_ncts_eucdm_transit_declaration_departure_transport_means, Spalte sequenceNumber, Precision 3 + Integer + + mic_ncts_eucdm_transit_declaration_departure_transport_means + sequenceNumber + 1 + true + + + + + + + Type of identification of means of transport at departure + Art der Identifikation des Beförderungsmittels bei Abgang + Table mic_ncts_eucdm_transit_declaration_departure_transport_means, Column typeOfIdentificationAtDeparture, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_departure_transport_means, Spalte typeOfIdentificationAtDeparture, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_departure_transport_means + typeOfIdentificationAtDeparture + + false + + + + + + + Identification number of means of transport at departure + Identifizierungsnummer des Beförderungsmittels bei Abgang + Table mic_ncts_eucdm_transit_declaration_departure_transport_means, Column identificationNumberAtDeparture, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_departure_transport_means, Spalte identificationNumberAtDeparture, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_departure_transport_means + identificationNumberAtDeparture + + false + + + + + + + Country code of nationality/registration of means of transport at departure + Ländercode der Staatsangehörigkeit/Registrierung des Transportmittels bei der Abfahrt + Table mic_ncts_eucdm_transit_declaration_departure_transport_means, Column nationalityAtDeparture, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_departure_transport_means, Spalte nationalityAtDeparture, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_departure_transport_means + nationalityAtDeparture + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column sequenceNumber, Precision 1 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte sequenceNumber, Precision 1 + Integer + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + sequenceNumber + 1 + true + + + + + + + Type of identification of means of transport crossing border + Art der Identifikation des Beförderungsmittels an der Grenze + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column typeOfIdentificationAtBorderCrossing, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte typeOfIdentificationAtBorderCrossing, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + typeOfIdentificationAtBorderCrossing + + false + + + + + + + Identification number of means of transport crossing border + Identifizierungsnummer des Beförderungsmittels an der Grenze + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column identificationNumberAtBorderCrossing, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte identificationNumberAtBorderCrossing, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + identificationNumberAtBorderCrossing + + false + + + + + + + Nationality of means of transport crossing border + Nationalität des Beförderungsmittels an der Grenze + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column nationalityAtBorderCrossing, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte nationalityAtBorderCrossing, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + nationalityAtBorderCrossing + + false + + + + + + + Conveyance reference number + Beförderungsmittel Referenznummer + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column conveyanceReferenceNumber, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte conveyanceReferenceNumber, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + conveyanceReferenceNumber + + false + + + + + + + Customs office reference number at the border where the goods are declared to cross + Referenznummer der Zollstelle an der Grenze, an der die Waren zur Überquerung angemeldet werden + Table mic_ncts_eucdm_transit_declaration_active_border_transport_means, Column customsOfficeAtBorderDeclared, Length 8 + Tabelle mic_ncts_eucdm_transit_declaration_active_border_transport_means, Spalte customsOfficeAtBorderDeclared, Länge 8 + String0..8 + + mic_ncts_eucdm_transit_declaration_active_border_transport_means + customsOfficeAtBorderDeclared + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Column sequenceNumber, Precision 1 + Tabelle mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Spalte sequenceNumber, Precision 1 + Integer + + mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared + sequenceNumber + 1 + true + + + + + + + Customs office of transit declared + Angemeldete Durchgangszollstelle + Table mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Column customsOfficeOfTransitDeclared, Length 8 + Tabelle mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Spalte customsOfficeOfTransitDeclared, Länge 8 + String0..8 + + mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared + customsOfficeOfTransitDeclared + + false + + + + + + + Estimated date and time of arrival at the customs office of transit + Geschätztes Datum und Uhrzeit der Ankunft bei der Durchgangszollstelle + Table mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Column arrivalDateAndTimeEstimated + Tabelle mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared, Spalte arrivalDateAndTimeEstimated + DateTime + + mic_ncts_eucdm_transit_declaration_customs_office_of_transit_declared + arrivalDateAndTimeEstimated + + false + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment + sequenceNumber + 1 + true + + + + + + + Country code of routing for the consignment + Ländercode des Versandwegs für die Sendung + Table mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment, Column country, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment, Spalte country, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_departure_country_of_routing_of_consignment + country + AT + false + + + + + + + + + + + + Sequence number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_previous_document, Column sequenceNumber, Precision 4 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte sequenceNumber, Präzision 4 + Integer + + mic_ncts_eucdm_transit_declaration_previous_document + sequenceNumber + 1 + true + + + + + + + Previous document type + Vorheriges Dokument Typ + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentType, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentType, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentType + + false + + + + + + + Previous document reference + Vorheriges Dokument Referenz + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentReference, Length 70 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentReference, Länge 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentReference + + false + + + + + + + Previous document goods item number + Vorheriges Dokument Warenpositionsnummer + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentGoodsItemNumber, Precision 5 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentGoodsItemNumber, Präzision 5 + Long + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentGoodsItemNumber + + false + + + + + + + Previous document goods item number as string + Vorheriges Dokument Warenpositionsnummer als Text + Auxiliary field, not stored in database + Hilfsfeld, nicht in Datenbank gespeichert + String0..5 + + + + + false + + + + + + + Previous document complement of information + Vorheriges Dokument Ergänzende Angaben + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentComplementOfInformation, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentComplementOfInformation, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentComplementOfInformation + + false + + + + + + + Temporary storage + Zwischenlagerung + Table mic_ncts_eucdm_transit_declaration_previous_document, Column temporarystorage + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte temporarystorage + Boolean + + mic_ncts_eucdm_transit_declaration_previous_document + temporarystorage + + false + + + + + + + Previous document SID + Vorheriges Dokument SID + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousdocumentsid + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousdocumentsid + Long + + mic_ncts_eucdm_transit_declaration_previous_document + previousdocumentsid + + false + + + + + + + + + + + + + + Previous document type of packages + Vorheriges Dokument Packstücksart + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentTypeOfPackages, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentTypeOfPackages, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentTypeOfPackages + + false + + + + + + + Previous document number of packages + Vorheriges Dokument Anzahl Packstücke + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentNumberOfPackages, Precision 8 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentNumberOfPackages, Präzision 8 + Integer + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentNumberOfPackages + + false + + + + + + + Previous document measurement unit + Vorheriges Dokument Maßeinheit + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentMeasurementUnit, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentMeasurementUnit, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentMeasurementUnit + + false + + + + + + + Previous document quantity + Vorheriges Dokument Menge + Table mic_ncts_eucdm_transit_declaration_previous_document, Column previousDocumentQuantity, Precision 22, Scale 6 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte previousDocumentQuantity, Präzision 22, Skala 6 + Decimal 22,6 + + mic_ncts_eucdm_transit_declaration_previous_document + previousDocumentQuantity + + false + + + + + + + Depreciated amount of guarantee + Abgeschriebener Sicherheitsbetrag + Table mic_ncts_eucdm_transit_declaration_previous_document, Column depreciatedAmountOfGuarantee, Length 10 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte depreciatedAmountOfGuarantee, Länge 10 + Long + + mic_ncts_eucdm_transit_declaration_previous_document + depreciatedAmountOfGuarantee + + false + + + + + + + Authorisation special procedure + Bewilligung Sonderverfahren + Table mic_ncts_eucdm_transit_declaration_previous_document, Column authorisationSpecialProcedure, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte authorisationSpecialProcedure, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_previous_document + authorisationSpecialProcedure + + false + + + + + + + Commodity code of early exported equal material + Warennummer des vorzeitig ausgeführten gleichartigen Materials + Table mic_ncts_eucdm_transit_declaration_previous_document, Column commodityCodeOfEarlyExportedEqualMaterial, Length 10 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte commodityCodeOfEarlyExportedEqualMaterial, Länge 10 + String0..10 + + mic_ncts_eucdm_transit_declaration_previous_document + commodityCodeOfEarlyExportedEqualMaterial + + false + + + + + + + Early export of equal material + Vorzeitige Ausfuhr von gleichartigem Material + Table mic_ncts_eucdm_transit_declaration_previous_document, Column earlyExportOfEqualMaterial, Length 1 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte earlyExportOfEqualMaterial, Länge 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_previous_document + earlyExportOfEqualMaterial + + false + + + + + + + Part number of previous document + Teilnummer des vorherigen Dokuments + Table mic_ncts_eucdm_transit_declaration_previous_document, Column partNumberOfPreviousDocument, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_previous_document, Spalte partNumberOfPreviousDocument, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_previous_document + partNumberOfPreviousDocument + + false + + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column sequenceNumber, Precision 2 + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column sequenceNumber, Precision 2 + Integer + + mic_ncts_eucdm_transit_declaration_supporting_document + sequenceNumber + 1 + false + + + + + + + Supporting document type + Begleitdokument Typ + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentType, Length 4 + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentType, Length 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_supporting_document + supportingDocumentType + + false + + + + + + + Supporting document reference + Begleitdokument Referenz + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentReference, Length 70 + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentReference, Length 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_supporting_document + supportingDocumentReference + + false + + + + + + + Supporting document line item number + Begleitdokument Positionsnummer + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentLineItemNumber, Precision 5 + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentLineItemNumber, Precision 5 + Integer + + mic_ncts_eucdm_transit_declaration_supporting_document + supportingDocumentLineItemNumber + + false + + + + + + + Supporting document complement of information + Begleitdokument Ergänzende Angaben + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentComplementOfInformation, Length 35 + Table mic_ncts_eucdm_transit_declaration_supporting_document, Column supportingDocumentComplementOfInformation, Length 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_supporting_document + supportingDocumentComplementOfInformation + + false + + + + + + + + + + + + + Sequence number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_transport_document, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_transport_document, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_transport_document + sequenceNumber + 1 + true + + + + + + + Transport document type + Beförderungspapier Typ + Table mic_ncts_eucdm_transit_declaration_transport_document, Column transportDocumentType, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_transport_document, Spalte transportDocumentType, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_transport_document + transportDocumentType + + false + + + + + + + Transport document reference + Beförderungspapier Referenz + Table mic_ncts_eucdm_transit_declaration_transport_document, Column transportDocumentReference, Length 70 + Tabelle mic_ncts_eucdm_transit_declaration_transport_document, Spalte transportDocumentReference, Länge 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_transport_document + transportDocumentReference + + false + + + + + + + + + + + + + Sequence number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_additional_information, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_additional_information, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_additional_information + sequenceNumber + 1 + true + + + + + + + Additional information code + Besondere Bemerkung Code + Table mic_ncts_eucdm_transit_declaration_additional_information, Column additionalInformationCode, Length 5 + Tabelle mic_ncts_eucdm_transit_declaration_additional_information, Spalte additionalInformationCode, Länge 5 + String0..5 + + mic_ncts_eucdm_transit_declaration_additional_information + additionalInformationCode + + false + + + + + + + Additional information text + Besondere Bemerkung Text + Table mic_ncts_eucdm_transit_declaration_additional_information, Column additionalInformationText, Length 512 + Tabelle mic_ncts_eucdm_transit_declaration_additional_information, Spalte additionalInformationText, Länge 512 + String0..512 + + mic_ncts_eucdm_transit_declaration_additional_information + additionalInformationText + + false + + + + + + + + + + + + + Sequence number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_additional_reference, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_additional_reference, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_additional_reference + sequenceNumber + 1 + true + + + + + + + Additional reference type + Zusätzliche Referenz Typ + Table mic_ncts_eucdm_transit_declaration_additional_reference, Column additionalReferenceType, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_additional_reference, Spalte additionalReferenceType, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_additional_reference + additionalReferenceType + + false + + + + + + + Additional reference reference + Zusätzliche Referenz Referenz + Table mic_ncts_eucdm_transit_declaration_additional_reference, Column additionalReferenceReference, Length 70 + Tabelle mic_ncts_eucdm_transit_declaration_additional_reference, Spalte additionalReferenceReference, Länge 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_additional_reference + additionalReferenceReference + + false + + + + + + + + + + + + + Sequence number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + sequenceNumber + 1 + true + + + + + + + Role + Rolle + Table mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Column role, Length 3 + Tabelle mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Spalte role, Länge 3 + String0..3 + + mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + role + + false + + + + + + + Supply chain actor ID + Lieferkettenbeteiligter ID + Table mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Column supplyChainActorId, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor, Spalte supplyChainActorId, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + supplyChainActorId + + false + + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_dangerous_goods, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_dangerous_goods, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_dangerous_goods + sequenceNumber + 1 + true + + + + + + + UN number for dangerous goods + UN-Nummer für Gefahrgut + Table mic_ncts_eucdm_transit_declaration_dangerous_goods, Column unDangerousGoodsNumber, Length 4 + Tabelle mic_ncts_eucdm_transit_declaration_dangerous_goods, Spalte unDangerousGoodsNumber, Länge 4 + String0..4 + + mic_ncts_eucdm_transit_declaration_dangerous_goods + unDangerousGoodsNumber + 1203 + false + + + + + + + + + + + + + Customer field text 1 + Kundenfeld Text 1 + Table mic_ncts_eucdm_customer_fields, Column text1, Length 400 + Tabelle mic_ncts_eucdm_customer_fields, Spalte text1, Länge 400 + String0..400 + + mic_ncts_eucdm_customer_fields + text1 + + false + + + + + + + Customer field text 3 + Kundenfeld Text 3 + + + String0..256 + + + + + false + + + + + + + Customer field text 4 + Kundenfeld Text 4 + + + String0..256 + + + + + false + + + + + + + Customer field text 5 + Kundenfeld Text 5 + + + String0..256 + + + + + false + + + + + + + Text6 + Text6 + + + String0..35 + + + + + false + + + + + + + Text7 + Text7 + + + String0..35 + + + + + false + + + + + + + Text8 + Text8 + + + String0..35 + + + + + false + + + + + + + Text9 + Text9 + + + String0..35 + + + + + false + + + + + + + Text10 + Text10 + + + String0..35 + + + + + false + + + + + + + Num1 + Num1 + + + Decimal16,2 + + + + + false + + + + + + + Num2 + Num2 + + + Decimal16,2 + + + + + false + + + + + + + Num3 + Num3 + + + Decimal16,2 + + + + + false + + + + + + + Num4 + Num4 + + + Decimal16,2 + + + + + false + + + + + + + Num5 + Num5 + + + Decimal16,2 + + + + + false + + + + + + + Num6 + Num6 + + + Decimal16,2 + + + + + false + + + + + + + Num7 + Num7 + + + Decimal16,2 + + + + + false + + + + + + + Num8 + Num8 + + + Decimal16,2 + + + + + false + + + + + + + Num9 + Num9 + + + Decimal16,2 + + + + + false + + + + + + + Num10 + Num10 + + + Decimal16,2 + + + + + false + + + + + + + Flag1 + Flag1 + + + Boolean + + + + + false + + + + + + + Flag2 + Flag2 + + + Boolean + + + + + false + + + + + + + Flag3 + Flag3 + + + Boolean + + + + + false + + + + + + + Flag4 + Flag4 + + + Boolean + + + + + false + + + + + + + Flag5 + Flag5 + + + Boolean + + + + + false + + + + + + + Flag6 + Flag6 + + + Boolean + + + + + false + + + + + + + Flag7 + Flag7 + + + Boolean + + + + + false + + + + + + + Flag8 + Flag8 + + + Boolean + + + + + false + + + + + + + Flag9 + Flag9 + + + Boolean + + + + + false + + + + + + + Flag10 + Flag10 + + + Boolean + + + + + false + + + + + + + Date1 + Date1 + + + DateTime + + + + + false + + + + + + + Date2 + Date2 + + + DateTime + + + + + false + + + + + + + Date3 + Date3 + + + DateTime + + + + + false + + + + + + + Date4 + Date4 + + + DateTime + + + + + false + + + + + + + Date5 + Date5 + + + DateTime + + + + + false + + + + + + + Date6 + Date6 + + + DateTime + + + + + false + + + + + + + Date7 + Date7 + + + DateTime + + + + + false + + + + + + + Date8 + Date8 + + + DateTime + + + + + false + + + + + + + Date9 + Date9 + + + DateTime + + + + + false + + + + + + + Date10 + Date10 + + + DateTime + + + + + false + + + + + + + Custom date field for customer-specific data + Benutzerdefiniertes Datumsfeld für kundenspezifische Daten + + + String0..4 + + + + + false + + + + + + + + + + + + + Document type + Dokumententyp + Table mic_ncts_eucdm_port_information, Column documentType, Length 5 + Tabelle mic_ncts_eucdm_port_information, Spalte documentType, Länge 5 + String0..5 + + mic_ncts_eucdm_port_information + documentType + + false + + + + + + + Booking reference + Buchungsreferenz + Table mic_ncts_eucdm_port_information, Column bookingReference, Length 35 + Tabelle mic_ncts_eucdm_port_information, Spalte bookingReference, Länge 35 + String0..35 + + mic_ncts_eucdm_port_information + bookingReference + + false + + + + + + + Port code + Hafencode + Table mic_ncts_eucdm_port_information, Column port, Length 5 + Tabelle mic_ncts_eucdm_port_information, Spalte port, Länge 5 + String0..5 + + mic_ncts_eucdm_port_information + port + + false + + + + + + + Terminal identifier at the port + Terminal-Kennung am Hafen + Table mic_ncts_eucdm_port_information, Column terminal, Length 15 + Tabelle mic_ncts_eucdm_port_information, Spalte terminal, Länge 15 + String0..15 + + mic_ncts_eucdm_port_information + terminal + + false + + + + + + + + + + + + + Type of Location of the Location of Goods + Type of Location of the Location of Goods + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodstypeoflocation, Length 1 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodstypeoflocation, Length 1 + + String0..1 + + mic_ncts_eucdm_transit_declaration_header + locationofgoodstypeoflocation + + false + + + + + + + Qualifier of Identification of the Location of Goods + Qualifier of Identification of the Location of Goods + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodsqualifierofidentification, Length + 1 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodsqualifierofidentification, Length + 1 + + String0..1 + + mic_ncts_eucdm_transit_declaration_header + locationofgoodsqualifierofidentification + + false + + + + + + + Additional Identifier of the Location of Goods + Additional Identifier of the Location of Goods + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodsadditionalidentifier, Length 4 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationofgoodsadditionalidentifier, Length 4 + + String0..4 + + mic_ncts_eucdm_transit_declaration_header + locationofgoodsadditionalidentifier + + false + + + + + + + Location of goods UN LOCODE + Location of goods UN LOCODE + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsUnLocode, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsUnLocode, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsUnLocode + + false + + + + + + + Location of Goods Authorisation Number + Location of Goods Authorisation Number + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsAuthorisationNumber, Length 35 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsAuthorisationNumber, Length 35 + + String0..35 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsAuthorisationNumber + + false + + + + + + + Location of Goods Customs Office + Location of Goods Customs Office + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsCustomsOffice, Length 8 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsCustomsOffice, Length 8 + + String0..8 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsCustomsOffice + + false + + + + + + + Location of goods latitude + Location of goods latitude + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsGnssLatitude, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsGnssLatitude, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsGnssLatitude + + false + + + + + + + Location of goods longitude + Location of goods longitude + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsGnssLongitude, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsGnssLongitude, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsGnssLongitude + + false + + + + + + + Location of goods economic operator identification number + Location of goods economic operator identification number + Table mic_ncts_eucdm_transit_declaration_header, Column + locationOfGoodsEconomicOperatorIdentificationNumber, Length 17 + + Table mic_ncts_eucdm_transit_declaration_header, Column + locationOfGoodsEconomicOperatorIdentificationNumber, Length 17 + + String0..17 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsEconomicOperatorIdentificationNumber + + false + + + + + + + Location of goods address + Ort der Waren Adresse + + + ComplexType + + + + + false + + + + + + + Location of goods post code address + Ort der Waren Postleitzahladresse + + + ComplexType + + + + + false + + + + + + + Contact person information for the location of goods + Kontaktpersoneninformationen für den Warenstandort + + + + + + + + false + + + + + + + Location of goods Address Number + Location of goods Address Number + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsAddressNumber, Length 15 + + Table mic_ncts_eucdm_transit_declaration_header, Column locationOfGoodsAddressNumber, Length 15 + + String0..15 + + mic_ncts_eucdm_transit_declaration_header + locationOfGoodsAddressNumber + + false + + + + + + + + + + + + + Header identifier linking the goods reference to the parent transit declaration + Kopf-Identifikator zur Verknüpfung der Warenreferenz mit der übergeordneten Versandanmeldung + Internal UUID, not stored in database + Interne UUID, nicht in Datenbank gespeichert + String + + + + + false + + + + + + + Sequence Number + Sequenznummer + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference, Column: sequenceNumber + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference, Spalte: sequenceNumber + Integer4 + + mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference + sequenceNumber + 1 + false + + + + + + + Declaration goods item number referenced by the transport equipment + Anmeldepositionsnummer, auf die vom Transportmittel verwiesen wird + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference, Column: transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference, Spalte: transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + Integer4 + + mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference + transportEquipmentGoodsReferenceDeclarationGoodsItemNumber + + false + + + + + + + + + + + + + Incident seal header ID + Vorfall Siegel Kopf-ID + Internal UUID, not stored in database + Interne UUID, nicht in Datenbank gespeichert + String + + + + + false + + + + + + + Sequence Number + Sequenznummer + Table: mic_ncts_eucdm_transit_declaration_incident_seal, Column: sequenceNumber + Tabelle: mic_ncts_eucdm_transit_declaration_incident_seal, Spalte: sequenceNumber + Integer2 + + mic_ncts_eucdm_transit_declaration_incident_seal + sequenceNumber + 1 + false + + + + + + + Unique identifier of the seal involved in the incident + Eindeutige Kennung des am Vorfall beteiligten Siegels + Table: mic_ncts_eucdm_transit_declaration_incident_seal, Column: sealsIdentifier + Tabelle: mic_ncts_eucdm_transit_declaration_incident_seal, Spalte: sealsIdentifier + String20 + + mic_ncts_eucdm_transit_declaration_incident_seal + sealsIdentifier + + false + + + + + + + + + + + + + Incident transport equipment header ID + Vorfall Transportausrüstung Kopf-ID + Internal UUID, not stored in database + Interne UUID, nicht in Datenbank gespeichert + String + + + + + false + + + + + + + Sequence Number + Sequenznummer + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Column: sequenceNumber + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Spalte: sequenceNumber + Integer4 + + mic_ncts_eucdm_transit_declaration_incident_transport_equipment + sequenceNumber + 1 + false + + + + + + + Container identification number + Container-Identifikationsnummer + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Column: containerIdentificationNumber + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Spalte: containerIdentificationNumber + String17 + + mic_ncts_eucdm_transit_declaration_incident_transport_equipment + containerIdentificationNumber + + false + + + + + + + Number of seals on transport equipment involved in the incident + Anzahl der Siegel an der vom Vorfall betroffenen Transportausrüstung + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Column: numberOfSeals + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment, Spalte: numberOfSeals + Integer2 + + mic_ncts_eucdm_transit_declaration_incident_transport_equipment + numberOfSeals + + false + + + + + + + Seals + Verschlüsse + Table: mic_ncts_eucdm_transit_declaration_incident_seal + Tabelle: mic_ncts_eucdm_transit_declaration_incident_seal + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_incident_seal + + + false + + + + + + + Reference to goods items affected by the incident + Verweis auf vom Vorfall betroffene Warenpositionen + Table: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference + Tabelle: mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_incident_transport_equipment_goods_reference + + + false + + + + + + + + + + + + + Transport Equipment + Transport Ausrüstung + Add element only if discrepancies within transport equipments have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei der Transportausrüstung festgestellt wurden + + String + 9999 + mic_ncts_eucdm_transit_declaration_transport_equipment + + + false + + + + + + + Header identifier linking the incident to the parent transit declaration + Kopf-Identifikator zur Verknüpfung des Vorfalls mit der übergeordneten Versandanmeldung + + + + + + + + false + + + + + + + Sequence Number + Sequenznummer + Sequence Number of Transport Equipment having discrepancies + Sequenznummer der Transportausrüstung die Unstimmigkeiten enthält + Decimal + + mic_ncts_eucdm_transit_declaration_transport_equipment + sequenceNumber + 1 + true + + + + + + + Incident notification date and time + Vorfallbenachrichtigung Datum und Uhrzeit + Table mic_ncts_eucdm_transit_declaration_incident, Column incidentNotificationDateAndTime, Type Timestamp + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte incidentNotificationDateAndTime, Typ Timestamp + Timestamp + + mic_ncts_eucdm_transit_declaration_incident + incidentNotificationDateAndTime + + false + + + + + + + Customs office of incident registration + Zollstelle der Vorfallregistrierung + Table mic_ncts_eucdm_transit_declaration_incident, Column customsOfficeOfIncidentRegistration, Length 8 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte customsOfficeOfIncidentRegistration, Länge 8 + String0..8 + + mic_ncts_eucdm_transit_declaration_incident + customsOfficeOfIncidentRegistration + + false + + + + + + + Incident code + Vorfallcode + Table mic_ncts_eucdm_transit_declaration_incident, Column code, Type Integer, Length 1 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte code, Typ Integer, Länge 1 + Integer + + mic_ncts_eucdm_transit_declaration_incident + code + + false + + + + + + + Incident text description + Vorfall Textbeschreibung + Table mic_ncts_eucdm_transit_declaration_incident, Column text, Length 512 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte text, Länge 512 + String0..512 + + mic_ncts_eucdm_transit_declaration_incident + text + + false + + + + + + + Endorsement date + Vermerkdatum + Table mic_ncts_eucdm_transit_declaration_incident, Column endorsementDate, Type Date + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte endorsementDate, Typ Date + Date + + mic_ncts_eucdm_transit_declaration_incident + endorsementDate + + false + + + + + + + Endorsement authority + Vermerkbehörde + Table mic_ncts_eucdm_transit_declaration_incident, Column endorsementAuthority, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte endorsementAuthority, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_incident + endorsementAuthority + + false + + + + + + + Endorsement place + Vermerkort + Table mic_ncts_eucdm_transit_declaration_incident, Column endorsementPlace, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte endorsementPlace, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_incident + endorsementPlace + + false + + + + + + + Endorsement country + Vermerkland + Table mic_ncts_eucdm_transit_declaration_incident, Column endorsementCountry, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte endorsementCountry, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_incident + endorsementCountry + + false + + + + + + + Location qualifier of identification + Standort Kennzeichnungsqualifikator + Table mic_ncts_eucdm_transit_declaration_incident, Column locationQualifierOfIdentification, Length 1 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationQualifierOfIdentification, Länge 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_incident + locationQualifierOfIdentification + + false + + + + + + + Location UN/LOCODE + Standort UN/LOCODE + Table mic_ncts_eucdm_transit_declaration_incident, Column locationUNLocode, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationUNLocode, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_incident + locationUNLocode + + false + + + + + + + Location country + Standort Land + Table mic_ncts_eucdm_transit_declaration_incident, Column locationCountry, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationCountry, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_incident + locationCountry + + false + + + + + + + Location GNSS latitude + Standort GNSS Breitengrad + Table mic_ncts_eucdm_transit_declaration_incident, Column locationGNSSLatitude, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationGNSSLatitude, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_incident + locationGNSSLatitude + + false + + + + + + + Location GNSS longitude + Standort GNSS Längengrad + Table mic_ncts_eucdm_transit_declaration_incident, Column locationGNSSLongitude, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationGNSSLongitude, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_incident + locationGNSSLongitude + + false + + + + + + + Location address street and number + Standort Adresse Straße und Hausnummer + Table mic_ncts_eucdm_transit_declaration_incident, Column locationAddressStreetAndNumber, Length 70 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationAddressStreetAndNumber, Länge 70 + String0..70 + + mic_ncts_eucdm_transit_declaration_incident + locationAddressStreetAndNumber + + false + + + + + + + Location address postcode + Standort Adresse Postleitzahl + Table mic_ncts_eucdm_transit_declaration_incident, Column locationAddressPostcode, Length 17 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationAddressPostcode, Länge 17 + String0..17 + + mic_ncts_eucdm_transit_declaration_incident + locationAddressPostcode + + false + + + + + + + Location address city + Standort Adresse Stadt + Table mic_ncts_eucdm_transit_declaration_incident, Column locationAddressCity, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte locationAddressCity, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_incident + locationAddressCity + + false + + + + + + + Container indicator + Containerindikator + Table mic_ncts_eucdm_transit_declaration_incident, Column containerIndicator, Type Boolean + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte containerIndicator, Typ Boolean + Boolean + + mic_ncts_eucdm_transit_declaration_incident + containerIndicator + + false + + + + + + + Transport means type of identification + Beförderungsmittel Art der Identifizierung + Table mic_ncts_eucdm_transit_declaration_incident, Column transportMeansTypeOfIdentification, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte transportMeansTypeOfIdentification, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_incident + transportMeansTypeOfIdentification + + false + + + + + + + Transport means identification number + Beförderungsmittel Identifikationsnummer + Table mic_ncts_eucdm_transit_declaration_incident, Column transportMeansIdentificationNumber, Length 35 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte transportMeansIdentificationNumber, Länge 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_incident + transportMeansIdentificationNumber + + false + + + + + + + Transport means nationality + Beförderungsmittel Nationalität + Table mic_ncts_eucdm_transit_declaration_incident, Column transportMeansNationality, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_incident, Spalte transportMeansNationality, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_incident + transportMeansNationality + + false + + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_packaging, Column sequenceNumber, Precision 2 + Tabelle mic_ncts_eucdm_transit_declaration_packaging, Spalte sequenceNumber, Präzision 2 + Integer + + mic_ncts_eucdm_transit_declaration_packaging + sequenceNumber + 1 + true + + + + + + + Type of packages + Packstücksart + Table mic_ncts_eucdm_transit_declaration_packaging, Column typeOfPackages, Length 2 + Tabelle mic_ncts_eucdm_transit_declaration_packaging, Spalte typeOfPackages, Länge 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_packaging + typeOfPackages + CT + false + + + + + + + Number of packages + Anzahl der Packstücke + Table mic_ncts_eucdm_transit_declaration_packaging, Column numberOfPackages, Precision 8 + Tabelle mic_ncts_eucdm_transit_declaration_packaging, Spalte numberOfPackages, Präzision 8 + Integer + + mic_ncts_eucdm_transit_declaration_packaging + numberOfPackages + 10 + false + + + + + + + Shipping marks + Packstückszeichen + Table mic_ncts_eucdm_transit_declaration_packaging, Column shippingMarks, Length 512 + Tabelle mic_ncts_eucdm_transit_declaration_packaging, Spalte shippingMarks, Länge 512 + String0..512 + + mic_ncts_eucdm_transit_declaration_packaging + shippingMarks + + false + + + + + + + + + + + + + Sequence Number + Sequenznummer + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column sequenceNumber, Precision 4 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column sequenceNumber, Precision 4 + Integer + + mic_ncts_eucdm_transit_declaration_consignment_item + sequenceNumber + 1 + false + + + + + + + Goods Item Number + Positionsnummer + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column goodsItemNumber, Precision 4 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column goodsItemNumber, Precision 4 + Integer + + mic_ncts_eucdm_transit_declaration_consignment_item + goodsItemNumber + + false + + + + + + + Declaration goods item number + Warenposition Anmeldungsnummer + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column declarationGoodsItemNumber, Precision 5 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column declarationGoodsItemNumber, Precision 5 + Integer + + mic_ncts_eucdm_transit_declaration_consignment_item + declarationGoodsItemNumber + + false + + + + + + + Declaration type + Anmeldungsart + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column declarationType, Length 5 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column declarationType, Length 5 + String0..5 + + mic_ncts_eucdm_transit_declaration_consignment_item + declarationType + + false + + + + + + + Part number + Teilnummer + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column partNumber, Length 30 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column partNumber, Length 30 + String0..30 + + mic_ncts_eucdm_transit_declaration_consignment_item + partNumber + + false + + + + + + + Description of goods + Warenbeschreibung + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column descriptionOfGoods, Length 512 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column descriptionOfGoods, Length 512 + String0..512 + + mic_ncts_eucdm_transit_declaration_consignment_item + descriptionOfGoods + + false + + + + + + + CUS code + CUS-Code + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column cusCode, Length 9 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column cusCode, Length 9 + String0..9 + + mic_ncts_eucdm_transit_declaration_consignment_item + cusCode + + false + + + + + + + Commodity code + Warenkode + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column commodityCode, Length 8 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column commodityCode, Length 8 + String0..8 + + mic_ncts_eucdm_transit_declaration_consignment_item + commodityCode + + false + + + + + + + Gross mass + Rohmasse + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column grossMass, Precision 22 Scale 6 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column grossMass, Precision 22 Scale 6 + Decimal22,6 + + mic_ncts_eucdm_transit_declaration_consignment_item + grossMass + + false + + + + + + + Net mass + Eigenmasse + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column netMass, Precision 22 Scale 6 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column netMass, Precision 22 Scale 6 + Decimal22,6 + + mic_ncts_eucdm_transit_declaration_consignment_item + netMass + + false + + + + + + + Country of dispatch + Versendungsland + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column countryOfDispatch, Length 2 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column countryOfDispatch, Length 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_consignment_item + countryOfDispatch + + false + + + + + + + Country of destination + Bestimmungsland + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column countryOfDestination, Length 2 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column countryOfDestination, Length 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_consignment_item + countryOfDestination + + false + + + + + + + Reference Number / UCR + Referenznummer / UCR + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column referenceNumberUniqueConsignmentReference, Length 35 + Table mic_ncts_eucdm_transit_declaration_consignment_item, Column referenceNumberUniqueConsignmentReference, Length 35 + String0..35 + + mic_ncts_eucdm_transit_declaration_consignment_item + referenceNumberUniqueConsignmentReference + ReferenceNumber + false + + + + + + + Consignment Item Packages + Einzelsendungposition Packstücke + Add element only if discrepancies within a Consignment Item Package have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei einem Einzelsendungposition Packstück festgestellt + wurden + + + 99 + mic_ncts_eucdm_transit_declaration_package + + + false + + + + + + + Dangerous goods of consignment + Dangerous goods of consignment + Table: mic_ncts_eucdm_dangerous_goods_of_consignment + Tabelle: mic_ncts_eucdm_dangerous_goods_of_consignment + ComplexType + 99 + mic_ncts_eucdm_dangerous_goods_of_consignment + + + false + + + + + + + Consignee + Empfänger + + + ComplexType + + + + + false + + + + + + + Supplementary units + Supplementary units + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: supplementaryUnits + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: supplementaryUnits + Decimal22,6 + + mic_ncts_eucdm_transit_declaration_consignment_item + supplementaryUnits + + false + + + + + + + Statistical value + Statistical value + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: statisticalValue + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: statisticalValue + Decimal17,4 + + mic_ncts_eucdm_transit_declaration_consignment_item + statisticalValue + + false + + + + + + + Statistical quantity + Statistical quantity + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: statisticalQuantity + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: statisticalQuantity + Decimal13,3 + + mic_ncts_eucdm_transit_declaration_consignment_item + statisticalQuantity + + false + + + + + + + Foreign statistical value + Foreign statistical value + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: foreignStatisticalValue + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: foreignStatisticalValue + Decimal17,4 + + mic_ncts_eucdm_transit_declaration_consignment_item + foreignStatisticalValue + + false + + + + + + + Foreign currency + Foreign currency + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: foreignCurrency + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: foreignCurrency + String3 + + mic_ncts_eucdm_transit_declaration_consignment_item + foreignCurrency + + false + + + + + + + Method of payment + Method of payment + Table: mic_ncts_eucdm_transit_declaration_consignment_item, Column: methodOfPayment + Tabelle: mic_ncts_eucdm_transit_declaration_consignment_item, Spalte: methodOfPayment + String1 + + mic_ncts_eucdm_transit_declaration_consignment_item + methodOfPayment + + false + + + + + + + Previous documents related to this consignment item + Vorherige Dokumente zu dieser Einzelsendung + Table: mic_ncts_eucdm_item_previous_document + Tabelle: mic_ncts_eucdm_item_previous_document + ComplexType + 99 + mic_ncts_eucdm_item_previous_document + + + false + + + + + + + Supporting Documents + Vorlegbare Unterlagen + Add element only if discrepancies within Supporting Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Vorlegbare Unterlagen festgestellt wurden + + + 99 + mic_ncts_eucdm_transit_declaration_supporting_document + + + false + + + + + + + Transport Documents + Transportdokumente + Add element only if discrepancies within Transport Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Transportdokumenten festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_transport_document + + + false + + + + + + + Additional information + Additional information + Table: mic_ncts_eucdm_additional_information + Tabelle: mic_ncts_eucdm_additional_information + ComplexType + 99 + mic_ncts_eucdm_additional_information + + + false + + + + + + + Additional actors involved in the supply chain (e.g., manufacturer, importer) + Zusätzliche Beteiligte in der Lieferkette (z.B. Hersteller, Importeur) + Table: mic_ncts_eucdm_item_additional_supply_chain_actor + Tabelle: mic_ncts_eucdm_item_additional_supply_chain_actor + ComplexType + 99 + mic_ncts_eucdm_item_additional_supply_chain_actor + + + false + + + + + + + Additional References + Sonstige Verweise + Add element only if discrepancies within Additional References have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Sonstigen Verweisen festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_additional_reference + + + false + + + + + + + Custom fields for customer-specific data on consignment item level + Kundenfelder für kundenspezifische Daten auf Einzelsendungsebene + + + + + + + + false + + + + + + + + + + + Sequence Number + Sequenznummer + Table: mic_ncts_eucdm_transit_declaration_house_consignment, Column: sequenceNumber + Tabelle: mic_ncts_eucdm_transit_declaration_house_consignment, Spalte: sequenceNumber + Integer4 + + mic_ncts_eucdm_transit_declaration_house_consignment + sequenceNumber + 1 + false + + + + + + + Country of dispatch + Versandland + Table: mic_ncts_eucdm_transit_declaration_house_consignment, Column: countryOfDispatch + Tabelle: mic_ncts_eucdm_transit_declaration_house_consignment, Spalte: countryOfDispatch + String2 + + mic_ncts_eucdm_transit_declaration_house_consignment + countryOfDispatch + + false + + + + + + + Country of destination + Bestimmungsland + Table: mic_ncts_eucdm_transit_declaration_house_consignment, Column: countryOfDestination + Tabelle: mic_ncts_eucdm_transit_declaration_house_consignment, Spalte: countryOfDestination + String2 + + mic_ncts_eucdm_transit_declaration_house_consignment + countryOfDestination + + false + + + + + + + Gross mass (weight) of the goods in kilograms + Rohmasse (Gewicht) der Waren in Kilogramm + Table: mic_ncts_eucdm_transit_declaration_house_consignment, Column: grossMass + Tabelle: mic_ncts_eucdm_transit_declaration_house_consignment, Spalte: grossMass + Decimal22,6 + + mic_ncts_eucdm_transit_declaration_house_consignment + grossMass + + false + + + + + + + Reference Number / UCR + Referenznummer / UCR + Table: mic_ncts_eucdm_transit_declaration_house_consignment, Column: referenceNumberUniqueConsignmentReference + Tabelle: mic_ncts_eucdm_transit_declaration_house_consignment, Spalte: referenceNumberUniqueConsignmentReference + String35 + + mic_ncts_eucdm_transit_declaration_house_consignment + referenceNumberUniqueConsignmentReference + ReferenceNumber + false + + + + + + + Consignor + Versender + Embedded in mic_ncts_eucdm_transit_declaration_house_consignment with prefix consignor + Eingebettet in mic_ncts_eucdm_transit_declaration_house_consignment mit Präfix consignor + ComplexType + + mic_ncts_eucdm_transit_declaration_house_consignment + consignor* + + false + + + + + + + Consignee + Empfänger + Embedded in mic_ncts_eucdm_transit_declaration_house_consignment with prefix consignee + Eingebettet in mic_ncts_eucdm_transit_declaration_house_consignment mit Präfix consignee + ComplexType + + mic_ncts_eucdm_transit_declaration_house_consignment + consignee* + + false + + + + + + + Method of payment code for transport charges + Zahlungsart-Code für Beförderungskosten + Table mic_ncts_eucdm_transit_declaration_house_consignment, Column methodOfPayment, Length 1 + Tabelle mic_ncts_eucdm_transit_declaration_house_consignment, Spalte methodOfPayment, Länge 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_house_consignment + methodOfPayment + + false + + + + + + + Previous documents related to this house consignment + Vorherige Dokumente zu dieser Teilsendung + Table: mic_ncts_eucdm_transit_declaration_previous_document + Tabelle: mic_ncts_eucdm_transit_declaration_previous_document + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_previous_document + + + false + + + + + + + Supporting Documents + Vorlegbare Unterlagen + Add element only if discrepancies within Supporting Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Vorlegbare Unterlagen festgestellt wurden + + + 99 + mic_ncts_eucdm_transit_declaration_supporting_document + + + false + + + + + + + Transport Documents + Transportdokumente + Add element only if discrepancies within Transport Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Transportdokumenten festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_transport_document + + + false + + + + + + + Additional References + Sonstige Verweise + Add element only if discrepancies within Additional References have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Sonstigen Verweisen festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_additional_reference + + + false + + + + + + + Additional information + Additional information + Table: mic_ncts_eucdm_additional_information + Tabelle: mic_ncts_eucdm_additional_information + ComplexType + 99 + mic_ncts_eucdm_additional_information + + + false + + + + + + + Additional supply chain actor + Additional supply chain actor + Table: mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + Tabelle: mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_additional_supply_chain_actor + + + false + + + + + + + Custom fields for customer-specific data on house consignment level + Kundenfelder für kundenspezifische Daten auf Teilsendungsebene + + + + + + + + false + + + + + + + Consignment Item + Einzelsendungsposition + Add element only if discrepancies within a Consignment Item have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei einer Einzelsendungsposition festgestellt wurden + + ComplexType + 999 + mic_ncts_eucdm_transit_declaration_consignment_item + + + false + + + + + + + + + + + + + Country of dispatch + Country of dispatch + Table mic_ncts_eucdm_transit_declaration_header, Column countryofdispatch, Length 2 + Table mic_ncts_eucdm_transit_declaration_header, Column countryofdispatch, Length 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_header + countryofdispatch + + false + + + + + + + Country of destination + Country of destination + Table mic_ncts_eucdm_transit_declaration_header, Column countryofdestination, Length 2 + Table mic_ncts_eucdm_transit_declaration_header, Column countryofdestination, Length 2 + String0..2 + + mic_ncts_eucdm_transit_declaration_header + countryofdestination + + false + + + + + + + Container indicator + Container indicator + Table mic_ncts_eucdm_transit_declaration_header, Column containerindicator, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column containerindicator, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + containerindicator + + false + + + + + + + Inland mode of transport + Inland mode of transport + Table mic_ncts_eucdm_transit_declaration_header, Column inlandmodeoftransport, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column inlandmodeoftransport, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + inlandmodeoftransport + + false + + + + + + + Mode of transport at the border + Mode of transport at the border + Table mic_ncts_eucdm_transit_declaration_header, Column modeoftransportattheborder, Length 1 + + Table mic_ncts_eucdm_transit_declaration_header, Column modeoftransportattheborder, Length 1 + + String0..1 + + mic_ncts_eucdm_transit_declaration_header + modeoftransportattheborder + + false + + + + + + + Consignment Gross Mass + Consignment Gross Mass + Table mic_ncts_eucdm_transit_declaration_header, Column consignmentgrossmass, Precision 22, Scale 6 + + Table mic_ncts_eucdm_transit_declaration_header, Column consignmentgrossmass, Precision 22, Scale 6 + + Number(22,6) + + mic_ncts_eucdm_transit_declaration_header + consignmentgrossmass + + false + + + + + + + Reference Number / UCR + Referenznummer / UCR + This fields can be used for unique identification + Dieses Feld kann zur eindeutigen Identifikation verwendet werden + String0..25 + + mic_ncts_eucdm_transit_declaration_header + referenceNumberUniqueConsignmentReference + ReferenceNumber + false + + + + + + + Place of unloading + Place of unloading + + + ComplexType + + + + + false + + + + + + + Location of goods + Location of goods + + + ComplexType + + + + + false + + + + + + + Physical location where goods are available for customs inspection + Physischer Standort, an dem die Waren für die Zollkontrolle verfügbar sind + + + + + + + + false + + + + + + + Transport Equipment + Transport Ausrüstung + Add element only if discrepancies within transport equipments have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei der Transportausrüstung festgestellt wurden + + + 9999 + mic_ncts_eucdm_transit_declaration_transport_equipment + + + false + + + + + + + Departure Transport Means + Beförderungsmittel beim Abgang + Add element only if discrepancies within Departure Transport Means have been observed + Element nur hinzufügen, wenn Unstimmigkeiten beim Beförderungsmittel beim Abgang festgestellt wurden + + ComplexType + 999 + mic_ncts_eucdm_transit_declaration_departure_transport_means + + + false + + + + + + + Customs office of transit declared + Customs office of transit declared + + + ComplexType + unbounded + + + + false + + + + + + + Country of routing of consignment + Country of routing of consignment + + + ComplexType + unbounded + + + + false + + + + + + + Previous document + Previous document + + + ComplexType + unbounded + + + + false + + + + + + + Carrier + Beförderer + + + ComplexType + + + + + false + + + + + + + Consignor + Versender + + + ComplexType + + + + + false + + + + + + + Consignee (recipient) of the goods + Empfänger der Waren + + + + + + + + false + + + + + + + Previous documents related to the transit declaration header + Vorherige Dokumente zur Versandanmeldung + + + + + + + + false + + + + + + + Supporting Documents + Vorlegbare Unterlagen + Add element only if discrepancies within Supporting Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Vorlegbare Unterlagen festgestellt wurden + + + 99 + mic_ncts_eucdm_transit_declaration_supporting_document + + + false + + + + + + + Transport Documents + Transportdokumente + Add element only if discrepancies within Transport Documents have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Transportdokumenten festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_transport_document + + + false + + + + + + + Additional information codes and text related to the transit declaration + Zusätzliche Informationscodes und Text zur Versandanmeldung + + + + + + + + false + + + + + + + Additional References + Sonstige Verweise + Add element only if discrepancies within Additional References have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei den Sonstigen Verweisen festgestellt wurden + + ComplexType + 99 + mic_ncts_eucdm_transit_declaration_additional_reference + + + false + + + + + + + Incident + Incident + + + ComplexType + unbounded + + + + false + + + + + + + Partner + Partner + + + ComplexType + unbounded + + + + false + + + + + + + Customer fields + Customer fields + + + ComplexType + + + + + false + + + + + + + Method of Payment + Method of Payment + Table mic_ncts_eucdm_transit_declaration_header, Column methodOfPayment, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column methodOfPayment, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + methodOfPayment + + false + + + + + + + Custom fields for customer-specific data on header level + Kundenfelder für kundenspezifische Daten auf Kopfebene + + + + + + + + false + + + + + + + Indicator if transit declaration is closed or not + Indicator if transit declaration is closed or not + Table mic_ncts_eucdm_transit_declaration_header, Column closed, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column closed, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + closed + + false + + + + + + + Worklist + Worklist + Table mic_ncts_eucdm_transit_declaration_header, Column worklist, Length 50 + Table mic_ncts_eucdm_transit_declaration_header, Column worklist, Length 50 + String0..50 + + mic_ncts_eucdm_transit_declaration_header + worklist + + false + + + + + + + Port, terminal and booking information for maritime transport + Hafen-, Terminal- und Buchungsinformationen für Seetransport + + + + + + + + false + + + + + + + House Consignment + Einzelsendung + Add element only if discrepancies within a House Consignment have been observed + Element nur hinzufügen, wenn Unstimmigkeiten bei einer Einzelsendung festgestellt wurden + + + 1999 + mic_ncts_eucdm_transit_declaration_house_consignment + + + false + + + + + + + + + + + + Company + Mandant + + + String2..2 + + mic_ncts_eucdm_transit_declaration_header + company + IN + true + afsMandant + company + + + + + + + Plant + Werk + + + String2..2 + + mic_ncts_eucdm_transit_declaration_header + plant + IT + true + + + + + + + Local Reference Number + Local Reference Number + Table mic_ncts_eucdm_transit_declaration_header, Column localreferencenumber, Length 22 + Table mic_ncts_eucdm_transit_declaration_header, Column localreferencenumber, Length 22 + String0..22 + + mic_ncts_eucdm_transit_declaration_header + localreferencenumber + + false + + + + + + + Reference Number / UCR + Referenznummer / UCR + This fields can be used for unique identification + Dieses Feld kann zur eindeutigen Identifikation verwendet werden + String0..25 + + mic_ncts_eucdm_transit_declaration_header + referenceNumberUniqueConsignmentReference + ReferenceNumber + false + + + + + + + Template name + Template name + Table mic_ncts_eucdm_transit_declaration_header, Column templatename, Length 22 + Table mic_ncts_eucdm_transit_declaration_header, Column templatename, Length 22 + String0..22 + + mic_ncts_eucdm_transit_declaration_header + templatename + + false + + + + + + + Template created for + Template created for + Table mic_ncts_eucdm_transit_declaration_header, Column createdFor, Length 10 + Table mic_ncts_eucdm_transit_declaration_header, Column createdFor, Length 10 + String0..10 + + mic_ncts_eucdm_transit_declaration_header + createdFor + + false + + + + + + + Checked if record is a template + Checked if record is a template + Table mic_ncts_eucdm_transit_declaration_header, Column useAsTemplate, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column useAsTemplate, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + useAsTemplate + + false + + + + + + + Declaration type + Declaration type + Table mic_ncts_eucdm_transit_declaration_header, Column declarationtype, Length 5 + Table mic_ncts_eucdm_transit_declaration_header, Column declarationtype, Length 5 + String0..5 + + mic_ncts_eucdm_transit_declaration_header + declarationtype + + false + + + + + + + Transit declaration type + Transit declaration type + DE specific + DE spezifisch + String0..2 + + mic_ncts_eucdm_transit_declaration_header + transitdeclarationtype + + false + + + + + + + Additional Declaration Type + Additional Declaration Type + Table mic_ncts_eucdm_transit_declaration_header, Column additionalDeclarationType, Length 1 + + Table mic_ncts_eucdm_transit_declaration_header, Column additionalDeclarationType, Length 1 + + String0..1 + + mic_ncts_eucdm_transit_declaration_header + additionalDeclarationType + + false + + + + + + + Month + Month + Table mic_ncts_eucdm_transit_declaration_header, Column month, Length 6 + Table mic_ncts_eucdm_transit_declaration_header, Column month, Length 6 + String0..6 + + mic_ncts_eucdm_transit_declaration_header + month + + false + + + + + + + Declaration Date + Declaration Date + Table mic_ncts_eucdm_transit_declaration_header, Column declarationDate + Table mic_ncts_eucdm_transit_declaration_header, Column declarationDate + Date + + mic_ncts_eucdm_transit_declaration_header + declarationDate + + false + + + + + + + Limit date + Limit date + Table mic_ncts_eucdm_transit_declaration_header, Column limitdate + Table mic_ncts_eucdm_transit_declaration_header, Column limitdate + Date + + mic_ncts_eucdm_transit_declaration_header + limitdate + + false + + + + + + + Security + Security + Table mic_ncts_eucdm_transit_declaration_header, Column security, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column security, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + security + + false + + + + + + + Reduced dataset indicator + Reduced dataset indicator + Table mic_ncts_eucdm_transit_declaration_header, Column reduceddatasetindicator, Length 1 + + Table mic_ncts_eucdm_transit_declaration_header, Column reduceddatasetindicator, Length 1 + + String0..1 + + mic_ncts_eucdm_transit_declaration_header + reduceddatasetindicator + + false + + + + + + + Specific circumstance indicator + Specific circumstance indicator + Table mic_ncts_eucdm_transit_declaration_header, Column specificcircumstanceindicator, Length 3 + + Table mic_ncts_eucdm_transit_declaration_header, Column specificcircumstanceindicator, Length 3 + + String0..3 + + mic_ncts_eucdm_transit_declaration_header + specificcircumstanceindicator + + false + + + + + + + Binding itinerary + Binding itinerary + Table mic_ncts_eucdm_transit_declaration_header, Column bindingitinerary, Length 1 + Table mic_ncts_eucdm_transit_declaration_header, Column bindingitinerary, Length 1 + String0..1 + + mic_ncts_eucdm_transit_declaration_header + bindingitinerary + + false + + + + + + + Reference Number of the Customs Office of Departure + Reference Number of the Customs Office of Departure + Table mic_ncts_eucdm_transit_declaration_header, Column customsOfficeOfDeparture, Length 8 + + Table mic_ncts_eucdm_transit_declaration_header, Column customsOfficeOfDeparture, Length 8 + + String0..8 + + mic_ncts_eucdm_transit_declaration_header + customsOfficeOfDeparture + + false + + + + + + + Reference Number of the Customs Office of Destination Declared + Reference Number of the Customs Office of Destination Declared + Table mic_ncts_eucdm_transit_declaration_header, Column customsOfficeOfDestinationDeclared, Length 8 + + Table mic_ncts_eucdm_transit_declaration_header, Column customsOfficeOfDestinationDeclared, Length 8 + + String0..8 + + mic_ncts_eucdm_transit_declaration_header + customsOfficeOfDestinationDeclared + + false + + + + + + + TIR Carnet number + TIR Carnet number + Table mic_ncts_eucdm_transit_declaration_header, Column tircarnetnumber, Length 12 + Table mic_ncts_eucdm_transit_declaration_header, Column tircarnetnumber, Length 12 + String0..12 + + mic_ncts_eucdm_transit_declaration_header + tircarnetnumber + + false + + + + + + + Signing Information + Signiert von + This field can be used to define a standard user for signing + Dieses Feld kann verwendet werden um einen Standard User fürs Signieren zu definieren + false + String0..30 + + mic_ncts_eucdm_transit_declaration_header + signingInformation + TestUser + + + + + + + + + + + + + Holder of the Transit Procedure + Inhaber des Versandverfahrens + Table mic_ncts_eucdm_transit_declaration_header, Column prefix holderOfTheTransitProcedure + Table mic_ncts_eucdm_transit_declaration_header, Column prefix holderOfTheTransitProcedure + ComplexType + + mic_ncts_eucdm_transit_declaration_header + holderOfTheTransitProcedure + + false + + + + + + + Representative + Vertreter + Table mic_ncts_eucdm_transit_declaration_header, Column prefix representative + Table mic_ncts_eucdm_transit_declaration_header, Column prefix representative + ComplexType + + mic_ncts_eucdm_transit_declaration_header + representative + + false + + + + + + + Authorisation + Berechtigung + Table mic_ncts_eucdm_transit_declaration_authorisation + Table mic_ncts_eucdm_transit_declaration_authorisation + ComplexType + unbounded + mic_ncts_eucdm_transit_declaration_authorisation + + + false + + + + + + + Guarantee + Sicherheit + Table mic_ncts_eucdm_transit_declaration_guarantee + Table mic_ncts_eucdm_transit_declaration_guarantee + ComplexType + unbounded + mic_ncts_eucdm_transit_declaration_guarantee + + + false + + + + + + + Consignment + Sammelsendung + Container element - data stored in child elements (houseConsignment, etc.) + Container Element - Daten in untergeordneten Elementen gespeichert (houseConsignment, etc.) + ComplexType + 1 + + + + true + + + + + + + + \ No newline at end of file diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.Designer.vb deleted file mode 100644 index 5c24160a..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportBasicTypes.Designer.vb +++ /dev/null @@ -1,71 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustExportBasicTypesListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustExportBasicTypes - - Public Enum ShipmentType - - ''' - E - - ''' - B - - ''' - I - - ''' - X - - ''' - N - End Enum - - Public Enum ContainerCode - - ''' - - Item1 - - ''' - - Item0 - End Enum - - Public Enum PartnerTyp - - ''' - EX - - ''' - DT - - ''' - AE - - ''' - EV - End Enum - - Public Enum AddCostsSplitType - - ''' - V - - ''' - Q - End Enum -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.Designer.vb deleted file mode 100644 index 7eceaf8a..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportComponents.Designer.vb +++ /dev/null @@ -1,9054 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustExportComponentsListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustExportComponents - - Partial Public Class TItem - - Private itemNoField As String - - Private itemDescField As String - - Private commCodeField As String - - Private prodGrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property itemNo() As String - Get - Return Me.itemNoField - End Get - Set - Me.itemNoField = Value - End Set - End Property - - Public Property itemDesc() As String - Get - Return Me.itemDescField - End Get - Set - Me.itemDescField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property prodGr() As String - Get - Return Me.prodGrField - End Get - Set - Me.prodGrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrVatIdField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrVatId() As String - Get - Return Me.addrVatIdField - End Get - Set - Me.addrVatIdField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContactPerson - - Private jobField As String - - Private nameField As String - - Private emailField As String - - Private phoneField As String - - Private faxField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property job() As String - Get - Return Me.jobField - End Get - Set - Me.jobField = Value - End Set - End Property - - Public Property name() As String - Get - Return Me.nameField - End Get - Set - Me.nameField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property phone() As String - Get - Return Me.phoneField - End Get - Set - Me.phoneField = Value - End Set - End Property - - Public Property fax() As String - Get - Return Me.faxField - End Get - Set - Me.faxField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContactPerson)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContactPerson object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContactPerson object - ''' - '''string workflow markup to deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContactPerson) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContactPerson - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContactPerson) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomsOffice - - Private codeOffField As String - - Private offCtryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property codeOff() As String - Get - Return Me.codeOffField - End Get - Set - Me.codeOffField = Value - End Set - End Property - - Public Property offCtry() As String - Get - Return Me.offCtryField - End Get - Set - Me.offCtryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomsOffice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomsOffice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomsOffice object - ''' - '''string workflow markup to deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomsOffice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomsOffice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomsOffice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMotInl - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotInl)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMotInl object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMotInl object - ''' - '''string workflow markup to deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMotInl) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotInl - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotInl) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreight - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private noneuField As Decimal - - Private noneuFieldSpecified As Boolean - - Private eunatField As Decimal - - Private eunatFieldSpecified As Boolean - - Private natField As Decimal - - Private natFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property noneu() As Decimal - Get - Return Me.noneuField - End Get - Set - Me.noneuField = Value - End Set - End Property - - - Public Property noneuSpecified() As Boolean - Get - Return Me.noneuFieldSpecified - End Get - Set - Me.noneuFieldSpecified = Value - End Set - End Property - - Public Property eunat() As Decimal - Get - Return Me.eunatField - End Get - Set - Me.eunatField = Value - End Set - End Property - - - Public Property eunatSpecified() As Boolean - Get - Return Me.eunatFieldSpecified - End Get - Set - Me.eunatFieldSpecified = Value - End Set - End Property - - Public Property nat() As Decimal - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - - Public Property natSpecified() As Boolean - Get - Return Me.natFieldSpecified - End Get - Set - Me.natFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreight)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreight object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreight object - ''' - '''string workflow markup to deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreight) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreight - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreight) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAssurance - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAssurance)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAssurance object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAssurance object - ''' - '''string workflow markup to deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAssurance) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAssurance - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAssurance) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private typeField As String - - Private flagField As TAddCostsFlag - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property flag() As TAddCostsFlag - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TAddCostsFlag - - ''' - P - - ''' - V - End Enum - - Partial Public Class TAddCostsShipment - - Private currField As String - - Private amountField As Decimal - - Private flagField As TAddCostsShipmentFlag - - Private typeField As String - - Private splitFlagField As AddCostsSplitType - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property flag() As TAddCostsShipmentFlag - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property splitFlag() As AddCostsSplitType - Get - Return Me.splitFlagField - End Get - Set - Me.splitFlagField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCostsShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCostsShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCostsShipment object - ''' - '''string workflow markup to deserialize - '''Output TAddCostsShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCostsShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCostsShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAddCostsShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAddCostsShipment object - ''' - '''string xml file to load and deserialize - '''Output TAddCostsShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsShipment) - 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 TAddCostsShipment) 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 TAddCostsShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TAddCostsShipmentFlag - - ''' - P - - ''' - V - End Enum - - Public Enum AddCostsSplitType - - ''' - V - - ''' - Q - End Enum - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelNote - - Private delNoField As String - - Private positionField As Long - - Private positionFieldSpecified As Boolean - - Private delDateField As Date - - Private delDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property delNo() As String - Get - Return Me.delNoField - End Get - Set - Me.delNoField = Value - End Set - End Property - - Public Property position() As Long - Get - Return Me.positionField - End Get - Set - Me.positionField = Value - End Set - End Property - - - Public Property positionSpecified() As Boolean - Get - Return Me.positionFieldSpecified - End Get - Set - Me.positionFieldSpecified = Value - End Set - End Property - - Public Property delDate() As Date - Get - Return Me.delDateField - End Get - Set - Me.delDateField = Value - End Set - End Property - - - Public Property delDateSpecified() As Boolean - Get - Return Me.delDateFieldSpecified - End Get - Set - Me.delDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelNote)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelNote object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelNote object - ''' - '''string workflow markup to deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelNote) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelNote - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelNote) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOrder - - Private ordNoField As String - - Private ordDateField As Date - - Private ordDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ordNo() As String - Get - Return Me.ordNoField - End Get - Set - Me.ordNoField = Value - End Set - End Property - - Public Property ordDate() As Date - Get - Return Me.ordDateField - End Get - Set - Me.ordDateField = Value - End Set - End Property - - - Public Property ordDateSpecified() As Boolean - Get - Return Me.ordDateFieldSpecified - End Get - Set - Me.ordDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOrder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOrder object - ''' - '''string workflow markup to deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBomNo - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBomNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBomNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBomNo object - ''' - '''string workflow markup to deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBomNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBomNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBomNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attribTypeField As String - - Private attribTextField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attribType() As String - Get - Return Me.attribTypeField - End Get - Set - Me.attribTypeField = Value - End Set - End Property - - Public Property attribText() As String - Get - Return Me.attribTextField - End Get - Set - Me.attribTextField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypField As String - - Private partnerAddressField As TPartnerPartnerAddress - - Private partnerRelationField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TPartnerPartnerAddress() - End Sub - - Public Property partnerTyp() As String - Get - Return Me.partnerTypField - End Get - Set - Me.partnerTypField = Value - End Set - End Property - - Public Property partnerAddress() As TPartnerPartnerAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartnerPartnerAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrStreet2Field As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private addrInfoField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrStreet2() As String - Get - Return Me.addrStreet2Field - End Get - Set - Me.addrStreet2Field = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property addrInfo() As String - Get - Return Me.addrInfoField - End Get - Set - Me.addrInfoField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartnerPartnerAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartnerPartnerAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartnerPartnerAddress object - ''' - '''string workflow markup to deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartnerPartnerAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartnerPartnerAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartnerPartnerAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private type3Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Public Property type3() As String - Get - Return Me.type3Field - End Get - Set - Me.type3Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TLocationOfGoods - - Private codeField As String - - Private streetField As String - - Private zipField As String - - Private locField As String - - Private additField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property street() As String - Get - Return Me.streetField - End Get - Set - Me.streetField = Value - End Set - End Property - - Public Property zip() As String - Get - Return Me.zipField - End Get - Set - Me.zipField = Value - End Set - End Property - - Public Property loc() As String - Get - Return Me.locField - End Get - Set - Me.locField = Value - End Set - End Property - - Public Property addit() As String - Get - Return Me.additField - End Get - Set - Me.additField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLocationOfGoods)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TLocationOfGoods object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TLocationOfGoods object - ''' - '''string workflow markup to deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TLocationOfGoods) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TLocationOfGoods - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLocationOfGoods) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportQuantity - - Private qualifierField As String - - Private unitField As String - - Private valueField As Decimal - - Private valueFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property qualifier() As String - Get - Return Me.qualifierField - End Get - Set - Me.qualifierField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - - Public Property valueSpecified() As Boolean - Get - Return Me.valueFieldSpecified - End Get - Set - Me.valueFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportQuantity)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportQuantity object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportQuantity object - ''' - '''string workflow markup to deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportQuantity) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportQuantity - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportQuantity) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportReference - - Private typeField As String - - Private authNrField As String - - Private impShpNrField As String - - Private lineNoField As String - - Private authRegistryNoField As String - - Private commCodeField As String - - Private usualTreatmentField As String - - Private importAtlasField As String - - Private addInfoField As String - - Private quantityField As TImportQuantity - - Private tradeQuantityField As TImportQuantity - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tradeQuantityField = New TImportQuantity() - Me.quantityField = New TImportQuantity() - End Sub - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property authNr() As String - Get - Return Me.authNrField - End Get - Set - Me.authNrField = Value - End Set - End Property - - Public Property impShpNr() As String - Get - Return Me.impShpNrField - End Get - Set - Me.impShpNrField = Value - End Set - End Property - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property authRegistryNo() As String - Get - Return Me.authRegistryNoField - End Get - Set - Me.authRegistryNoField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property usualTreatment() As String - Get - Return Me.usualTreatmentField - End Get - Set - Me.usualTreatmentField = Value - End Set - End Property - - Public Property importAtlas() As String - Get - Return Me.importAtlasField - End Get - Set - Me.importAtlasField = Value - End Set - End Property - - Public Property addInfo() As String - Get - Return Me.addInfoField - End Get - Set - Me.addInfoField = Value - End Set - End Property - - Public Property quantity() As TImportQuantity - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property tradeQuantity() As TImportQuantity - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportReference object - ''' - '''string workflow markup to deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRoute - - Private countryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property country() As String - Get - Return Me.countryField - End Get - Set - Me.countryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRoute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRoute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRoute object - ''' - '''string workflow markup to deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRoute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRoute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRoute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMotArrivalDispatch - - Private motField As String - - Private natField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotArrivalDispatch)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMotArrivalDispatch object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMotArrivalDispatch object - ''' - '''string workflow markup to deserialize - '''Output TMotArrivalDispatch object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotArrivalDispatch, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMotArrivalDispatch) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotArrivalDispatch) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotArrivalDispatch - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotArrivalDispatch) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMotArrivalDispatch 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMotArrivalDispatch object - ''' - '''string xml file to load and deserialize - '''Output TMotArrivalDispatch object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMotArrivalDispatch, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMotArrivalDispatch) - 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 TMotArrivalDispatch) 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 TMotArrivalDispatch - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTermArrival - - Private codeField As String - - Private code2Field As String - - Private descField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTermArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTermArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTermArrival object - ''' - '''string workflow markup to deserialize - '''Output TDelTermArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTermArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTermArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTermArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTermArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTermArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDelTermArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDelTermArrival object - ''' - '''string xml file to load and deserialize - '''Output TDelTermArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDelTermArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTermArrival) - 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 TDelTermArrival) 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 TDelTermArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItemNdp - - Private partNumberField As String - - Private partDescriptionField As String - - Private prodGrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Public Property prodGr() As String - Get - Return Me.prodGrField - End Get - Set - Me.prodGrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItemNdp)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItemNdp object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItemNdp object - ''' - '''string workflow markup to deserialize - '''Output TItemNdp object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItemNdp, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItemNdp) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItemNdp) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItemNdp - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItemNdp) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TItemNdp 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TItemNdp object - ''' - '''string xml file to load and deserialize - '''Output TItemNdp object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TItemNdp, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItemNdp) - 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 TItemNdp) 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 TItemNdp - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TLicenseArrival - - Private licenseNoField As String - - Private licenseDateField As Date - - Private licenseDateFieldSpecified As Boolean - - Private licenseNotRequiredField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property licenseNo() As String - Get - Return Me.licenseNoField - End Get - Set - Me.licenseNoField = Value - End Set - End Property - - Public Property licenseDate() As Date - Get - Return Me.licenseDateField - End Get - Set - Me.licenseDateField = Value - End Set - End Property - - - Public Property licenseDateSpecified() As Boolean - Get - Return Me.licenseDateFieldSpecified - End Get - Set - Me.licenseDateFieldSpecified = Value - End Set - End Property - - Public Property licenseNotRequired() As String - Get - Return Me.licenseNotRequiredField - End Get - Set - Me.licenseNotRequiredField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLicenseArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TLicenseArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TLicenseArrival object - ''' - '''string workflow markup to deserialize - '''Output TLicenseArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLicenseArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TLicenseArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLicenseArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TLicenseArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLicenseArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TLicenseArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TLicenseArrival object - ''' - '''string xml file to load and deserialize - '''Output TLicenseArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TLicenseArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TLicenseArrival) - 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 TLicenseArrival) 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 TLicenseArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TTariffCode - - Private hsCodeField As String - - Private vatCodeField As String - - Private exciseTaxCodeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property hsCode() As String - Get - Return Me.hsCodeField - End Get - Set - Me.hsCodeField = Value - End Set - End Property - - Public Property vatCode() As String - Get - Return Me.vatCodeField - End Get - Set - Me.vatCodeField = Value - End Set - End Property - - Public Property exciseTaxCode() As String - Get - Return Me.exciseTaxCodeField - End Get - Set - Me.exciseTaxCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TTariffCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TTariffCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TTariffCode object - ''' - '''string workflow markup to deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TTariffCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TTariffCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TTariffCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TTariffCode object - ''' - '''string xml file to load and deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - 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 TTariffCode) 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 TTariffCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocumentArrival - - Private docTypeField As String - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocumentArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocumentArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocumentArrival object - ''' - '''string workflow markup to deserialize - '''Output TDocumentArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocumentArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocumentArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocumentArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocumentArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocumentArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDocumentArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDocumentArrival object - ''' - '''string xml file to load and deserialize - '''Output TDocumentArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocumentArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocumentArrival) - 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 TDocumentArrival) 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 TDocumentArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageArrival - - Private packageCountField As Integer - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageCount() As Integer - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageArrival object - ''' - '''string workflow markup to deserialize - '''Output TPackageArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackageArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackageArrival object - ''' - '''string xml file to load and deserialize - '''Output TPackageArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageArrival) - 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 TPackageArrival) 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 TPackageArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAdditionalCodes - - Private addCode1Field As String - - Private addCode2Field As String - - Private addCode3Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addCode1() As String - Get - Return Me.addCode1Field - End Get - Set - Me.addCode1Field = Value - End Set - End Property - - Public Property addCode2() As String - Get - Return Me.addCode2Field - End Get - Set - Me.addCode2Field = Value - End Set - End Property - - Public Property addCode3() As String - Get - Return Me.addCode3Field - End Get - Set - Me.addCode3Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAdditionalCodes)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAdditionalCodes object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAdditionalCodes object - ''' - '''string workflow markup to deserialize - '''Output TAdditionalCodes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAdditionalCodes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAdditionalCodes) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAdditionalCodes) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAdditionalCodes - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAdditionalCodes) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAdditionalCodes 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAdditionalCodes object - ''' - '''string xml file to load and deserialize - '''Output TAdditionalCodes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAdditionalCodes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAdditionalCodes) - 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 TAdditionalCodes) 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 TAdditionalCodes - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrefDocumentArrival - - Private prefTypeField As String - - Private prefNoField As String - - Private prefDateField As Date - - Private prefDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property prefType() As String - Get - Return Me.prefTypeField - End Get - Set - Me.prefTypeField = Value - End Set - End Property - - Public Property prefNo() As String - Get - Return Me.prefNoField - End Get - Set - Me.prefNoField = Value - End Set - End Property - - Public Property prefDate() As Date - Get - Return Me.prefDateField - End Get - Set - Me.prefDateField = Value - End Set - End Property - - - Public Property prefDateSpecified() As Boolean - Get - Return Me.prefDateFieldSpecified - End Get - Set - Me.prefDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrefDocumentArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrefDocumentArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrefDocumentArrival object - ''' - '''string workflow markup to deserialize - '''Output TPrefDocumentArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrefDocumentArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrefDocumentArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrefDocumentArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrefDocumentArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrefDocumentArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrefDocumentArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrefDocumentArrival object - ''' - '''string xml file to load and deserialize - '''Output TPrefDocumentArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrefDocumentArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrefDocumentArrival) - 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 TPrefDocumentArrival) 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 TPrefDocumentArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOrderArrival - - Private ordNoField As String - - Private ordLineNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ordNo() As String - Get - Return Me.ordNoField - End Get - Set - Me.ordNoField = Value - End Set - End Property - - Public Property ordLineNo() As String - Get - Return Me.ordLineNoField - End Get - Set - Me.ordLineNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrderArrival)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOrderArrival object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOrderArrival object - ''' - '''string workflow markup to deserialize - '''Output TOrderArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrderArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrderArrival) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrderArrival) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrderArrival - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrderArrival) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TOrderArrival 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TOrderArrival object - ''' - '''string xml file to load and deserialize - '''Output TOrderArrival object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOrderArrival, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrderArrival) - 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 TOrderArrival) 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 TOrderArrival - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInf - - Private infField As String - - Private infDutyAmountField As Decimal - - Private infDutyAmountFieldSpecified As Boolean - - Private infDutyAmountCurrField As String - - Private infDutyBasisField As Decimal - - Private infDutyBasisFieldSpecified As Boolean - - Private infDutyBet1Field As Decimal - - Private infDutyBet1FieldSpecified As Boolean - - Private infInterestAmountField As Decimal - - Private infInterestAmountFieldSpecified As Boolean - - Private infInterestAmountCurrField As String - - Private infEndUseAmountField As Decimal - - Private infEndUseAmountFieldSpecified As Boolean - - Private infEndUseAmountCurrField As String - - Private infDuty1TypeField As String - - Private infDuty1BetField As Decimal - - Private infDuty1BetFieldSpecified As Boolean - - Private infDuty1CurrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property inf() As String - Get - Return Me.infField - End Get - Set - Me.infField = Value - End Set - End Property - - Public Property infDutyAmount() As Decimal - Get - Return Me.infDutyAmountField - End Get - Set - Me.infDutyAmountField = Value - End Set - End Property - - - Public Property infDutyAmountSpecified() As Boolean - Get - Return Me.infDutyAmountFieldSpecified - End Get - Set - Me.infDutyAmountFieldSpecified = Value - End Set - End Property - - Public Property infDutyAmountCurr() As String - Get - Return Me.infDutyAmountCurrField - End Get - Set - Me.infDutyAmountCurrField = Value - End Set - End Property - - Public Property infDutyBasis() As Decimal - Get - Return Me.infDutyBasisField - End Get - Set - Me.infDutyBasisField = Value - End Set - End Property - - - Public Property infDutyBasisSpecified() As Boolean - Get - Return Me.infDutyBasisFieldSpecified - End Get - Set - Me.infDutyBasisFieldSpecified = Value - End Set - End Property - - Public Property infDutyBet1() As Decimal - Get - Return Me.infDutyBet1Field - End Get - Set - Me.infDutyBet1Field = Value - End Set - End Property - - - Public Property infDutyBet1Specified() As Boolean - Get - Return Me.infDutyBet1FieldSpecified - End Get - Set - Me.infDutyBet1FieldSpecified = Value - End Set - End Property - - Public Property infInterestAmount() As Decimal - Get - Return Me.infInterestAmountField - End Get - Set - Me.infInterestAmountField = Value - End Set - End Property - - - Public Property infInterestAmountSpecified() As Boolean - Get - Return Me.infInterestAmountFieldSpecified - End Get - Set - Me.infInterestAmountFieldSpecified = Value - End Set - End Property - - Public Property infInterestAmountCurr() As String - Get - Return Me.infInterestAmountCurrField - End Get - Set - Me.infInterestAmountCurrField = Value - End Set - End Property - - Public Property infEndUseAmount() As Decimal - Get - Return Me.infEndUseAmountField - End Get - Set - Me.infEndUseAmountField = Value - End Set - End Property - - - Public Property infEndUseAmountSpecified() As Boolean - Get - Return Me.infEndUseAmountFieldSpecified - End Get - Set - Me.infEndUseAmountFieldSpecified = Value - End Set - End Property - - Public Property infEndUseAmountCurr() As String - Get - Return Me.infEndUseAmountCurrField - End Get - Set - Me.infEndUseAmountCurrField = Value - End Set - End Property - - Public Property infDuty1Type() As String - Get - Return Me.infDuty1TypeField - End Get - Set - Me.infDuty1TypeField = Value - End Set - End Property - - Public Property infDuty1Bet() As Decimal - Get - Return Me.infDuty1BetField - End Get - Set - Me.infDuty1BetField = Value - End Set - End Property - - - Public Property infDuty1BetSpecified() As Boolean - Get - Return Me.infDuty1BetFieldSpecified - End Get - Set - Me.infDuty1BetFieldSpecified = Value - End Set - End Property - - Public Property infDuty1Curr() As String - Get - Return Me.infDuty1CurrField - End Get - Set - Me.infDuty1CurrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInf)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInf object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInf object - ''' - '''string workflow markup to deserialize - '''Output TInf object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInf, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInf) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInf) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInf - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInf) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInf 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInf object - ''' - '''string xml file to load and deserialize - '''Output TInf object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInf, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInf) - 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 TInf) 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 TInf - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerTexts - - Private textField As List(Of TCustomerText) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.textField = New List(Of TCustomerText)() - End Sub - - Public Property text() As List(Of TCustomerText) - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerTexts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerTexts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerTexts object - ''' - '''string workflow markup to deserialize - '''Output TCustomerTexts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerTexts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerTexts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerTexts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerTexts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerTexts object - ''' - '''string xml file to load and deserialize - '''Output TCustomerTexts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerTexts) - 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 TCustomerTexts) 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 TCustomerTexts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDates - - Private dateField As List(Of TCustomerDate) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.dateField = New List(Of TCustomerDate)() - End Sub - - Public Property [date]() As List(Of TCustomerDate) - Get - Return Me.dateField - End Get - Set - Me.dateField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDates)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDates object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDates object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDates object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDates) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDates - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDates) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerDates 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerDates object - ''' - '''string xml file to load and deserialize - '''Output TCustomerDates object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDates) - 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 TCustomerDates) 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 TCustomerDates - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlags - - Private flagField As List(Of TCustomerFlag) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.flagField = New List(Of TCustomerFlag)() - End Sub - - Public Property flag() As List(Of TCustomerFlag) - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlags)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlags object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlags object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlags object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlags) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlags - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlags) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerFlags 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerFlags object - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlags object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlags) - 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 TCustomerFlags) 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 TCustomerFlags - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumbers - - Private numberField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numberField = New List(Of TCustomerNumber)() - End Sub - - Public Property number() As List(Of TCustomerNumber) - Get - Return Me.numberField - End Get - Set - Me.numberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumbers)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumbers object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumbers object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumbers object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumbers) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumbers - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumbers) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerNumbers 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerNumbers object - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumbers object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumbers) - 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 TCustomerNumbers) 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 TCustomerNumbers - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpShipmentData - - Private erpSystemIdField As String - - Private clientField As String - - Private companyCodeField As String - - Private customerIdField As String - - Private consolidationCompanyIdField As String - - Private accountGroupField As String - - Private shippingPointField As String - - Private loadingPointField As String - - Private offshoreField As Boolean - - Private offshoreFieldSpecified As Boolean - - Private routeField As String - - Private salesOrganizationField As String - - Private distributionChannelField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property erpSystemId() As String - Get - Return Me.erpSystemIdField - End Get - Set - Me.erpSystemIdField = Value - End Set - End Property - - Public Property client() As String - Get - Return Me.clientField - End Get - Set - Me.clientField = Value - End Set - End Property - - Public Property companyCode() As String - Get - Return Me.companyCodeField - End Get - Set - Me.companyCodeField = Value - End Set - End Property - - Public Property customerId() As String - Get - Return Me.customerIdField - End Get - Set - Me.customerIdField = Value - End Set - End Property - - Public Property consolidationCompanyId() As String - Get - Return Me.consolidationCompanyIdField - End Get - Set - Me.consolidationCompanyIdField = Value - End Set - End Property - - Public Property accountGroup() As String - Get - Return Me.accountGroupField - End Get - Set - Me.accountGroupField = Value - End Set - End Property - - Public Property shippingPoint() As String - Get - Return Me.shippingPointField - End Get - Set - Me.shippingPointField = Value - End Set - End Property - - Public Property loadingPoint() As String - Get - Return Me.loadingPointField - End Get - Set - Me.loadingPointField = Value - End Set - End Property - - Public Property offshore() As Boolean - Get - Return Me.offshoreField - End Get - Set - Me.offshoreField = Value - End Set - End Property - - - Public Property offshoreSpecified() As Boolean - Get - Return Me.offshoreFieldSpecified - End Get - Set - Me.offshoreFieldSpecified = Value - End Set - End Property - - Public Property route() As String - Get - Return Me.routeField - End Get - Set - Me.routeField = Value - End Set - End Property - - Public Property salesOrganization() As String - Get - Return Me.salesOrganizationField - End Get - Set - Me.salesOrganizationField = Value - End Set - End Property - - Public Property distributionChannel() As String - Get - Return Me.distributionChannelField - End Get - Set - Me.distributionChannelField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpShipmentData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpShipmentData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpShipmentData object - ''' - '''string workflow markup to deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpShipmentData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpShipmentData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpShipmentData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpLineData - - Private legalRegulationField As String - - Private exportControlClassField As String - - Private embargoField As String - - Private licenseTypeField As String - - Private licenseNumberField As String - - Private profitCenterField As String - - Private vZTAField As String - - Private erpInvoicelinenumberField As String - - Private erpPartnumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property legalRegulation() As String - Get - Return Me.legalRegulationField - End Get - Set - Me.legalRegulationField = Value - End Set - End Property - - Public Property exportControlClass() As String - Get - Return Me.exportControlClassField - End Get - Set - Me.exportControlClassField = Value - End Set - End Property - - Public Property embargo() As String - Get - Return Me.embargoField - End Get - Set - Me.embargoField = Value - End Set - End Property - - Public Property licenseType() As String - Get - Return Me.licenseTypeField - End Get - Set - Me.licenseTypeField = Value - End Set - End Property - - Public Property licenseNumber() As String - Get - Return Me.licenseNumberField - End Get - Set - Me.licenseNumberField = Value - End Set - End Property - - Public Property profitCenter() As String - Get - Return Me.profitCenterField - End Get - Set - Me.profitCenterField = Value - End Set - End Property - - Public Property vZTA() As String - Get - Return Me.vZTAField - End Get - Set - Me.vZTAField = Value - End Set - End Property - - Public Property erpInvoicelinenumber() As String - Get - Return Me.erpInvoicelinenumberField - End Get - Set - Me.erpInvoicelinenumberField = Value - End Set - End Property - - Public Property erpPartnumber() As String - Get - Return Me.erpPartnumberField - End Get - Set - Me.erpPartnumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpLineData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpLineData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpLineData object - ''' - '''string workflow markup to deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpLineData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpLineData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpLineData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.Designer.vb deleted file mode 100644 index f56786f6..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportInvoiceTypes.Designer.vb +++ /dev/null @@ -1,8251 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustExportInvoiceTypesListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustExportInvoiceTypes - - Partial Public Class TInvoiceHead - - Private invoiceNoField As String - - Private invoiceDateField As Date - - Private invTypeField As String - - Private totAmountField As Decimal - - Private totAmountFieldSpecified As Boolean - - Private currField As String - - Private shipToField As TAddress - - Private endUserField As TInvoiceHeadEndUser - - Private delTermField As TDelTerm - - Private billToField As TAddress - - Private refField As String - - Private tradeCtryField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private addCostsField As List(Of TAddCosts) - - Private bolField As String - - Private transpNrField As String - - Private addtextField As List(Of String) - - Private documentsField As List(Of TDocuments) - - Private mrnExtField As String - - Private numberOfPackagesField As Decimal - - Private numberOfPackagesFieldSpecified As Boolean - - Private transportTypeField As String - - Private customerFieldsField As TCustomerFields - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.customerFieldsField = New TCustomerFields() - Me.documentsField = New List(Of TDocuments)() - Me.addtextField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.billToField = New TAddress() - Me.delTermField = New TDelTerm() - Me.endUserField = New TInvoiceHeadEndUser() - Me.shipToField = New TAddress() - End Sub - - Public Property invoiceNo() As String - Get - Return Me.invoiceNoField - End Get - Set - Me.invoiceNoField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - Public Property invType() As String - Get - Return Me.invTypeField - End Get - Set - Me.invTypeField = Value - End Set - End Property - - Public Property totAmount() As Decimal - Get - Return Me.totAmountField - End Get - Set - Me.totAmountField = Value - End Set - End Property - - - Public Property totAmountSpecified() As Boolean - Get - Return Me.totAmountFieldSpecified - End Get - Set - Me.totAmountFieldSpecified = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property shipTo() As TAddress - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceHeadEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property delTerm() As TDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property billTo() As TAddress - Get - Return Me.billToField - End Get - Set - Me.billToField = Value - End Set - End Property - - Public Property ref() As String - Get - Return Me.refField - End Get - Set - Me.refField = Value - End Set - End Property - - Public Property tradeCtry() As String - Get - Return Me.tradeCtryField - End Get - Set - Me.tradeCtryField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property bol() As String - Get - Return Me.bolField - End Get - Set - Me.bolField = Value - End Set - End Property - - Public Property transpNr() As String - Get - Return Me.transpNrField - End Get - Set - Me.transpNrField = Value - End Set - End Property - - Public Property addtext() As List(Of String) - Get - Return Me.addtextField - End Get - Set - Me.addtextField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property mrnExt() As String - Get - Return Me.mrnExtField - End Get - Set - Me.mrnExtField = Value - End Set - End Property - - Public Property numberOfPackages() As Decimal - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrVatIdField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrVatId() As String - Get - Return Me.addrVatIdField - End Get - Set - Me.addrVatIdField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContactPerson - - Private jobField As String - - Private nameField As String - - Private emailField As String - - Private phoneField As String - - Private faxField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property job() As String - Get - Return Me.jobField - End Get - Set - Me.jobField = Value - End Set - End Property - - Public Property name() As String - Get - Return Me.nameField - End Get - Set - Me.nameField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property phone() As String - Get - Return Me.phoneField - End Get - Set - Me.phoneField = Value - End Set - End Property - - Public Property fax() As String - Get - Return Me.faxField - End Get - Set - Me.faxField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContactPerson)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContactPerson object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContactPerson object - ''' - '''string workflow markup to deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContactPerson) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContactPerson - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContactPerson) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocuments - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docDetailField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docStatUnitField As String - - Private docDepreciateQuantityField As Decimal - - Private docDepreciateQuantityFieldSpecified As Boolean - - Private docSupplierField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docDetail() As String - Get - Return Me.docDetailField - End Get - Set - Me.docDetailField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docStatUnit() As String - Get - Return Me.docStatUnitField - End Get - Set - Me.docStatUnitField = Value - End Set - End Property - - Public Property docDepreciateQuantity() As Decimal - Get - Return Me.docDepreciateQuantityField - End Get - Set - Me.docDepreciateQuantityField = Value - End Set - End Property - - - Public Property docDepreciateQuantitySpecified() As Boolean - Get - Return Me.docDepreciateQuantityFieldSpecified - End Get - Set - Me.docDepreciateQuantityFieldSpecified = Value - End Set - End Property - - Public Property docSupplier() As String - Get - Return Me.docSupplierField - End Get - Set - Me.docSupplierField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocuments)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocuments object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocuments object - ''' - '''string workflow markup to deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocuments) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocuments - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocuments) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private typeField As String - - Private flagField As TAddCostsFlag - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property flag() As TAddCostsFlag - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TAddCostsFlag - - ''' - P - - ''' - V - End Enum - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHeadEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHeadEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHeadEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHeadEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHeadEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHeadEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHeadEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNoField As String - - Private unitPriceField As Decimal - - Private unitPriceFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private statQuantField As Decimal - - Private statQuantFieldSpecified As Boolean - - Private statUnitField As String - - Private statValField As Decimal - - Private statValFieldSpecified As Boolean - - Private custProcField As String - - Private eUCodeField As String - - Private statCodeField As String - - Private transTypeField As String - - Private cooField As String - - Private cooStateField As String - - Private addTextField As List(Of String) - - Private prevDocField As List(Of TPreviousDocument) - - Private itemField As TItem - - Private documentsField As List(Of TDocuments) - - Private delTermField As TInvoiceLineDelTerm - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private delnoteField As TDelNote - - Private orderField As TOrder - - Private itemRefField As String - - Private addCostsField As List(Of TAddCosts) - - Private addCodeField As List(Of String) - - Private natCodeField As List(Of String) - - Private stockTypeAddField As String - - Private stockTypeDedField As String - - Private bomField As TBomNo - - Private accountNoField As String - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containersField As List(Of TContainer) - - Private shipmentIdentificationField As String - - Private uNDGField As String - - Private consigneeEndUserFlagField As String - - Private endUserInEamField As TInvoiceLineEndUserInEam - - Private endUserInEamFieldSpecified As Boolean - - Private carriageCostsField As String - - Private shipToField As TInvoiceLineShipTo - - Private endUserField As TInvoiceLineEndUser - - Private importReferenceField As List(Of TImportReference) - - Private registrationInfoField As TRegInfo - - Private serialNoField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private modelField As String - - Private brandField As String - - Private addedValueField As Decimal - - Private addedValueFieldSpecified As Boolean - - Private ctoIdField As String - - Private infoText2Field As String - - Private branchNoField As String - - Private additionalInformationField As List(Of TAttribute) - - Private trackingNumberField As String - - Private erpDataField As TErpLineData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.erpDataField = New TErpLineData() - Me.additionalInformationField = New List(Of TAttribute)() - Me.registrationInfoField = New TRegInfo() - Me.importReferenceField = New List(Of TImportReference)() - Me.endUserField = New TInvoiceLineEndUser() - Me.shipToField = New TInvoiceLineShipTo() - Me.containersField = New List(Of TContainer)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.bomField = New TBomNo() - Me.natCodeField = New List(Of String)() - Me.addCodeField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.orderField = New TOrder() - Me.delnoteField = New TDelNote() - Me.delTermField = New TInvoiceLineDelTerm() - Me.documentsField = New List(Of TDocuments)() - Me.itemField = New TItem() - Me.prevDocField = New List(Of TPreviousDocument)() - Me.addTextField = New List(Of String)() - End Sub - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property unitPrice() As Decimal - Get - Return Me.unitPriceField - End Get - Set - Me.unitPriceField = Value - End Set - End Property - - - Public Property unitPriceSpecified() As Boolean - Get - Return Me.unitPriceFieldSpecified - End Get - Set - Me.unitPriceFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property statQuant() As Decimal - Get - Return Me.statQuantField - End Get - Set - Me.statQuantField = Value - End Set - End Property - - - Public Property statQuantSpecified() As Boolean - Get - Return Me.statQuantFieldSpecified - End Get - Set - Me.statQuantFieldSpecified = Value - End Set - End Property - - Public Property statUnit() As String - Get - Return Me.statUnitField - End Get - Set - Me.statUnitField = Value - End Set - End Property - - Public Property statVal() As Decimal - Get - Return Me.statValField - End Get - Set - Me.statValField = Value - End Set - End Property - - - Public Property statValSpecified() As Boolean - Get - Return Me.statValFieldSpecified - End Get - Set - Me.statValFieldSpecified = Value - End Set - End Property - - Public Property custProc() As String - Get - Return Me.custProcField - End Get - Set - Me.custProcField = Value - End Set - End Property - - Public Property EUCode() As String - Get - Return Me.eUCodeField - End Get - Set - Me.eUCodeField = Value - End Set - End Property - - Public Property statCode() As String - Get - Return Me.statCodeField - End Get - Set - Me.statCodeField = Value - End Set - End Property - - Public Property transType() As String - Get - Return Me.transTypeField - End Get - Set - Me.transTypeField = Value - End Set - End Property - - Public Property coo() As String - Get - Return Me.cooField - End Get - Set - Me.cooField = Value - End Set - End Property - - Public Property cooState() As String - Get - Return Me.cooStateField - End Get - Set - Me.cooStateField = Value - End Set - End Property - - Public Property addText() As List(Of String) - Get - Return Me.addTextField - End Get - Set - Me.addTextField = Value - End Set - End Property - - Public Property prevDoc() As List(Of TPreviousDocument) - Get - Return Me.prevDocField - End Get - Set - Me.prevDocField = Value - End Set - End Property - - Public Property item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property delTerm() As TInvoiceLineDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property delnote() As TDelNote - Get - Return Me.delnoteField - End Get - Set - Me.delnoteField = Value - End Set - End Property - - Public Property order() As TOrder - Get - Return Me.orderField - End Get - Set - Me.orderField = Value - End Set - End Property - - Public Property itemRef() As String - Get - Return Me.itemRefField - End Get - Set - Me.itemRefField = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property natCode() As List(Of String) - Get - Return Me.natCodeField - End Get - Set - Me.natCodeField = Value - End Set - End Property - - Public Property stockTypeAdd() As String - Get - Return Me.stockTypeAddField - End Get - Set - Me.stockTypeAddField = Value - End Set - End Property - - Public Property stockTypeDed() As String - Get - Return Me.stockTypeDedField - End Get - Set - Me.stockTypeDedField = Value - End Set - End Property - - Public Property bom() As TBomNo - Get - Return Me.bomField - End Get - Set - Me.bomField = Value - End Set - End Property - - Public Property accountNo() As String - Get - Return Me.accountNoField - End Get - Set - Me.accountNoField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - Public Property containers() As List(Of TContainer) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - Public Property shipmentIdentification() As String - Get - Return Me.shipmentIdentificationField - End Get - Set - Me.shipmentIdentificationField = Value - End Set - End Property - - Public Property UNDG() As String - Get - Return Me.uNDGField - End Get - Set - Me.uNDGField = Value - End Set - End Property - - Public Property consigneeEndUserFlag() As String - Get - Return Me.consigneeEndUserFlagField - End Get - Set - Me.consigneeEndUserFlagField = Value - End Set - End Property - - Public Property endUserInEam() As TInvoiceLineEndUserInEam - Get - Return Me.endUserInEamField - End Get - Set - Me.endUserInEamField = Value - End Set - End Property - - - Public Property endUserInEamSpecified() As Boolean - Get - Return Me.endUserInEamFieldSpecified - End Get - Set - Me.endUserInEamFieldSpecified = Value - End Set - End Property - - Public Property carriageCosts() As String - Get - Return Me.carriageCostsField - End Get - Set - Me.carriageCostsField = Value - End Set - End Property - - Public Property shipTo() As TInvoiceLineShipTo - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceLineEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property importReference() As List(Of TImportReference) - Get - Return Me.importReferenceField - End Get - Set - Me.importReferenceField = Value - End Set - End Property - - Public Property registrationInfo() As TRegInfo - Get - Return Me.registrationInfoField - End Get - Set - Me.registrationInfoField = Value - End Set - End Property - - Public Property serialNo() As String - Get - Return Me.serialNoField - End Get - Set - Me.serialNoField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property addedValue() As Decimal - Get - Return Me.addedValueField - End Get - Set - Me.addedValueField = Value - End Set - End Property - - - Public Property addedValueSpecified() As Boolean - Get - Return Me.addedValueFieldSpecified - End Get - Set - Me.addedValueFieldSpecified = Value - End Set - End Property - - Public Property ctoId() As String - Get - Return Me.ctoIdField - End Get - Set - Me.ctoIdField = Value - End Set - End Property - - Public Property infoText2() As String - Get - Return Me.infoText2Field - End Get - Set - Me.infoText2Field = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property additionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property trackingNumber() As String - Get - Return Me.trackingNumberField - End Get - Set - Me.trackingNumberField = Value - End Set - End Property - - Public Property erpData() As TErpLineData - Get - Return Me.erpDataField - End Get - Set - Me.erpDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreviousDocument - - Private docTypeField As String - - Private docNoField As String - - Private docAddTextField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreviousDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreviousDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreviousDocument object - ''' - '''string workflow markup to deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreviousDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreviousDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreviousDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private itemNoField As String - - Private itemDescField As String - - Private commCodeField As String - - Private prodGrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property itemNo() As String - Get - Return Me.itemNoField - End Get - Set - Me.itemNoField = Value - End Set - End Property - - Public Property itemDesc() As String - Get - Return Me.itemDescField - End Get - Set - Me.itemDescField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property prodGr() As String - Get - Return Me.prodGrField - End Get - Set - Me.prodGrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineDelTerm - - Private codeField As String - - Private descField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelNote - - Private delNoField As String - - Private positionField As Long - - Private positionFieldSpecified As Boolean - - Private delDateField As Date - - Private delDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property delNo() As String - Get - Return Me.delNoField - End Get - Set - Me.delNoField = Value - End Set - End Property - - Public Property position() As Long - Get - Return Me.positionField - End Get - Set - Me.positionField = Value - End Set - End Property - - - Public Property positionSpecified() As Boolean - Get - Return Me.positionFieldSpecified - End Get - Set - Me.positionFieldSpecified = Value - End Set - End Property - - Public Property delDate() As Date - Get - Return Me.delDateField - End Get - Set - Me.delDateField = Value - End Set - End Property - - - Public Property delDateSpecified() As Boolean - Get - Return Me.delDateFieldSpecified - End Get - Set - Me.delDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelNote)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelNote object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelNote object - ''' - '''string workflow markup to deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelNote) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelNote - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelNote) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOrder - - Private ordNoField As String - - Private ordDateField As Date - - Private ordDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ordNo() As String - Get - Return Me.ordNoField - End Get - Set - Me.ordNoField = Value - End Set - End Property - - Public Property ordDate() As Date - Get - Return Me.ordDateField - End Get - Set - Me.ordDateField = Value - End Set - End Property - - - Public Property ordDateSpecified() As Boolean - Get - Return Me.ordDateFieldSpecified - End Get - Set - Me.ordDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOrder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOrder object - ''' - '''string workflow markup to deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBomNo - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBomNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBomNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBomNo object - ''' - '''string workflow markup to deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBomNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBomNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBomNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attribTypeField As String - - Private attribTextField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attribType() As String - Get - Return Me.attribTypeField - End Get - Set - Me.attribTypeField = Value - End Set - End Property - - Public Property attribText() As String - Get - Return Me.attribTextField - End Get - Set - Me.attribTextField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private contNoField As String - - Private contTypeField As String - - Private sealNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property contNo() As String - Get - Return Me.contNoField - End Get - Set - Me.contNoField = Value - End Set - End Property - - Public Property contType() As String - Get - Return Me.contTypeField - End Get - Set - Me.contTypeField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TInvoiceLineEndUserInEam - - ''' - - Item - - ''' - - Item0 - - ''' - - Item1 - End Enum - - Partial Public Class TInvoiceLineShipTo - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineShipTo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineShipTo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineShipTo object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineShipTo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineShipTo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineShipTo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportReference - - Private typeField As String - - Private authNrField As String - - Private impShpNrField As String - - Private lineNoField As String - - Private authRegistryNoField As String - - Private commCodeField As String - - Private usualTreatmentField As String - - Private importAtlasField As String - - Private addInfoField As String - - Private quantityField As TImportQuantity - - Private tradeQuantityField As TImportQuantity - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tradeQuantityField = New TImportQuantity() - Me.quantityField = New TImportQuantity() - End Sub - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property authNr() As String - Get - Return Me.authNrField - End Get - Set - Me.authNrField = Value - End Set - End Property - - Public Property impShpNr() As String - Get - Return Me.impShpNrField - End Get - Set - Me.impShpNrField = Value - End Set - End Property - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property authRegistryNo() As String - Get - Return Me.authRegistryNoField - End Get - Set - Me.authRegistryNoField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property usualTreatment() As String - Get - Return Me.usualTreatmentField - End Get - Set - Me.usualTreatmentField = Value - End Set - End Property - - Public Property importAtlas() As String - Get - Return Me.importAtlasField - End Get - Set - Me.importAtlasField = Value - End Set - End Property - - Public Property addInfo() As String - Get - Return Me.addInfoField - End Get - Set - Me.addInfoField = Value - End Set - End Property - - Public Property quantity() As TImportQuantity - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property tradeQuantity() As TImportQuantity - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportReference object - ''' - '''string workflow markup to deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportQuantity - - Private qualifierField As String - - Private unitField As String - - Private valueField As Decimal - - Private valueFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property qualifier() As String - Get - Return Me.qualifierField - End Get - Set - Me.qualifierField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - - Public Property valueSpecified() As Boolean - Get - Return Me.valueFieldSpecified - End Get - Set - Me.valueFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportQuantity)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportQuantity object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportQuantity object - ''' - '''string workflow markup to deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportQuantity) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportQuantity - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportQuantity) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRegInfo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private referenceNumber1Field As String - - Private referenceNumber2Field As String - - Private referenceNumber3Field As String - - Private registrationDateField As Date - - Private registrationDateFieldSpecified As Boolean - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private releaseDateField As Date - - Private releaseDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property referenceNumber1() As String - Get - Return Me.referenceNumber1Field - End Get - Set - Me.referenceNumber1Field = Value - End Set - End Property - - Public Property referenceNumber2() As String - Get - Return Me.referenceNumber2Field - End Get - Set - Me.referenceNumber2Field = Value - End Set - End Property - - Public Property referenceNumber3() As String - Get - Return Me.referenceNumber3Field - End Get - Set - Me.referenceNumber3Field = Value - End Set - End Property - - Public Property registrationDate() As Date - Get - Return Me.registrationDateField - End Get - Set - Me.registrationDateField = Value - End Set - End Property - - - Public Property registrationDateSpecified() As Boolean - Get - Return Me.registrationDateFieldSpecified - End Get - Set - Me.registrationDateFieldSpecified = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property releaseDate() As Date - Get - Return Me.releaseDateField - End Get - Set - Me.releaseDateField = Value - End Set - End Property - - - Public Property releaseDateSpecified() As Boolean - Get - Return Me.releaseDateFieldSpecified - End Get - Set - Me.releaseDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRegInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRegInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRegInfo object - ''' - '''string workflow markup to deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRegInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRegInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRegInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpLineData - - Private legalRegulationField As String - - Private exportControlClassField As String - - Private embargoField As String - - Private licenseTypeField As String - - Private licenseNumberField As String - - Private profitCenterField As String - - Private vZTAField As String - - Private erpInvoicelinenumberField As String - - Private erpPartnumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property legalRegulation() As String - Get - Return Me.legalRegulationField - End Get - Set - Me.legalRegulationField = Value - End Set - End Property - - Public Property exportControlClass() As String - Get - Return Me.exportControlClassField - End Get - Set - Me.exportControlClassField = Value - End Set - End Property - - Public Property embargo() As String - Get - Return Me.embargoField - End Get - Set - Me.embargoField = Value - End Set - End Property - - Public Property licenseType() As String - Get - Return Me.licenseTypeField - End Get - Set - Me.licenseTypeField = Value - End Set - End Property - - Public Property licenseNumber() As String - Get - Return Me.licenseNumberField - End Get - Set - Me.licenseNumberField = Value - End Set - End Property - - Public Property profitCenter() As String - Get - Return Me.profitCenterField - End Get - Set - Me.profitCenterField = Value - End Set - End Property - - Public Property vZTA() As String - Get - Return Me.vZTAField - End Get - Set - Me.vZTAField = Value - End Set - End Property - - Public Property erpInvoicelinenumber() As String - Get - Return Me.erpInvoicelinenumberField - End Get - Set - Me.erpInvoicelinenumberField = Value - End Set - End Property - - Public Property erpPartnumber() As String - Get - Return Me.erpPartnumberField - End Get - Set - Me.erpPartnumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpLineData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpLineData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpLineData object - ''' - '''string workflow markup to deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpLineData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpLineData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpLineData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TSeal - - Private typeField As String - - Private quantityField As UInteger - - Private signField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property quantity() As UInteger - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property sign() As String - Get - Return Me.signField - End Get - Set - Me.signField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TSeal)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TSeal object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TSeal object - ''' - '''string workflow markup to deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TSeal) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TSeal - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TSeal) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoice - - Private invoiceHeadField As TInvoiceHead - - Private invoiceLineField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLineField = New List(Of TInvoiceLine)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - Public Property InvoiceLine() As List(Of TInvoiceLine) - Get - Return Me.invoiceLineField - End Get - Set - Me.invoiceLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageHeadField As TPackageHead - - Private packageLineField As List(Of TPackageLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageLineField = New List(Of TPackageLine)() - Me.packageHeadField = New TPackageHead() - End Sub - - Public Property packageHead() As TPackageHead - Get - Return Me.packageHeadField - End Get - Set - Me.packageHeadField = Value - End Set - End Property - - Public Property packageLine() As List(Of TPackageLine) - Get - Return Me.packageLineField - End Get - Set - Me.packageLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageHead - - Private packageNoField As String - - Private pTypeField As String - - Private unitField As String - - Private packageNoExtField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private taraField As Decimal - - Private taraFieldSpecified As Boolean - - Private unitWeightField As String - - Private volumeField As Decimal - - Private volumeFieldSpecified As Boolean - - Private grossVolumeField As Decimal - - Private grossVolumeFieldSpecified As Boolean - - Private netVolumeField As Decimal - - Private netVolumeFieldSpecified As Boolean - - Private unitVolumeField As String - - Private lengthField As Decimal - - Private lengthFieldSpecified As Boolean - - Private widthField As Decimal - - Private widthFieldSpecified As Boolean - - Private heightField As Decimal - - Private heightFieldSpecified As Boolean - - Private unitlwhField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageNo() As String - Get - Return Me.packageNoField - End Get - Set - Me.packageNoField = Value - End Set - End Property - - Public Property pType() As String - Get - Return Me.pTypeField - End Get - Set - Me.pTypeField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property packageNoExt() As String - Get - Return Me.packageNoExtField - End Get - Set - Me.packageNoExtField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property tara() As Decimal - Get - Return Me.taraField - End Get - Set - Me.taraField = Value - End Set - End Property - - - Public Property taraSpecified() As Boolean - Get - Return Me.taraFieldSpecified - End Get - Set - Me.taraFieldSpecified = Value - End Set - End Property - - Public Property unitWeight() As String - Get - Return Me.unitWeightField - End Get - Set - Me.unitWeightField = Value - End Set - End Property - - Public Property volume() As Decimal - Get - Return Me.volumeField - End Get - Set - Me.volumeField = Value - End Set - End Property - - - Public Property volumeSpecified() As Boolean - Get - Return Me.volumeFieldSpecified - End Get - Set - Me.volumeFieldSpecified = Value - End Set - End Property - - Public Property grossVolume() As Decimal - Get - Return Me.grossVolumeField - End Get - Set - Me.grossVolumeField = Value - End Set - End Property - - - Public Property grossVolumeSpecified() As Boolean - Get - Return Me.grossVolumeFieldSpecified - End Get - Set - Me.grossVolumeFieldSpecified = Value - End Set - End Property - - Public Property netVolume() As Decimal - Get - Return Me.netVolumeField - End Get - Set - Me.netVolumeField = Value - End Set - End Property - - - Public Property netVolumeSpecified() As Boolean - Get - Return Me.netVolumeFieldSpecified - End Get - Set - Me.netVolumeFieldSpecified = Value - End Set - End Property - - Public Property unitVolume() As String - Get - Return Me.unitVolumeField - End Get - Set - Me.unitVolumeField = Value - End Set - End Property - - Public Property length() As Decimal - Get - Return Me.lengthField - End Get - Set - Me.lengthField = Value - End Set - End Property - - - Public Property lengthSpecified() As Boolean - Get - Return Me.lengthFieldSpecified - End Get - Set - Me.lengthFieldSpecified = Value - End Set - End Property - - Public Property width() As Decimal - Get - Return Me.widthField - End Get - Set - Me.widthField = Value - End Set - End Property - - - Public Property widthSpecified() As Boolean - Get - Return Me.widthFieldSpecified - End Get - Set - Me.widthFieldSpecified = Value - End Set - End Property - - Public Property height() As Decimal - Get - Return Me.heightField - End Get - Set - Me.heightField = Value - End Set - End Property - - - Public Property heightSpecified() As Boolean - Get - Return Me.heightFieldSpecified - End Get - Set - Me.heightFieldSpecified = Value - End Set - End Property - - Public Property unitlwh() As String - Get - Return Me.unitlwhField - End Get - Set - Me.unitlwhField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageHead object - ''' - '''string workflow markup to deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageLine - - Private invNoField As String - - Private invPosField As String - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private itemQuantityField As Long - - Private itemQuantityFieldSpecified As Boolean - - Private itemUnitField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property invNo() As String - Get - Return Me.invNoField - End Get - Set - Me.invNoField = Value - End Set - End Property - - Public Property invPos() As String - Get - Return Me.invPosField - End Get - Set - Me.invPosField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property itemQuantity() As Long - Get - Return Me.itemQuantityField - End Get - Set - Me.itemQuantityField = Value - End Set - End Property - - - Public Property itemQuantitySpecified() As Boolean - Get - Return Me.itemQuantityFieldSpecified - End Get - Set - Me.itemQuantityFieldSpecified = Value - End Set - End Property - - Public Property itemUnit() As String - Get - Return Me.itemUnitField - End Get - Set - Me.itemUnitField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageLine object - ''' - '''string workflow markup to deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.Designer.vb deleted file mode 100644 index 41d6966a..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustExportShipment.Designer.vb +++ /dev/null @@ -1,12959 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustExportShipmentListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustExportShipment - - Partial Public Class ExportShipment - - Private shipmentHeadField As TShipmentHead - - Private invoicesField As List(Of TInvoice) - - Private packagesField As List(Of TPackage) - - Private schemaVersionField As Decimal - - Private schemaVersionFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packagesField = New List(Of TPackage)() - Me.invoicesField = New List(Of TInvoice)() - Me.shipmentHeadField = New TShipmentHead() - End Sub - - Public Property ShipmentHead() As TShipmentHead - Get - Return Me.shipmentHeadField - End Get - Set - Me.shipmentHeadField = Value - End Set - End Property - - Public Property Invoices() As List(Of TInvoice) - Get - Return Me.invoicesField - End Get - Set - Me.invoicesField = Value - End Set - End Property - - Public Property Packages() As List(Of TPackage) - Get - Return Me.packagesField - End Get - Set - Me.packagesField = Value - End Set - End Property - - Public Property schemaVersion() As Decimal - Get - Return Me.schemaVersionField - End Get - Set - Me.schemaVersionField = Value - End Set - End Property - - - Public Property schemaVersionSpecified() As Boolean - Get - Return Me.schemaVersionFieldSpecified - End Get - Set - Me.schemaVersionFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ExportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ExportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ExportShipment object - ''' - '''string workflow markup to deserialize - '''Output ExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ExportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ExportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ExportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ExportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ExportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHead - - Private companyField As String - - Private plantField As String - - Private shipmentIdField As String - - Private shipmentIdPartField As String - - Private shipmentTypeField As String - - Private mrnField As String - - Private deliveryDateField As Date - - Private deliveryDateFieldSpecified As Boolean - - Private codField As String - - Private exportCountryField As String - - Private contCodeField As ContainerCode - - Private contCodeFieldSpecified As Boolean - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private dateStartPackField As Date - - Private dateStartPackFieldSpecified As Boolean - - Private dateEndPackField As Date - - Private dateEndPackFieldSpecified As Boolean - - Private partyConstField As String - - Private consigneeEndUserFlagField As String - - Private endUserInEamField As TShipmentHeadEndUserInEam - - Private endUserInEamFieldSpecified As Boolean - - Private estimatedArrivalDateField As Date - - Private estimatedArrivalDateFieldSpecified As Boolean - - Private nctsIndicatorField As Boolean - - Private nctsIndicatorFieldSpecified As Boolean - - Private motInlField As TMotInl - - Private textField As List(Of String) - - Private partnersField As List(Of TPartner) - - Private locGoodsField As TLocationOfGoods - - Private officeDepartField As TCustomsOffice - - Private officeBorderField As TCustomsOffice - - Private motBorderField As TMot - - Private sealsField As List(Of TSeal) - - Private declTypeField As TDeclType - - Private placeDestField As String - - Private authLocationField As String - - Private declPlaceField As String - - Private agreedLocationOfGoodsCdField As String - - Private agreedLocationOfGoodsField As String - - Private custSubPlaceField As String - - Private codFirstField As String - - Private officeDestField As TCustomsOffice - - Private carrierField As String - - Private containersField As List(Of TContainer) - - Private freightCostField As TFreight - - Private addCostsField As List(Of TAddCosts) - - Private assurCostField As TAssurance - - Private groupIDField As String - - Private documentsField As List(Of TDocuments) - - Private regNoExtField As String - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private coeField As String - - Private specCircumField As String - - Private carriageCostsField As String - - Private shipmentIdentificationField As String - - Private conveyRefNrField As String - - Private unloadingPlaceField As String - - Private routeField As List(Of TRoute) - - Private expressField As String - - Private routeNameField As String - - Private authorisationNoField As String - - Private authorisationField As TShipmentHeadAuthorisation - - Private postExportDeclarationField As TShipmentHeadPostExportDeclaration - - Private oprDataField As TShipmentHeadOprData - - Private additionalInformationField As List(Of TAttribute) - - Private stateOfAffairsField As List(Of String) - - Private erpDataField As TErpShipmentData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.erpDataField = New TErpShipmentData() - Me.stateOfAffairsField = New List(Of String)() - Me.additionalInformationField = New List(Of TAttribute)() - Me.oprDataField = New TShipmentHeadOprData() - Me.postExportDeclarationField = New TShipmentHeadPostExportDeclaration() - Me.authorisationField = New TShipmentHeadAuthorisation() - Me.routeField = New List(Of TRoute)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.documentsField = New List(Of TDocuments)() - Me.assurCostField = New TAssurance() - Me.addCostsField = New List(Of TAddCosts)() - Me.freightCostField = New TFreight() - Me.containersField = New List(Of TContainer)() - Me.officeDestField = New TCustomsOffice() - Me.declTypeField = New TDeclType() - Me.sealsField = New List(Of TSeal)() - Me.motBorderField = New TMot() - Me.officeBorderField = New TCustomsOffice() - Me.officeDepartField = New TCustomsOffice() - Me.locGoodsField = New TLocationOfGoods() - Me.partnersField = New List(Of TPartner)() - Me.textField = New List(Of String)() - Me.motInlField = New TMotInl() - End Sub - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property shipmentId() As String - Get - Return Me.shipmentIdField - End Get - Set - Me.shipmentIdField = Value - End Set - End Property - - Public Property shipmentIdPart() As String - Get - Return Me.shipmentIdPartField - End Get - Set - Me.shipmentIdPartField = Value - End Set - End Property - - Public Property shipmentType() As String - Get - Return Me.shipmentTypeField - End Get - Set - Me.shipmentTypeField = Value - End Set - End Property - - Public Property mrn() As String - Get - Return Me.mrnField - End Get - Set - Me.mrnField = Value - End Set - End Property - - Public Property deliveryDate() As Date - Get - Return Me.deliveryDateField - End Get - Set - Me.deliveryDateField = Value - End Set - End Property - - - Public Property deliveryDateSpecified() As Boolean - Get - Return Me.deliveryDateFieldSpecified - End Get - Set - Me.deliveryDateFieldSpecified = Value - End Set - End Property - - Public Property cod() As String - Get - Return Me.codField - End Get - Set - Me.codField = Value - End Set - End Property - - Public Property exportCountry() As String - Get - Return Me.exportCountryField - End Get - Set - Me.exportCountryField = Value - End Set - End Property - - Public Property contCode() As ContainerCode - Get - Return Me.contCodeField - End Get - Set - Me.contCodeField = Value - End Set - End Property - - - Public Property contCodeSpecified() As Boolean - Get - Return Me.contCodeFieldSpecified - End Get - Set - Me.contCodeFieldSpecified = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property dateStartPack() As Date - Get - Return Me.dateStartPackField - End Get - Set - Me.dateStartPackField = Value - End Set - End Property - - - Public Property dateStartPackSpecified() As Boolean - Get - Return Me.dateStartPackFieldSpecified - End Get - Set - Me.dateStartPackFieldSpecified = Value - End Set - End Property - - Public Property dateEndPack() As Date - Get - Return Me.dateEndPackField - End Get - Set - Me.dateEndPackField = Value - End Set - End Property - - - Public Property dateEndPackSpecified() As Boolean - Get - Return Me.dateEndPackFieldSpecified - End Get - Set - Me.dateEndPackFieldSpecified = Value - End Set - End Property - - Public Property partyConst() As String - Get - Return Me.partyConstField - End Get - Set - Me.partyConstField = Value - End Set - End Property - - Public Property consigneeEndUserFlag() As String - Get - Return Me.consigneeEndUserFlagField - End Get - Set - Me.consigneeEndUserFlagField = Value - End Set - End Property - - Public Property endUserInEam() As TShipmentHeadEndUserInEam - Get - Return Me.endUserInEamField - End Get - Set - Me.endUserInEamField = Value - End Set - End Property - - - Public Property endUserInEamSpecified() As Boolean - Get - Return Me.endUserInEamFieldSpecified - End Get - Set - Me.endUserInEamFieldSpecified = Value - End Set - End Property - - Public Property estimatedArrivalDate() As Date - Get - Return Me.estimatedArrivalDateField - End Get - Set - Me.estimatedArrivalDateField = Value - End Set - End Property - - - Public Property estimatedArrivalDateSpecified() As Boolean - Get - Return Me.estimatedArrivalDateFieldSpecified - End Get - Set - Me.estimatedArrivalDateFieldSpecified = Value - End Set - End Property - - Public Property nctsIndicator() As Boolean - Get - Return Me.nctsIndicatorField - End Get - Set - Me.nctsIndicatorField = Value - End Set - End Property - - - Public Property nctsIndicatorSpecified() As Boolean - Get - Return Me.nctsIndicatorFieldSpecified - End Get - Set - Me.nctsIndicatorFieldSpecified = Value - End Set - End Property - - Public Property motInl() As TMotInl - Get - Return Me.motInlField - End Get - Set - Me.motInlField = Value - End Set - End Property - - Public Property text() As List(Of String) - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - Public Property locGoods() As TLocationOfGoods - Get - Return Me.locGoodsField - End Get - Set - Me.locGoodsField = Value - End Set - End Property - - Public Property officeDepart() As TCustomsOffice - Get - Return Me.officeDepartField - End Get - Set - Me.officeDepartField = Value - End Set - End Property - - Public Property officeBorder() As TCustomsOffice - Get - Return Me.officeBorderField - End Get - Set - Me.officeBorderField = Value - End Set - End Property - - Public Property motBorder() As TMot - Get - Return Me.motBorderField - End Get - Set - Me.motBorderField = Value - End Set - End Property - - Public Property seals() As List(Of TSeal) - Get - Return Me.sealsField - End Get - Set - Me.sealsField = Value - End Set - End Property - - Public Property declType() As TDeclType - Get - Return Me.declTypeField - End Get - Set - Me.declTypeField = Value - End Set - End Property - - Public Property placeDest() As String - Get - Return Me.placeDestField - End Get - Set - Me.placeDestField = Value - End Set - End Property - - Public Property authLocation() As String - Get - Return Me.authLocationField - End Get - Set - Me.authLocationField = Value - End Set - End Property - - Public Property declPlace() As String - Get - Return Me.declPlaceField - End Get - Set - Me.declPlaceField = Value - End Set - End Property - - Public Property agreedLocationOfGoodsCd() As String - Get - Return Me.agreedLocationOfGoodsCdField - End Get - Set - Me.agreedLocationOfGoodsCdField = Value - End Set - End Property - - Public Property agreedLocationOfGoods() As String - Get - Return Me.agreedLocationOfGoodsField - End Get - Set - Me.agreedLocationOfGoodsField = Value - End Set - End Property - - Public Property custSubPlace() As String - Get - Return Me.custSubPlaceField - End Get - Set - Me.custSubPlaceField = Value - End Set - End Property - - Public Property codFirst() As String - Get - Return Me.codFirstField - End Get - Set - Me.codFirstField = Value - End Set - End Property - - Public Property officeDest() As TCustomsOffice - Get - Return Me.officeDestField - End Get - Set - Me.officeDestField = Value - End Set - End Property - - Public Property carrier() As String - Get - Return Me.carrierField - End Get - Set - Me.carrierField = Value - End Set - End Property - - Public Property containers() As List(Of TContainer) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - Public Property freightCost() As TFreight - Get - Return Me.freightCostField - End Get - Set - Me.freightCostField = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property assurCost() As TAssurance - Get - Return Me.assurCostField - End Get - Set - Me.assurCostField = Value - End Set - End Property - - Public Property groupID() As String - Get - Return Me.groupIDField - End Get - Set - Me.groupIDField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property regNoExt() As String - Get - Return Me.regNoExtField - End Get - Set - Me.regNoExtField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - Public Property coe() As String - Get - Return Me.coeField - End Get - Set - Me.coeField = Value - End Set - End Property - - Public Property specCircum() As String - Get - Return Me.specCircumField - End Get - Set - Me.specCircumField = Value - End Set - End Property - - Public Property carriageCosts() As String - Get - Return Me.carriageCostsField - End Get - Set - Me.carriageCostsField = Value - End Set - End Property - - Public Property shipmentIdentification() As String - Get - Return Me.shipmentIdentificationField - End Get - Set - Me.shipmentIdentificationField = Value - End Set - End Property - - Public Property conveyRefNr() As String - Get - Return Me.conveyRefNrField - End Get - Set - Me.conveyRefNrField = Value - End Set - End Property - - Public Property unloadingPlace() As String - Get - Return Me.unloadingPlaceField - End Get - Set - Me.unloadingPlaceField = Value - End Set - End Property - - Public Property route() As List(Of TRoute) - Get - Return Me.routeField - End Get - Set - Me.routeField = Value - End Set - End Property - - Public Property express() As String - Get - Return Me.expressField - End Get - Set - Me.expressField = Value - End Set - End Property - - Public Property routeName() As String - Get - Return Me.routeNameField - End Get - Set - Me.routeNameField = Value - End Set - End Property - - Public Property authorisationNo() As String - Get - Return Me.authorisationNoField - End Get - Set - Me.authorisationNoField = Value - End Set - End Property - - Public Property authorisation() As TShipmentHeadAuthorisation - Get - Return Me.authorisationField - End Get - Set - Me.authorisationField = Value - End Set - End Property - - Public Property postExportDeclaration() As TShipmentHeadPostExportDeclaration - Get - Return Me.postExportDeclarationField - End Get - Set - Me.postExportDeclarationField = Value - End Set - End Property - - Public Property oprData() As TShipmentHeadOprData - Get - Return Me.oprDataField - End Get - Set - Me.oprDataField = Value - End Set - End Property - - Public Property additionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - - Public Property stateOfAffairs() As List(Of String) - Get - Return Me.stateOfAffairsField - End Get - Set - Me.stateOfAffairsField = Value - End Set - End Property - - Public Property erpData() As TErpShipmentData - Get - Return Me.erpDataField - End Get - Set - Me.erpDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHead object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum ContainerCode - - ''' - - Item1 - - ''' - - Item0 - End Enum - - Public Enum TShipmentHeadEndUserInEam - - ''' - - Item - - ''' - - Item0 - - ''' - - Item1 - End Enum - - Partial Public Class TMotInl - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotInl)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMotInl object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMotInl object - ''' - '''string workflow markup to deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMotInl) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotInl - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotInl) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageLine - - Private invNoField As String - - Private invPosField As String - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private itemQuantityField As Long - - Private itemQuantityFieldSpecified As Boolean - - Private itemUnitField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property invNo() As String - Get - Return Me.invNoField - End Get - Set - Me.invNoField = Value - End Set - End Property - - Public Property invPos() As String - Get - Return Me.invPosField - End Get - Set - Me.invPosField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property itemQuantity() As Long - Get - Return Me.itemQuantityField - End Get - Set - Me.itemQuantityField = Value - End Set - End Property - - - Public Property itemQuantitySpecified() As Boolean - Get - Return Me.itemQuantityFieldSpecified - End Get - Set - Me.itemQuantityFieldSpecified = Value - End Set - End Property - - Public Property itemUnit() As String - Get - Return Me.itemUnitField - End Get - Set - Me.itemUnitField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageLine object - ''' - '''string workflow markup to deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageHead - - Private packageNoField As String - - Private pTypeField As String - - Private unitField As String - - Private packageNoExtField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private taraField As Decimal - - Private taraFieldSpecified As Boolean - - Private unitWeightField As String - - Private volumeField As Decimal - - Private volumeFieldSpecified As Boolean - - Private grossVolumeField As Decimal - - Private grossVolumeFieldSpecified As Boolean - - Private netVolumeField As Decimal - - Private netVolumeFieldSpecified As Boolean - - Private unitVolumeField As String - - Private lengthField As Decimal - - Private lengthFieldSpecified As Boolean - - Private widthField As Decimal - - Private widthFieldSpecified As Boolean - - Private heightField As Decimal - - Private heightFieldSpecified As Boolean - - Private unitlwhField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageNo() As String - Get - Return Me.packageNoField - End Get - Set - Me.packageNoField = Value - End Set - End Property - - Public Property pType() As String - Get - Return Me.pTypeField - End Get - Set - Me.pTypeField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property packageNoExt() As String - Get - Return Me.packageNoExtField - End Get - Set - Me.packageNoExtField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property tara() As Decimal - Get - Return Me.taraField - End Get - Set - Me.taraField = Value - End Set - End Property - - - Public Property taraSpecified() As Boolean - Get - Return Me.taraFieldSpecified - End Get - Set - Me.taraFieldSpecified = Value - End Set - End Property - - Public Property unitWeight() As String - Get - Return Me.unitWeightField - End Get - Set - Me.unitWeightField = Value - End Set - End Property - - Public Property volume() As Decimal - Get - Return Me.volumeField - End Get - Set - Me.volumeField = Value - End Set - End Property - - - Public Property volumeSpecified() As Boolean - Get - Return Me.volumeFieldSpecified - End Get - Set - Me.volumeFieldSpecified = Value - End Set - End Property - - Public Property grossVolume() As Decimal - Get - Return Me.grossVolumeField - End Get - Set - Me.grossVolumeField = Value - End Set - End Property - - - Public Property grossVolumeSpecified() As Boolean - Get - Return Me.grossVolumeFieldSpecified - End Get - Set - Me.grossVolumeFieldSpecified = Value - End Set - End Property - - Public Property netVolume() As Decimal - Get - Return Me.netVolumeField - End Get - Set - Me.netVolumeField = Value - End Set - End Property - - - Public Property netVolumeSpecified() As Boolean - Get - Return Me.netVolumeFieldSpecified - End Get - Set - Me.netVolumeFieldSpecified = Value - End Set - End Property - - Public Property unitVolume() As String - Get - Return Me.unitVolumeField - End Get - Set - Me.unitVolumeField = Value - End Set - End Property - - Public Property length() As Decimal - Get - Return Me.lengthField - End Get - Set - Me.lengthField = Value - End Set - End Property - - - Public Property lengthSpecified() As Boolean - Get - Return Me.lengthFieldSpecified - End Get - Set - Me.lengthFieldSpecified = Value - End Set - End Property - - Public Property width() As Decimal - Get - Return Me.widthField - End Get - Set - Me.widthField = Value - End Set - End Property - - - Public Property widthSpecified() As Boolean - Get - Return Me.widthFieldSpecified - End Get - Set - Me.widthFieldSpecified = Value - End Set - End Property - - Public Property height() As Decimal - Get - Return Me.heightField - End Get - Set - Me.heightField = Value - End Set - End Property - - - Public Property heightSpecified() As Boolean - Get - Return Me.heightFieldSpecified - End Get - Set - Me.heightFieldSpecified = Value - End Set - End Property - - Public Property unitlwh() As String - Get - Return Me.unitlwhField - End Get - Set - Me.unitlwhField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageHead object - ''' - '''string workflow markup to deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageHeadField As TPackageHead - - Private packageLineField As List(Of TPackageLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageLineField = New List(Of TPackageLine)() - Me.packageHeadField = New TPackageHead() - End Sub - - Public Property packageHead() As TPackageHead - Get - Return Me.packageHeadField - End Get - Set - Me.packageHeadField = Value - End Set - End Property - - Public Property packageLine() As List(Of TPackageLine) - Get - Return Me.packageLineField - End Get - Set - Me.packageLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpLineData - - Private legalRegulationField As String - - Private exportControlClassField As String - - Private embargoField As String - - Private licenseTypeField As String - - Private licenseNumberField As String - - Private profitCenterField As String - - Private vZTAField As String - - Private erpInvoicelinenumberField As String - - Private erpPartnumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property legalRegulation() As String - Get - Return Me.legalRegulationField - End Get - Set - Me.legalRegulationField = Value - End Set - End Property - - Public Property exportControlClass() As String - Get - Return Me.exportControlClassField - End Get - Set - Me.exportControlClassField = Value - End Set - End Property - - Public Property embargo() As String - Get - Return Me.embargoField - End Get - Set - Me.embargoField = Value - End Set - End Property - - Public Property licenseType() As String - Get - Return Me.licenseTypeField - End Get - Set - Me.licenseTypeField = Value - End Set - End Property - - Public Property licenseNumber() As String - Get - Return Me.licenseNumberField - End Get - Set - Me.licenseNumberField = Value - End Set - End Property - - Public Property profitCenter() As String - Get - Return Me.profitCenterField - End Get - Set - Me.profitCenterField = Value - End Set - End Property - - Public Property vZTA() As String - Get - Return Me.vZTAField - End Get - Set - Me.vZTAField = Value - End Set - End Property - - Public Property erpInvoicelinenumber() As String - Get - Return Me.erpInvoicelinenumberField - End Get - Set - Me.erpInvoicelinenumberField = Value - End Set - End Property - - Public Property erpPartnumber() As String - Get - Return Me.erpPartnumberField - End Get - Set - Me.erpPartnumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpLineData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpLineData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpLineData object - ''' - '''string workflow markup to deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpLineData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpLineData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpLineData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRegInfo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private referenceNumber1Field As String - - Private referenceNumber2Field As String - - Private referenceNumber3Field As String - - Private registrationDateField As Date - - Private registrationDateFieldSpecified As Boolean - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private releaseDateField As Date - - Private releaseDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property referenceNumber1() As String - Get - Return Me.referenceNumber1Field - End Get - Set - Me.referenceNumber1Field = Value - End Set - End Property - - Public Property referenceNumber2() As String - Get - Return Me.referenceNumber2Field - End Get - Set - Me.referenceNumber2Field = Value - End Set - End Property - - Public Property referenceNumber3() As String - Get - Return Me.referenceNumber3Field - End Get - Set - Me.referenceNumber3Field = Value - End Set - End Property - - Public Property registrationDate() As Date - Get - Return Me.registrationDateField - End Get - Set - Me.registrationDateField = Value - End Set - End Property - - - Public Property registrationDateSpecified() As Boolean - Get - Return Me.registrationDateFieldSpecified - End Get - Set - Me.registrationDateFieldSpecified = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property releaseDate() As Date - Get - Return Me.releaseDateField - End Get - Set - Me.releaseDateField = Value - End Set - End Property - - - Public Property releaseDateSpecified() As Boolean - Get - Return Me.releaseDateFieldSpecified - End Get - Set - Me.releaseDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRegInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRegInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRegInfo object - ''' - '''string workflow markup to deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRegInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRegInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRegInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportQuantity - - Private qualifierField As String - - Private unitField As String - - Private valueField As Decimal - - Private valueFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property qualifier() As String - Get - Return Me.qualifierField - End Get - Set - Me.qualifierField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - - Public Property valueSpecified() As Boolean - Get - Return Me.valueFieldSpecified - End Get - Set - Me.valueFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportQuantity)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportQuantity object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportQuantity object - ''' - '''string workflow markup to deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportQuantity) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportQuantity - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportQuantity) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportReference - - Private typeField As String - - Private authNrField As String - - Private impShpNrField As String - - Private lineNoField As String - - Private authRegistryNoField As String - - Private commCodeField As String - - Private usualTreatmentField As String - - Private importAtlasField As String - - Private addInfoField As String - - Private quantityField As TImportQuantity - - Private tradeQuantityField As TImportQuantity - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tradeQuantityField = New TImportQuantity() - Me.quantityField = New TImportQuantity() - End Sub - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property authNr() As String - Get - Return Me.authNrField - End Get - Set - Me.authNrField = Value - End Set - End Property - - Public Property impShpNr() As String - Get - Return Me.impShpNrField - End Get - Set - Me.impShpNrField = Value - End Set - End Property - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property authRegistryNo() As String - Get - Return Me.authRegistryNoField - End Get - Set - Me.authRegistryNoField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property usualTreatment() As String - Get - Return Me.usualTreatmentField - End Get - Set - Me.usualTreatmentField = Value - End Set - End Property - - Public Property importAtlas() As String - Get - Return Me.importAtlasField - End Get - Set - Me.importAtlasField = Value - End Set - End Property - - Public Property addInfo() As String - Get - Return Me.addInfoField - End Get - Set - Me.addInfoField = Value - End Set - End Property - - Public Property quantity() As TImportQuantity - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property tradeQuantity() As TImportQuantity - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportReference object - ''' - '''string workflow markup to deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBomNo - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBomNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBomNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBomNo object - ''' - '''string workflow markup to deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBomNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBomNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBomNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOrder - - Private ordNoField As String - - Private ordDateField As Date - - Private ordDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ordNo() As String - Get - Return Me.ordNoField - End Get - Set - Me.ordNoField = Value - End Set - End Property - - Public Property ordDate() As Date - Get - Return Me.ordDateField - End Get - Set - Me.ordDateField = Value - End Set - End Property - - - Public Property ordDateSpecified() As Boolean - Get - Return Me.ordDateFieldSpecified - End Get - Set - Me.ordDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOrder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOrder object - ''' - '''string workflow markup to deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelNote - - Private delNoField As String - - Private positionField As Long - - Private positionFieldSpecified As Boolean - - Private delDateField As Date - - Private delDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property delNo() As String - Get - Return Me.delNoField - End Get - Set - Me.delNoField = Value - End Set - End Property - - Public Property position() As Long - Get - Return Me.positionField - End Get - Set - Me.positionField = Value - End Set - End Property - - - Public Property positionSpecified() As Boolean - Get - Return Me.positionFieldSpecified - End Get - Set - Me.positionFieldSpecified = Value - End Set - End Property - - Public Property delDate() As Date - Get - Return Me.delDateField - End Get - Set - Me.delDateField = Value - End Set - End Property - - - Public Property delDateSpecified() As Boolean - Get - Return Me.delDateFieldSpecified - End Get - Set - Me.delDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelNote)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelNote object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelNote object - ''' - '''string workflow markup to deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelNote) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelNote - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelNote) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private itemNoField As String - - Private itemDescField As String - - Private commCodeField As String - - Private prodGrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property itemNo() As String - Get - Return Me.itemNoField - End Get - Set - Me.itemNoField = Value - End Set - End Property - - Public Property itemDesc() As String - Get - Return Me.itemDescField - End Get - Set - Me.itemDescField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property prodGr() As String - Get - Return Me.prodGrField - End Get - Set - Me.prodGrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreviousDocument - - Private docTypeField As String - - Private docNoField As String - - Private docAddTextField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreviousDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreviousDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreviousDocument object - ''' - '''string workflow markup to deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreviousDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreviousDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreviousDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNoField As String - - Private unitPriceField As Decimal - - Private unitPriceFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private statQuantField As Decimal - - Private statQuantFieldSpecified As Boolean - - Private statUnitField As String - - Private statValField As Decimal - - Private statValFieldSpecified As Boolean - - Private custProcField As String - - Private eUCodeField As String - - Private statCodeField As String - - Private transTypeField As String - - Private cooField As String - - Private cooStateField As String - - Private addTextField As List(Of String) - - Private prevDocField As List(Of TPreviousDocument) - - Private itemField As TItem - - Private documentsField As List(Of TDocuments) - - Private delTermField As TInvoiceLineDelTerm - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private delnoteField As TDelNote - - Private orderField As TOrder - - Private itemRefField As String - - Private addCostsField As List(Of TAddCosts) - - Private addCodeField As List(Of String) - - Private natCodeField As List(Of String) - - Private stockTypeAddField As String - - Private stockTypeDedField As String - - Private bomField As TBomNo - - Private accountNoField As String - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containersField As List(Of TContainer) - - Private shipmentIdentificationField As String - - Private uNDGField As String - - Private consigneeEndUserFlagField As String - - Private endUserInEamField As TInvoiceLineEndUserInEam - - Private endUserInEamFieldSpecified As Boolean - - Private carriageCostsField As String - - Private shipToField As TInvoiceLineShipTo - - Private endUserField As TInvoiceLineEndUser - - Private importReferenceField As List(Of TImportReference) - - Private registrationInfoField As TRegInfo - - Private serialNoField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private modelField As String - - Private brandField As String - - Private addedValueField As Decimal - - Private addedValueFieldSpecified As Boolean - - Private ctoIdField As String - - Private infoText2Field As String - - Private branchNoField As String - - Private additionalInformationField As List(Of TAttribute) - - Private trackingNumberField As String - - Private erpDataField As TErpLineData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.erpDataField = New TErpLineData() - Me.additionalInformationField = New List(Of TAttribute)() - Me.registrationInfoField = New TRegInfo() - Me.importReferenceField = New List(Of TImportReference)() - Me.endUserField = New TInvoiceLineEndUser() - Me.shipToField = New TInvoiceLineShipTo() - Me.containersField = New List(Of TContainer)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.bomField = New TBomNo() - Me.natCodeField = New List(Of String)() - Me.addCodeField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.orderField = New TOrder() - Me.delnoteField = New TDelNote() - Me.delTermField = New TInvoiceLineDelTerm() - Me.documentsField = New List(Of TDocuments)() - Me.itemField = New TItem() - Me.prevDocField = New List(Of TPreviousDocument)() - Me.addTextField = New List(Of String)() - End Sub - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property unitPrice() As Decimal - Get - Return Me.unitPriceField - End Get - Set - Me.unitPriceField = Value - End Set - End Property - - - Public Property unitPriceSpecified() As Boolean - Get - Return Me.unitPriceFieldSpecified - End Get - Set - Me.unitPriceFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property statQuant() As Decimal - Get - Return Me.statQuantField - End Get - Set - Me.statQuantField = Value - End Set - End Property - - - Public Property statQuantSpecified() As Boolean - Get - Return Me.statQuantFieldSpecified - End Get - Set - Me.statQuantFieldSpecified = Value - End Set - End Property - - Public Property statUnit() As String - Get - Return Me.statUnitField - End Get - Set - Me.statUnitField = Value - End Set - End Property - - Public Property statVal() As Decimal - Get - Return Me.statValField - End Get - Set - Me.statValField = Value - End Set - End Property - - - Public Property statValSpecified() As Boolean - Get - Return Me.statValFieldSpecified - End Get - Set - Me.statValFieldSpecified = Value - End Set - End Property - - Public Property custProc() As String - Get - Return Me.custProcField - End Get - Set - Me.custProcField = Value - End Set - End Property - - Public Property EUCode() As String - Get - Return Me.eUCodeField - End Get - Set - Me.eUCodeField = Value - End Set - End Property - - Public Property statCode() As String - Get - Return Me.statCodeField - End Get - Set - Me.statCodeField = Value - End Set - End Property - - Public Property transType() As String - Get - Return Me.transTypeField - End Get - Set - Me.transTypeField = Value - End Set - End Property - - Public Property coo() As String - Get - Return Me.cooField - End Get - Set - Me.cooField = Value - End Set - End Property - - Public Property cooState() As String - Get - Return Me.cooStateField - End Get - Set - Me.cooStateField = Value - End Set - End Property - - Public Property addText() As List(Of String) - Get - Return Me.addTextField - End Get - Set - Me.addTextField = Value - End Set - End Property - - Public Property prevDoc() As List(Of TPreviousDocument) - Get - Return Me.prevDocField - End Get - Set - Me.prevDocField = Value - End Set - End Property - - Public Property item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property delTerm() As TInvoiceLineDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property delnote() As TDelNote - Get - Return Me.delnoteField - End Get - Set - Me.delnoteField = Value - End Set - End Property - - Public Property order() As TOrder - Get - Return Me.orderField - End Get - Set - Me.orderField = Value - End Set - End Property - - Public Property itemRef() As String - Get - Return Me.itemRefField - End Get - Set - Me.itemRefField = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property natCode() As List(Of String) - Get - Return Me.natCodeField - End Get - Set - Me.natCodeField = Value - End Set - End Property - - Public Property stockTypeAdd() As String - Get - Return Me.stockTypeAddField - End Get - Set - Me.stockTypeAddField = Value - End Set - End Property - - Public Property stockTypeDed() As String - Get - Return Me.stockTypeDedField - End Get - Set - Me.stockTypeDedField = Value - End Set - End Property - - Public Property bom() As TBomNo - Get - Return Me.bomField - End Get - Set - Me.bomField = Value - End Set - End Property - - Public Property accountNo() As String - Get - Return Me.accountNoField - End Get - Set - Me.accountNoField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - Public Property containers() As List(Of TContainer) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - Public Property shipmentIdentification() As String - Get - Return Me.shipmentIdentificationField - End Get - Set - Me.shipmentIdentificationField = Value - End Set - End Property - - Public Property UNDG() As String - Get - Return Me.uNDGField - End Get - Set - Me.uNDGField = Value - End Set - End Property - - Public Property consigneeEndUserFlag() As String - Get - Return Me.consigneeEndUserFlagField - End Get - Set - Me.consigneeEndUserFlagField = Value - End Set - End Property - - Public Property endUserInEam() As TInvoiceLineEndUserInEam - Get - Return Me.endUserInEamField - End Get - Set - Me.endUserInEamField = Value - End Set - End Property - - - Public Property endUserInEamSpecified() As Boolean - Get - Return Me.endUserInEamFieldSpecified - End Get - Set - Me.endUserInEamFieldSpecified = Value - End Set - End Property - - Public Property carriageCosts() As String - Get - Return Me.carriageCostsField - End Get - Set - Me.carriageCostsField = Value - End Set - End Property - - Public Property shipTo() As TInvoiceLineShipTo - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceLineEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property importReference() As List(Of TImportReference) - Get - Return Me.importReferenceField - End Get - Set - Me.importReferenceField = Value - End Set - End Property - - Public Property registrationInfo() As TRegInfo - Get - Return Me.registrationInfoField - End Get - Set - Me.registrationInfoField = Value - End Set - End Property - - Public Property serialNo() As String - Get - Return Me.serialNoField - End Get - Set - Me.serialNoField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property addedValue() As Decimal - Get - Return Me.addedValueField - End Get - Set - Me.addedValueField = Value - End Set - End Property - - - Public Property addedValueSpecified() As Boolean - Get - Return Me.addedValueFieldSpecified - End Get - Set - Me.addedValueFieldSpecified = Value - End Set - End Property - - Public Property ctoId() As String - Get - Return Me.ctoIdField - End Get - Set - Me.ctoIdField = Value - End Set - End Property - - Public Property infoText2() As String - Get - Return Me.infoText2Field - End Get - Set - Me.infoText2Field = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property additionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property trackingNumber() As String - Get - Return Me.trackingNumberField - End Get - Set - Me.trackingNumberField = Value - End Set - End Property - - Public Property erpData() As TErpLineData - Get - Return Me.erpDataField - End Get - Set - Me.erpDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocuments - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docDetailField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docStatUnitField As String - - Private docDepreciateQuantityField As Decimal - - Private docDepreciateQuantityFieldSpecified As Boolean - - Private docSupplierField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docDetail() As String - Get - Return Me.docDetailField - End Get - Set - Me.docDetailField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docStatUnit() As String - Get - Return Me.docStatUnitField - End Get - Set - Me.docStatUnitField = Value - End Set - End Property - - Public Property docDepreciateQuantity() As Decimal - Get - Return Me.docDepreciateQuantityField - End Get - Set - Me.docDepreciateQuantityField = Value - End Set - End Property - - - Public Property docDepreciateQuantitySpecified() As Boolean - Get - Return Me.docDepreciateQuantityFieldSpecified - End Get - Set - Me.docDepreciateQuantityFieldSpecified = Value - End Set - End Property - - Public Property docSupplier() As String - Get - Return Me.docSupplierField - End Get - Set - Me.docSupplierField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocuments)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocuments object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocuments object - ''' - '''string workflow markup to deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocuments) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocuments - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocuments) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineDelTerm - - Private codeField As String - - Private descField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private typeField As String - - Private flagField As TAddCostsFlag - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property flag() As TAddCostsFlag - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TAddCostsFlag - - ''' - P - - ''' - V - End Enum - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attribTypeField As String - - Private attribTextField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attribType() As String - Get - Return Me.attribTypeField - End Get - Set - Me.attribTypeField = Value - End Set - End Property - - Public Property attribText() As String - Get - Return Me.attribTextField - End Get - Set - Me.attribTextField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private contNoField As String - - Private contTypeField As String - - Private sealNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property contNo() As String - Get - Return Me.contNoField - End Get - Set - Me.contNoField = Value - End Set - End Property - - Public Property contType() As String - Get - Return Me.contTypeField - End Get - Set - Me.contTypeField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TInvoiceLineEndUserInEam - - ''' - - Item - - ''' - - Item0 - - ''' - - Item1 - End Enum - - Partial Public Class TInvoiceLineShipTo - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineShipTo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineShipTo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineShipTo object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineShipTo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineShipTo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineShipTo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContactPerson - - Private jobField As String - - Private nameField As String - - Private emailField As String - - Private phoneField As String - - Private faxField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property job() As String - Get - Return Me.jobField - End Get - Set - Me.jobField = Value - End Set - End Property - - Public Property name() As String - Get - Return Me.nameField - End Get - Set - Me.nameField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property phone() As String - Get - Return Me.phoneField - End Get - Set - Me.phoneField = Value - End Set - End Property - - Public Property fax() As String - Get - Return Me.faxField - End Get - Set - Me.faxField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContactPerson)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContactPerson object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContactPerson object - ''' - '''string workflow markup to deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContactPerson) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContactPerson - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContactPerson) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrVatIdField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrVatId() As String - Get - Return Me.addrVatIdField - End Get - Set - Me.addrVatIdField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHead - - Private invoiceNoField As String - - Private invoiceDateField As Date - - Private invTypeField As String - - Private totAmountField As Decimal - - Private totAmountFieldSpecified As Boolean - - Private currField As String - - Private shipToField As TAddress - - Private endUserField As TInvoiceHeadEndUser - - Private delTermField As TDelTerm - - Private billToField As TAddress - - Private refField As String - - Private tradeCtryField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private addCostsField As List(Of TAddCosts) - - Private bolField As String - - Private transpNrField As String - - Private addtextField As List(Of String) - - Private documentsField As List(Of TDocuments) - - Private mrnExtField As String - - Private numberOfPackagesField As Decimal - - Private numberOfPackagesFieldSpecified As Boolean - - Private transportTypeField As String - - Private customerFieldsField As TCustomerFields - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.customerFieldsField = New TCustomerFields() - Me.documentsField = New List(Of TDocuments)() - Me.addtextField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.billToField = New TAddress() - Me.delTermField = New TDelTerm() - Me.endUserField = New TInvoiceHeadEndUser() - Me.shipToField = New TAddress() - End Sub - - Public Property invoiceNo() As String - Get - Return Me.invoiceNoField - End Get - Set - Me.invoiceNoField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - Public Property invType() As String - Get - Return Me.invTypeField - End Get - Set - Me.invTypeField = Value - End Set - End Property - - Public Property totAmount() As Decimal - Get - Return Me.totAmountField - End Get - Set - Me.totAmountField = Value - End Set - End Property - - - Public Property totAmountSpecified() As Boolean - Get - Return Me.totAmountFieldSpecified - End Get - Set - Me.totAmountFieldSpecified = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property shipTo() As TAddress - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceHeadEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property delTerm() As TDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property billTo() As TAddress - Get - Return Me.billToField - End Get - Set - Me.billToField = Value - End Set - End Property - - Public Property ref() As String - Get - Return Me.refField - End Get - Set - Me.refField = Value - End Set - End Property - - Public Property tradeCtry() As String - Get - Return Me.tradeCtryField - End Get - Set - Me.tradeCtryField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property bol() As String - Get - Return Me.bolField - End Get - Set - Me.bolField = Value - End Set - End Property - - Public Property transpNr() As String - Get - Return Me.transpNrField - End Get - Set - Me.transpNrField = Value - End Set - End Property - - Public Property addtext() As List(Of String) - Get - Return Me.addtextField - End Get - Set - Me.addtextField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property mrnExt() As String - Get - Return Me.mrnExtField - End Get - Set - Me.mrnExtField = Value - End Set - End Property - - Public Property numberOfPackages() As Decimal - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHeadEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHeadEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHeadEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHeadEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHeadEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHeadEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHeadEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoice - - Private invoiceHeadField As TInvoiceHead - - Private invoiceLineField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLineField = New List(Of TInvoiceLine)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - Public Property InvoiceLine() As List(Of TInvoiceLine) - Get - Return Me.invoiceLineField - End Get - Set - Me.invoiceLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpShipmentData - - Private erpSystemIdField As String - - Private clientField As String - - Private companyCodeField As String - - Private customerIdField As String - - Private consolidationCompanyIdField As String - - Private accountGroupField As String - - Private shippingPointField As String - - Private loadingPointField As String - - Private offshoreField As Boolean - - Private offshoreFieldSpecified As Boolean - - Private routeField As String - - Private salesOrganizationField As String - - Private distributionChannelField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property erpSystemId() As String - Get - Return Me.erpSystemIdField - End Get - Set - Me.erpSystemIdField = Value - End Set - End Property - - Public Property client() As String - Get - Return Me.clientField - End Get - Set - Me.clientField = Value - End Set - End Property - - Public Property companyCode() As String - Get - Return Me.companyCodeField - End Get - Set - Me.companyCodeField = Value - End Set - End Property - - Public Property customerId() As String - Get - Return Me.customerIdField - End Get - Set - Me.customerIdField = Value - End Set - End Property - - Public Property consolidationCompanyId() As String - Get - Return Me.consolidationCompanyIdField - End Get - Set - Me.consolidationCompanyIdField = Value - End Set - End Property - - Public Property accountGroup() As String - Get - Return Me.accountGroupField - End Get - Set - Me.accountGroupField = Value - End Set - End Property - - Public Property shippingPoint() As String - Get - Return Me.shippingPointField - End Get - Set - Me.shippingPointField = Value - End Set - End Property - - Public Property loadingPoint() As String - Get - Return Me.loadingPointField - End Get - Set - Me.loadingPointField = Value - End Set - End Property - - Public Property offshore() As Boolean - Get - Return Me.offshoreField - End Get - Set - Me.offshoreField = Value - End Set - End Property - - - Public Property offshoreSpecified() As Boolean - Get - Return Me.offshoreFieldSpecified - End Get - Set - Me.offshoreFieldSpecified = Value - End Set - End Property - - Public Property route() As String - Get - Return Me.routeField - End Get - Set - Me.routeField = Value - End Set - End Property - - Public Property salesOrganization() As String - Get - Return Me.salesOrganizationField - End Get - Set - Me.salesOrganizationField = Value - End Set - End Property - - Public Property distributionChannel() As String - Get - Return Me.distributionChannelField - End Get - Set - Me.distributionChannelField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpShipmentData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpShipmentData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpShipmentData object - ''' - '''string workflow markup to deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpShipmentData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpShipmentData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpShipmentData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRoute - - Private countryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property country() As String - Get - Return Me.countryField - End Get - Set - Me.countryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRoute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRoute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRoute object - ''' - '''string workflow markup to deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRoute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRoute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRoute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAssurance - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAssurance)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAssurance object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAssurance object - ''' - '''string workflow markup to deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAssurance) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAssurance - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAssurance) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreight - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private noneuField As Decimal - - Private noneuFieldSpecified As Boolean - - Private eunatField As Decimal - - Private eunatFieldSpecified As Boolean - - Private natField As Decimal - - Private natFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property noneu() As Decimal - Get - Return Me.noneuField - End Get - Set - Me.noneuField = Value - End Set - End Property - - - Public Property noneuSpecified() As Boolean - Get - Return Me.noneuFieldSpecified - End Get - Set - Me.noneuFieldSpecified = Value - End Set - End Property - - Public Property eunat() As Decimal - Get - Return Me.eunatField - End Get - Set - Me.eunatField = Value - End Set - End Property - - - Public Property eunatSpecified() As Boolean - Get - Return Me.eunatFieldSpecified - End Get - Set - Me.eunatFieldSpecified = Value - End Set - End Property - - Public Property nat() As Decimal - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - - Public Property natSpecified() As Boolean - Get - Return Me.natFieldSpecified - End Get - Set - Me.natFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreight)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreight object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreight object - ''' - '''string workflow markup to deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreight) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreight - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreight) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private type3Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Public Property type3() As String - Get - Return Me.type3Field - End Get - Set - Me.type3Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TSeal - - Private typeField As String - - Private quantityField As UInteger - - Private signField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property quantity() As UInteger - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property sign() As String - Get - Return Me.signField - End Get - Set - Me.signField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TSeal)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TSeal object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TSeal object - ''' - '''string workflow markup to deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TSeal) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TSeal - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TSeal) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomsOffice - - Private codeOffField As String - - Private offCtryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property codeOff() As String - Get - Return Me.codeOffField - End Get - Set - Me.codeOffField = Value - End Set - End Property - - Public Property offCtry() As String - Get - Return Me.offCtryField - End Get - Set - Me.offCtryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomsOffice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomsOffice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomsOffice object - ''' - '''string workflow markup to deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomsOffice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomsOffice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomsOffice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TLocationOfGoods - - Private codeField As String - - Private streetField As String - - Private zipField As String - - Private locField As String - - Private additField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property street() As String - Get - Return Me.streetField - End Get - Set - Me.streetField = Value - End Set - End Property - - Public Property zip() As String - Get - Return Me.zipField - End Get - Set - Me.zipField = Value - End Set - End Property - - Public Property loc() As String - Get - Return Me.locField - End Get - Set - Me.locField = Value - End Set - End Property - - Public Property addit() As String - Get - Return Me.additField - End Get - Set - Me.additField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLocationOfGoods)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TLocationOfGoods object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TLocationOfGoods object - ''' - '''string workflow markup to deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TLocationOfGoods) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TLocationOfGoods - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLocationOfGoods) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypField As String - - Private partnerAddressField As TPartnerPartnerAddress - - Private partnerRelationField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TPartnerPartnerAddress() - End Sub - - Public Property partnerTyp() As String - Get - Return Me.partnerTypField - End Get - Set - Me.partnerTypField = Value - End Set - End Property - - Public Property partnerAddress() As TPartnerPartnerAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartnerPartnerAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrStreet2Field As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private addrInfoField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrStreet2() As String - Get - Return Me.addrStreet2Field - End Get - Set - Me.addrStreet2Field = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property addrInfo() As String - Get - Return Me.addrInfoField - End Get - Set - Me.addrInfoField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartnerPartnerAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartnerPartnerAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartnerPartnerAddress object - ''' - '''string workflow markup to deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartnerPartnerAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartnerPartnerAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartnerPartnerAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadAuthorisation - - Private oprEntryInTheRecordsField As String - - Private oprField As String - - Private trustworthyExporterField As String - - Private authorisedExporterField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property oprEntryInTheRecords() As String - Get - Return Me.oprEntryInTheRecordsField - End Get - Set - Me.oprEntryInTheRecordsField = Value - End Set - End Property - - Public Property opr() As String - Get - Return Me.oprField - End Get - Set - Me.oprField = Value - End Set - End Property - - Public Property trustworthyExporter() As String - Get - Return Me.trustworthyExporterField - End Get - Set - Me.trustworthyExporterField = Value - End Set - End Property - - Public Property authorisedExporter() As String - Get - Return Me.authorisedExporterField - End Get - Set - Me.authorisedExporterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadAuthorisation)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadAuthorisation object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadAuthorisation object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadAuthorisation object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadAuthorisation, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadAuthorisation) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadAuthorisation) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadAuthorisation - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadAuthorisation) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadAuthorisation object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadPostExportDeclaration - - Private dateOfExitField As Date - - Private dateOfExitFieldSpecified As Boolean - - Private dateOfExportField As Date - - Private dateOfExportFieldSpecified As Boolean - - Private statisticDeclField As String - - Private officeExitField As TCustomsOffice - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.officeExitField = New TCustomsOffice() - End Sub - - Public Property dateOfExit() As Date - Get - Return Me.dateOfExitField - End Get - Set - Me.dateOfExitField = Value - End Set - End Property - - - Public Property dateOfExitSpecified() As Boolean - Get - Return Me.dateOfExitFieldSpecified - End Get - Set - Me.dateOfExitFieldSpecified = Value - End Set - End Property - - Public Property dateOfExport() As Date - Get - Return Me.dateOfExportField - End Get - Set - Me.dateOfExportField = Value - End Set - End Property - - - Public Property dateOfExportSpecified() As Boolean - Get - Return Me.dateOfExportFieldSpecified - End Get - Set - Me.dateOfExportFieldSpecified = Value - End Set - End Property - - Public Property statisticDecl() As String - Get - Return Me.statisticDeclField - End Get - Set - Me.statisticDeclField = Value - End Set - End Property - - Public Property officeExit() As TCustomsOffice - Get - Return Me.officeExitField - End Get - Set - Me.officeExitField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadPostExportDeclaration)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadPostExportDeclaration object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadPostExportDeclaration object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadPostExportDeclaration object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadPostExportDeclaration, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadPostExportDeclaration) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadPostExportDeclaration) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadPostExportDeclaration - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadPostExportDeclaration) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadPostExportDeclaration object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprData - - Private reimportDeadlineField As Date - - Private reimportDeadlineFieldSpecified As Boolean - - Private standardExchangeField As String - - Private reImportField As List(Of TShipmentHeadOprDataReImport) - - Private meansOfIdentificationField As List(Of TShipmentHeadOprDataMeansOfIdentification) - - Private productField As List(Of TShipmentHeadOprDataProduct) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.productField = New List(Of TShipmentHeadOprDataProduct)() - Me.meansOfIdentificationField = New List(Of TShipmentHeadOprDataMeansOfIdentification)() - Me.reImportField = New List(Of TShipmentHeadOprDataReImport)() - End Sub - - Public Property reimportDeadline() As Date - Get - Return Me.reimportDeadlineField - End Get - Set - Me.reimportDeadlineField = Value - End Set - End Property - - - Public Property reimportDeadlineSpecified() As Boolean - Get - Return Me.reimportDeadlineFieldSpecified - End Get - Set - Me.reimportDeadlineFieldSpecified = Value - End Set - End Property - - Public Property standardExchange() As String - Get - Return Me.standardExchangeField - End Get - Set - Me.standardExchangeField = Value - End Set - End Property - - Public Property reImport() As List(Of TShipmentHeadOprDataReImport) - Get - Return Me.reImportField - End Get - Set - Me.reImportField = Value - End Set - End Property - - Public Property meansOfIdentification() As List(Of TShipmentHeadOprDataMeansOfIdentification) - Get - Return Me.meansOfIdentificationField - End Get - Set - Me.meansOfIdentificationField = Value - End Set - End Property - - Public Property product() As List(Of TShipmentHeadOprDataProduct) - Get - Return Me.productField - End Get - Set - Me.productField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprData object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataReImport - - Private ctryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ctry() As String - Get - Return Me.ctryField - End Get - Set - Me.ctryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataReImport)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataReImport object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataReImport object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataReImport object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataReImport, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataReImport) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataReImport) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataReImport - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataReImport) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataReImport object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataMeansOfIdentification - - Private typeField As String - - Private descriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property description() As String - Get - Return Me.descriptionField - End Get - Set - Me.descriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataMeansOfIdentification)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataMeansOfIdentification object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataMeansOfIdentification object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataMeansOfIdentification object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataMeansOfIdentification, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataMeansOfIdentification) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataMeansOfIdentification) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataMeansOfIdentification - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataMeansOfIdentification) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataMeansOfIdentification object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataProduct - - Private commodityCodeField As String - - Private partDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property commodityCode() As String - Get - Return Me.commodityCodeField - End Get - Set - Me.commodityCodeField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataProduct)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataProduct object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataProduct object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataProduct object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataProduct, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataProduct) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataProduct) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataProduct - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataProduct) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataProduct object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.Designer.vb deleted file mode 100644 index d3970eb3..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.Designer.vb +++ /dev/null @@ -1,19123 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustImportInvoiceTypesListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustImportInvoiceTypes - - Partial Public Class TInvoice - - Private invoiceNumberField As String - - Private invoiceVersionField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private invoiceHeadField As TInvoiceHead - - Private attributesField As List(Of TAttribute) - - Private documentsField As List(Of TDocument) - - Private partnersField As List(Of TPartner) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private intraField As TCustIntra - - Private invoiceLinesField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLinesField = New List(Of TInvoiceLine)() - Me.intraField = New TCustIntra() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.partnersField = New List(Of TPartner)() - Me.documentsField = New List(Of TDocument)() - Me.attributesField = New List(Of TAttribute)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property invoiceNumber() As String - Get - Return Me.invoiceNumberField - End Get - Set - Me.invoiceNumberField = Value - End Set - End Property - - Public Property invoiceVersion() As String - Get - Return Me.invoiceVersionField - End Get - Set - Me.invoiceVersionField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - Public Property Intra() As TCustIntra - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - - Public Property InvoiceLines() As List(Of TInvoiceLine) - Get - Return Me.invoiceLinesField - End Get - Set - Me.invoiceLinesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHead - - Private invoiceTypeField As String - - Private contractDateField As Date - - Private contractDateFieldSpecified As Boolean - - Private countryOfTradeField As String - - Private supplierField As TAddress - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private invoiceValueField As Decimal - - Private invoiceValueFieldSpecified As Boolean - - Private invoiceCurrencyField As String - - Private deliveryTermsField As TDelTerm - - Private rebateField As TRebate - - Private discountField As Decimal - - Private discountFieldSpecified As Boolean - - Private additionalCostField As List(Of TAddCosts) - - Private textField As String - - Private text2Field As String - - Private freightField As TFreightCostsInv - - Private insuranceField As TInsuranceCostsInv - - Private referenceNumberField As String - - Private transportNumberField As String - - Private transportTypeField As String - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private disposalDateField As Date - - Private disposalDateFieldSpecified As Boolean - - Private timeLimitField As Date - - Private timeLimitFieldSpecified As Boolean - - Private registrationNumberField As String - - Private sealNumberField As String - - Private billOfLadingField As String - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private buyerField As String - - Private consigneeField As String - - Private paymentInformationField As TImportPaymentInfo - - Private customerFieldsField As TCustomerFields - - Private sellerField As TAddress - - Private exchangeRateField As Decimal - - Private exchangeRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private containerInfoField As TContainer - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.containerInfoField = New TContainer() - Me.sellerField = New TAddress() - Me.customerFieldsField = New TCustomerFields() - Me.paymentInformationField = New TImportPaymentInfo() - Me.insuranceField = New TInsuranceCostsInv() - Me.freightField = New TFreightCostsInv() - Me.additionalCostField = New List(Of TAddCosts)() - Me.rebateField = New TRebate() - Me.deliveryTermsField = New TDelTerm() - Me.supplierField = New TAddress() - End Sub - - Public Property invoiceType() As String - Get - Return Me.invoiceTypeField - End Get - Set - Me.invoiceTypeField = Value - End Set - End Property - - Public Property contractDate() As Date - Get - Return Me.contractDateField - End Get - Set - Me.contractDateField = Value - End Set - End Property - - - Public Property contractDateSpecified() As Boolean - Get - Return Me.contractDateFieldSpecified - End Get - Set - Me.contractDateFieldSpecified = Value - End Set - End Property - - Public Property countryOfTrade() As String - Get - Return Me.countryOfTradeField - End Get - Set - Me.countryOfTradeField = Value - End Set - End Property - - Public Property Supplier() As TAddress - Get - Return Me.supplierField - End Get - Set - Me.supplierField = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property invoiceValue() As Decimal - Get - Return Me.invoiceValueField - End Get - Set - Me.invoiceValueField = Value - End Set - End Property - - - Public Property invoiceValueSpecified() As Boolean - Get - Return Me.invoiceValueFieldSpecified - End Get - Set - Me.invoiceValueFieldSpecified = Value - End Set - End Property - - Public Property invoiceCurrency() As String - Get - Return Me.invoiceCurrencyField - End Get - Set - Me.invoiceCurrencyField = Value - End Set - End Property - - Public Property deliveryTerms() As TDelTerm - Get - Return Me.deliveryTermsField - End Get - Set - Me.deliveryTermsField = Value - End Set - End Property - - Public Property Rebate() As TRebate - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property discount() As Decimal - Get - Return Me.discountField - End Get - Set - Me.discountField = Value - End Set - End Property - - - Public Property discountSpecified() As Boolean - Get - Return Me.discountFieldSpecified - End Get - Set - Me.discountFieldSpecified = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property Freight() As TFreightCostsInv - Get - Return Me.freightField - End Get - Set - Me.freightField = Value - End Set - End Property - - Public Property Insurance() As TInsuranceCostsInv - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property transportNumber() As String - Get - Return Me.transportNumberField - End Get - Set - Me.transportNumberField = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property disposalDate() As Date - Get - Return Me.disposalDateField - End Get - Set - Me.disposalDateField = Value - End Set - End Property - - - Public Property disposalDateSpecified() As Boolean - Get - Return Me.disposalDateFieldSpecified - End Get - Set - Me.disposalDateFieldSpecified = Value - End Set - End Property - - Public Property timeLimit() As Date - Get - Return Me.timeLimitField - End Get - Set - Me.timeLimitField = Value - End Set - End Property - - - Public Property timeLimitSpecified() As Boolean - Get - Return Me.timeLimitFieldSpecified - End Get - Set - Me.timeLimitFieldSpecified = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Public Property billOfLading() As String - Get - Return Me.billOfLadingField - End Get - Set - Me.billOfLadingField = Value - End Set - End Property - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property buyer() As String - Get - Return Me.buyerField - End Get - Set - Me.buyerField = Value - End Set - End Property - - Public Property consignee() As String - Get - Return Me.consigneeField - End Get - Set - Me.consigneeField = Value - End Set - End Property - - Public Property PaymentInformation() As TImportPaymentInfo - Get - Return Me.paymentInformationField - End Get - Set - Me.paymentInformationField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property seller() As TAddress - Get - Return Me.sellerField - End Get - Set - Me.sellerField = Value - End Set - End Property - - Public Property exchangeRate() As Decimal - Get - Return Me.exchangeRateField - End Get - Set - Me.exchangeRateField = Value - End Set - End Property - - - Public Property exchangeRateSpecified() As Boolean - Get - Return Me.exchangeRateFieldSpecified - End Get - Set - Me.exchangeRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property ContainerInfo() As TContainer - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private partnerRelationField As String - - Private addrDistrictField As String - - Private addrBranchNoField As String - - Private emailField As String - - Private addrVatNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property addrDistrict() As String - Get - Return Me.addrDistrictField - End Get - Set - Me.addrDistrictField = Value - End Set - End Property - - Public Property addrBranchNo() As String - Get - Return Me.addrBranchNoField - End Get - Set - Me.addrBranchNoField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property addrVatNumber() As String - Get - Return Me.addrVatNumberField - End Get - Set - Me.addrVatNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageData - - Private signoField As String - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private packageTypeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property signo() As String - Get - Return Me.signoField - End Get - Set - Me.signoField = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageData object - ''' - '''string workflow markup to deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackageData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackageData object - ''' - '''string xml file to load and deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - 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 TPackageData) 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 TPackageData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackagesData - - Private packageDataField As List(Of TPackageData) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageDataField = New List(Of TPackageData)() - End Sub - - Public Property PackageData() As List(Of TPackageData) - Get - Return Me.packageDataField - End Get - Set - Me.packageDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackagesData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackagesData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackagesData object - ''' - '''string workflow markup to deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackagesData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackagesData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackagesData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackagesData object - ''' - '''string xml file to load and deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - 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 TPackagesData) 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 TPackagesData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRefPrevProcedure - - Private referenceTypeField As String - - Private referenceNumberField As String - - Private authorisationNumberField As String - - Private registrationNumberField As String - - Private positionNumberField As Long - - Private positionNumberFieldSpecified As Boolean - - Private partNumberField As String - - Private tariffNumberField As String - - Private tradeQuantityField As Decimal - - Private tradeQuantityFieldSpecified As Boolean - - Private tradeUnitOfMeasurementField As String - - Private tradeQualifierField As String - - Private deductionQuantityField As Decimal - - Private deductionQuantityFieldSpecified As Boolean - - Private deductionUnitOfMeasurementField As String - - Private deductionQualifierField As String - - Private additionalInformationField As String - - Private normalTreatmentFlagField As Boolean - - Private normalTreatmentFlagFieldSpecified As Boolean - - Private atlasFlagField As Boolean - - Private atlasFlagFieldSpecified As Boolean - - Private customsNumberField As String - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private simpleIprApplicationField As Boolean - - Private simpleIprApplicationFieldSpecified As Boolean - - Private supervisingOfficeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property authorisationNumber() As String - Get - Return Me.authorisationNumberField - End Get - Set - Me.authorisationNumberField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property positionNumber() As Long - Get - Return Me.positionNumberField - End Get - Set - Me.positionNumberField = Value - End Set - End Property - - - Public Property positionNumberSpecified() As Boolean - Get - Return Me.positionNumberFieldSpecified - End Get - Set - Me.positionNumberFieldSpecified = Value - End Set - End Property - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property tariffNumber() As String - Get - Return Me.tariffNumberField - End Get - Set - Me.tariffNumberField = Value - End Set - End Property - - Public Property tradeQuantity() As Decimal - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - - Public Property tradeQuantitySpecified() As Boolean - Get - Return Me.tradeQuantityFieldSpecified - End Get - Set - Me.tradeQuantityFieldSpecified = Value - End Set - End Property - - Public Property tradeUnitOfMeasurement() As String - Get - Return Me.tradeUnitOfMeasurementField - End Get - Set - Me.tradeUnitOfMeasurementField = Value - End Set - End Property - - Public Property tradeQualifier() As String - Get - Return Me.tradeQualifierField - End Get - Set - Me.tradeQualifierField = Value - End Set - End Property - - Public Property deductionQuantity() As Decimal - Get - Return Me.deductionQuantityField - End Get - Set - Me.deductionQuantityField = Value - End Set - End Property - - - Public Property deductionQuantitySpecified() As Boolean - Get - Return Me.deductionQuantityFieldSpecified - End Get - Set - Me.deductionQuantityFieldSpecified = Value - End Set - End Property - - Public Property deductionUnitOfMeasurement() As String - Get - Return Me.deductionUnitOfMeasurementField - End Get - Set - Me.deductionUnitOfMeasurementField = Value - End Set - End Property - - Public Property deductionQualifier() As String - Get - Return Me.deductionQualifierField - End Get - Set - Me.deductionQualifierField = Value - End Set - End Property - - Public Property additionalInformation() As String - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property normalTreatmentFlag() As Boolean - Get - Return Me.normalTreatmentFlagField - End Get - Set - Me.normalTreatmentFlagField = Value - End Set - End Property - - - Public Property normalTreatmentFlagSpecified() As Boolean - Get - Return Me.normalTreatmentFlagFieldSpecified - End Get - Set - Me.normalTreatmentFlagFieldSpecified = Value - End Set - End Property - - Public Property atlasFlag() As Boolean - Get - Return Me.atlasFlagField - End Get - Set - Me.atlasFlagField = Value - End Set - End Property - - - Public Property atlasFlagSpecified() As Boolean - Get - Return Me.atlasFlagFieldSpecified - End Get - Set - Me.atlasFlagFieldSpecified = Value - End Set - End Property - - Public Property customsNumber() As String - Get - Return Me.customsNumberField - End Get - Set - Me.customsNumberField = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property simpleIprApplication() As Boolean - Get - Return Me.simpleIprApplicationField - End Get - Set - Me.simpleIprApplicationField = Value - End Set - End Property - - - Public Property simpleIprApplicationSpecified() As Boolean - Get - Return Me.simpleIprApplicationFieldSpecified - End Get - Set - Me.simpleIprApplicationFieldSpecified = Value - End Set - End Property - - Public Property supervisingOffice() As String - Get - Return Me.supervisingOfficeField - End Get - Set - Me.supervisingOfficeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRefPrevProcedure)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRefPrevProcedure object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRefPrevProcedure object - ''' - '''string workflow markup to deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRefPrevProcedure - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRefPrevProcedure) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRefPrevProcedure 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRefPrevProcedure object - ''' - '''string xml file to load and deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - 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 TRefPrevProcedure) 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 TRefPrevProcedure - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreSupplier - - Private infDutyValueField As Decimal - - Private infDutyValueFieldSpecified As Boolean - - Private infDutyRateField As Decimal - - Private infDutyRateFieldSpecified As Boolean - - Private infDutyField As Decimal - - Private infDutyFieldSpecified As Boolean - - Private infDutyCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property infDutyValue() As Decimal - Get - Return Me.infDutyValueField - End Get - Set - Me.infDutyValueField = Value - End Set - End Property - - - Public Property infDutyValueSpecified() As Boolean - Get - Return Me.infDutyValueFieldSpecified - End Get - Set - Me.infDutyValueFieldSpecified = Value - End Set - End Property - - Public Property infDutyRate() As Decimal - Get - Return Me.infDutyRateField - End Get - Set - Me.infDutyRateField = Value - End Set - End Property - - - Public Property infDutyRateSpecified() As Boolean - Get - Return Me.infDutyRateFieldSpecified - End Get - Set - Me.infDutyRateFieldSpecified = Value - End Set - End Property - - Public Property infDuty() As Decimal - Get - Return Me.infDutyField - End Get - Set - Me.infDutyField = Value - End Set - End Property - - - Public Property infDutySpecified() As Boolean - Get - Return Me.infDutyFieldSpecified - End Get - Set - Me.infDutyFieldSpecified = Value - End Set - End Property - - Public Property infDutyCurrency() As String - Get - Return Me.infDutyCurrencyField - End Get - Set - Me.infDutyCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreSupplier)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreSupplier object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreSupplier object - ''' - '''string workflow markup to deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreSupplier - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreSupplier) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPreSupplier 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPreSupplier object - ''' - '''string xml file to load and deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - 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 TPreSupplier) 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 TPreSupplier - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntraLine - - Private statusField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private periodField As Long - - Private periodFieldSpecified As Boolean - - Private regionField As String - - Private statisticalProcedureField As String - - Private statisticalValueField As Decimal - - Private statisticalValueFieldSpecified As Boolean - - Private additionalCostsCurrency1Field As String - - Private additionalCostsType1Field As String - - Private additionalCostsCurrency2Field As String - - Private additionalCostsType2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As String - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property period() As Long - Get - Return Me.periodField - End Get - Set - Me.periodField = Value - End Set - End Property - - - Public Property periodSpecified() As Boolean - Get - Return Me.periodFieldSpecified - End Get - Set - Me.periodFieldSpecified = Value - End Set - End Property - - Public Property region() As String - Get - Return Me.regionField - End Get - Set - Me.regionField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property statisticalValue() As Decimal - Get - Return Me.statisticalValueField - End Get - Set - Me.statisticalValueField = Value - End Set - End Property - - - Public Property statisticalValueSpecified() As Boolean - Get - Return Me.statisticalValueFieldSpecified - End Get - Set - Me.statisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsCurrency1() As String - Get - Return Me.additionalCostsCurrency1Field - End Get - Set - Me.additionalCostsCurrency1Field = Value - End Set - End Property - - Public Property additionalCostsType1() As String - Get - Return Me.additionalCostsType1Field - End Get - Set - Me.additionalCostsType1Field = Value - End Set - End Property - - Public Property additionalCostsCurrency2() As String - Get - Return Me.additionalCostsCurrency2Field - End Get - Set - Me.additionalCostsCurrency2Field = Value - End Set - End Property - - Public Property additionalCostsType2() As String - Get - Return Me.additionalCostsType2Field - End Get - Set - Me.additionalCostsType2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntraLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntraLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntraLine object - ''' - '''string workflow markup to deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntraLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntraLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntraLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntraLine object - ''' - '''string xml file to load and deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - 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 TCustIntraLine) 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 TCustIntraLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOprInfo - - Private dutyGroup1Field As String - - Private reductionAmount1Field As Decimal - - Private reductionAmount1FieldSpecified As Boolean - - Private dutyGroup2Field As String - - Private reductionAmount2Field As Decimal - - Private reductionAmount2FieldSpecified As Boolean - - Private dutyGroup3Field As String - - Private reductionAmount3Field As Decimal - - Private reductionAmount3FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property dutyGroup1() As String - Get - Return Me.dutyGroup1Field - End Get - Set - Me.dutyGroup1Field = Value - End Set - End Property - - Public Property reductionAmount1() As Decimal - Get - Return Me.reductionAmount1Field - End Get - Set - Me.reductionAmount1Field = Value - End Set - End Property - - - Public Property reductionAmount1Specified() As Boolean - Get - Return Me.reductionAmount1FieldSpecified - End Get - Set - Me.reductionAmount1FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup2() As String - Get - Return Me.dutyGroup2Field - End Get - Set - Me.dutyGroup2Field = Value - End Set - End Property - - Public Property reductionAmount2() As Decimal - Get - Return Me.reductionAmount2Field - End Get - Set - Me.reductionAmount2Field = Value - End Set - End Property - - - Public Property reductionAmount2Specified() As Boolean - Get - Return Me.reductionAmount2FieldSpecified - End Get - Set - Me.reductionAmount2FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup3() As String - Get - Return Me.dutyGroup3Field - End Get - Set - Me.dutyGroup3Field = Value - End Set - End Property - - Public Property reductionAmount3() As Decimal - Get - Return Me.reductionAmount3Field - End Get - Set - Me.reductionAmount3Field = Value - End Set - End Property - - - Public Property reductionAmount3Specified() As Boolean - Get - Return Me.reductionAmount3FieldSpecified - End Get - Set - Me.reductionAmount3FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOprInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOprInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOprInfo object - ''' - '''string workflow markup to deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOprInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOprInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TOprInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TOprInfo object - ''' - '''string xml file to load and deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - 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 TOprInfo) 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 TOprInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutySaving - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private measuresTypeField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private additionField As Decimal - - Private additionFieldSpecified As Boolean - - Private preferentialFlagField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property addition() As Decimal - Get - Return Me.additionField - End Get - Set - Me.additionField = Value - End Set - End Property - - - Public Property additionSpecified() As Boolean - Get - Return Me.additionFieldSpecified - End Get - Set - Me.additionFieldSpecified = Value - End Set - End Property - - Public Property preferentialFlag() As String - Get - Return Me.preferentialFlagField - End Get - Set - Me.preferentialFlagField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutySaving)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutySaving object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutySaving object - ''' - '''string workflow markup to deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutySaving - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutySaving) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutySaving 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutySaving object - ''' - '''string xml file to load and deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - 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 TDutySaving) 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 TDutySaving - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutyTax - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private areaCodeField As String - - Private measuresTypeField As String - - Private dutyCodeCustomsOfficeField As String - - Private indentureNumberField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private stornoFlagField As String - - Private dutyAmountIncreaseOrDecreaseField As Decimal - - Private dutyAmountIncreaseOrDecreaseFieldSpecified As Boolean - - Private typeOfAdditionalCodeField As String - - Private noOfAdditionalCodeField As String - - Private calculatedDutyRateField As Decimal - - Private calculatedDutyRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property areaCode() As String - Get - Return Me.areaCodeField - End Get - Set - Me.areaCodeField = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyCodeCustomsOffice() As String - Get - Return Me.dutyCodeCustomsOfficeField - End Get - Set - Me.dutyCodeCustomsOfficeField = Value - End Set - End Property - - Public Property indentureNumber() As String - Get - Return Me.indentureNumberField - End Get - Set - Me.indentureNumberField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property stornoFlag() As String - Get - Return Me.stornoFlagField - End Get - Set - Me.stornoFlagField = Value - End Set - End Property - - Public Property dutyAmountIncreaseOrDecrease() As Decimal - Get - Return Me.dutyAmountIncreaseOrDecreaseField - End Get - Set - Me.dutyAmountIncreaseOrDecreaseField = Value - End Set - End Property - - - Public Property dutyAmountIncreaseOrDecreaseSpecified() As Boolean - Get - Return Me.dutyAmountIncreaseOrDecreaseFieldSpecified - End Get - Set - Me.dutyAmountIncreaseOrDecreaseFieldSpecified = Value - End Set - End Property - - Public Property typeOfAdditionalCode() As String - Get - Return Me.typeOfAdditionalCodeField - End Get - Set - Me.typeOfAdditionalCodeField = Value - End Set - End Property - - Public Property noOfAdditionalCode() As String - Get - Return Me.noOfAdditionalCodeField - End Get - Set - Me.noOfAdditionalCodeField = Value - End Set - End Property - - Public Property calculatedDutyRate() As Decimal - Get - Return Me.calculatedDutyRateField - End Get - Set - Me.calculatedDutyRateField = Value - End Set - End Property - - - Public Property calculatedDutyRateSpecified() As Boolean - Get - Return Me.calculatedDutyRateFieldSpecified - End Get - Set - Me.calculatedDutyRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutyTax)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutyTax object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutyTax object - ''' - '''string workflow markup to deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutyTax - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutyTax) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutyTax 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutyTax object - ''' - '''string xml file to load and deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - 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 TDutyTax) 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 TDutyTax - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDuty - - Private typeField As String - - Private calcDutyBaseField As Decimal - - Private calcDutyBaseFieldSpecified As Boolean - - Private currencyField As String - - Private codeField As String - - Private rateField As Decimal - - Private rateFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private addDeductField As Decimal - - Private addDeductFieldSpecified As Boolean - - Private calcDutyField As Decimal - - Private calcDutyFieldSpecified As Boolean - - Private dutyField As Decimal - - Private dutyFieldSpecified As Boolean - - Private dutyBaseField As Decimal - - Private dutyBaseFieldSpecified As Boolean - - Private measureCodeField As String - - Private measureField As String - - Private authorityDutyCodeField As String - - Private territoryField As String - - Private typeAddCodeField As String - - Private numberAddCodeField As String - - Private tariffRateQuotaField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property calcDutyBase() As Decimal - Get - Return Me.calcDutyBaseField - End Get - Set - Me.calcDutyBaseField = Value - End Set - End Property - - - Public Property calcDutyBaseSpecified() As Boolean - Get - Return Me.calcDutyBaseFieldSpecified - End Get - Set - Me.calcDutyBaseFieldSpecified = Value - End Set - End Property - - Public Property currency() As String - Get - Return Me.currencyField - End Get - Set - Me.currencyField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property rate() As Decimal - Get - Return Me.rateField - End Get - Set - Me.rateField = Value - End Set - End Property - - - Public Property rateSpecified() As Boolean - Get - Return Me.rateFieldSpecified - End Get - Set - Me.rateFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property addDeduct() As Decimal - Get - Return Me.addDeductField - End Get - Set - Me.addDeductField = Value - End Set - End Property - - - Public Property addDeductSpecified() As Boolean - Get - Return Me.addDeductFieldSpecified - End Get - Set - Me.addDeductFieldSpecified = Value - End Set - End Property - - Public Property calcDuty() As Decimal - Get - Return Me.calcDutyField - End Get - Set - Me.calcDutyField = Value - End Set - End Property - - - Public Property calcDutySpecified() As Boolean - Get - Return Me.calcDutyFieldSpecified - End Get - Set - Me.calcDutyFieldSpecified = Value - End Set - End Property - - Public Property duty() As Decimal - Get - Return Me.dutyField - End Get - Set - Me.dutyField = Value - End Set - End Property - - - Public Property dutySpecified() As Boolean - Get - Return Me.dutyFieldSpecified - End Get - Set - Me.dutyFieldSpecified = Value - End Set - End Property - - Public Property dutyBase() As Decimal - Get - Return Me.dutyBaseField - End Get - Set - Me.dutyBaseField = Value - End Set - End Property - - - Public Property dutyBaseSpecified() As Boolean - Get - Return Me.dutyBaseFieldSpecified - End Get - Set - Me.dutyBaseFieldSpecified = Value - End Set - End Property - - Public Property measureCode() As String - Get - Return Me.measureCodeField - End Get - Set - Me.measureCodeField = Value - End Set - End Property - - Public Property measure() As String - Get - Return Me.measureField - End Get - Set - Me.measureField = Value - End Set - End Property - - Public Property authorityDutyCode() As String - Get - Return Me.authorityDutyCodeField - End Get - Set - Me.authorityDutyCodeField = Value - End Set - End Property - - Public Property territory() As String - Get - Return Me.territoryField - End Get - Set - Me.territoryField = Value - End Set - End Property - - Public Property typeAddCode() As String - Get - Return Me.typeAddCodeField - End Get - Set - Me.typeAddCodeField = Value - End Set - End Property - - Public Property numberAddCode() As String - Get - Return Me.numberAddCodeField - End Get - Set - Me.numberAddCodeField = Value - End Set - End Property - - Public Property tariffRateQuota() As String - Get - Return Me.tariffRateQuotaField - End Get - Set - Me.tariffRateQuotaField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDuty)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDuty object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDuty object - ''' - '''string workflow markup to deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDuty - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDuty) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDuty 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDuty object - ''' - '''string xml file to load and deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - 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 TDuty) 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 TDuty - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValuesCust - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private additionalStatisticalValueField As Decimal - - Private additionalStatisticalValueFieldSpecified As Boolean - - Private additionalCostsVatField As Decimal - - Private additionalCostsVatFieldSpecified As Boolean - - Private addStatisticValueField As Decimal - - Private addStatisticValueFieldSpecified As Boolean - - Private oprIngredientsValueField As Decimal - - Private oprIngredientsValueFieldSpecified As Boolean - - Private additionalCosts1Field As Decimal - - Private additionalCosts1FieldSpecified As Boolean - - Private additionalCosts2Field As Decimal - - Private additionalCosts2FieldSpecified As Boolean - - Private additionalCosts3Field As Decimal - - Private additionalCosts3FieldSpecified As Boolean - - Private additionalCosts4Field As Decimal - - Private additionalCosts4FieldSpecified As Boolean - - Private additionalCosts5Field As Decimal - - Private additionalCosts5FieldSpecified As Boolean - - Private additionalCosts6Field As Decimal - - Private additionalCosts6FieldSpecified As Boolean - - Private additionalCosts7Field As Decimal - - Private additionalCosts7FieldSpecified As Boolean - - Private additionalCosts8Field As Decimal - - Private additionalCosts8FieldSpecified As Boolean - - Private additionalCosts9Field As Decimal - - Private additionalCosts9FieldSpecified As Boolean - - Private additionalCosts10Field As Decimal - - Private additionalCosts10FieldSpecified As Boolean - - Private additionalCosts11Field As Decimal - - Private additionalCosts11FieldSpecified As Boolean - - Private additionalCosts12Field As Decimal - - Private additionalCosts12FieldSpecified As Boolean - - Private additionalCosts13Field As Decimal - - Private additionalCosts13FieldSpecified As Boolean - - Private additionalCosts14Field As Decimal - - Private additionalCosts14FieldSpecified As Boolean - - Private additionalCosts15Field As Decimal - - Private additionalCosts15FieldSpecified As Boolean - - Private additionalCosts16Field As Decimal - - Private additionalCosts16FieldSpecified As Boolean - - Private additionalCosts17Field As Decimal - - Private additionalCosts17FieldSpecified As Boolean - - Private additionalCosts18Field As Decimal - - Private additionalCosts18FieldSpecified As Boolean - - Private additionalCosts19Field As Decimal - - Private additionalCosts19FieldSpecified As Boolean - - Private additionalCosts20Field As Decimal - - Private additionalCosts20FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property additionalStatisticalValue() As Decimal - Get - Return Me.additionalStatisticalValueField - End Get - Set - Me.additionalStatisticalValueField = Value - End Set - End Property - - - Public Property additionalStatisticalValueSpecified() As Boolean - Get - Return Me.additionalStatisticalValueFieldSpecified - End Get - Set - Me.additionalStatisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsVat() As Decimal - Get - Return Me.additionalCostsVatField - End Get - Set - Me.additionalCostsVatField = Value - End Set - End Property - - - Public Property additionalCostsVatSpecified() As Boolean - Get - Return Me.additionalCostsVatFieldSpecified - End Get - Set - Me.additionalCostsVatFieldSpecified = Value - End Set - End Property - - Public Property addStatisticValue() As Decimal - Get - Return Me.addStatisticValueField - End Get - Set - Me.addStatisticValueField = Value - End Set - End Property - - - Public Property addStatisticValueSpecified() As Boolean - Get - Return Me.addStatisticValueFieldSpecified - End Get - Set - Me.addStatisticValueFieldSpecified = Value - End Set - End Property - - Public Property oprIngredientsValue() As Decimal - Get - Return Me.oprIngredientsValueField - End Get - Set - Me.oprIngredientsValueField = Value - End Set - End Property - - - Public Property oprIngredientsValueSpecified() As Boolean - Get - Return Me.oprIngredientsValueFieldSpecified - End Get - Set - Me.oprIngredientsValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCosts1() As Decimal - Get - Return Me.additionalCosts1Field - End Get - Set - Me.additionalCosts1Field = Value - End Set - End Property - - - Public Property additionalCosts1Specified() As Boolean - Get - Return Me.additionalCosts1FieldSpecified - End Get - Set - Me.additionalCosts1FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts2() As Decimal - Get - Return Me.additionalCosts2Field - End Get - Set - Me.additionalCosts2Field = Value - End Set - End Property - - - Public Property additionalCosts2Specified() As Boolean - Get - Return Me.additionalCosts2FieldSpecified - End Get - Set - Me.additionalCosts2FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts3() As Decimal - Get - Return Me.additionalCosts3Field - End Get - Set - Me.additionalCosts3Field = Value - End Set - End Property - - - Public Property additionalCosts3Specified() As Boolean - Get - Return Me.additionalCosts3FieldSpecified - End Get - Set - Me.additionalCosts3FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts4() As Decimal - Get - Return Me.additionalCosts4Field - End Get - Set - Me.additionalCosts4Field = Value - End Set - End Property - - - Public Property additionalCosts4Specified() As Boolean - Get - Return Me.additionalCosts4FieldSpecified - End Get - Set - Me.additionalCosts4FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts5() As Decimal - Get - Return Me.additionalCosts5Field - End Get - Set - Me.additionalCosts5Field = Value - End Set - End Property - - - Public Property additionalCosts5Specified() As Boolean - Get - Return Me.additionalCosts5FieldSpecified - End Get - Set - Me.additionalCosts5FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts6() As Decimal - Get - Return Me.additionalCosts6Field - End Get - Set - Me.additionalCosts6Field = Value - End Set - End Property - - - Public Property additionalCosts6Specified() As Boolean - Get - Return Me.additionalCosts6FieldSpecified - End Get - Set - Me.additionalCosts6FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts7() As Decimal - Get - Return Me.additionalCosts7Field - End Get - Set - Me.additionalCosts7Field = Value - End Set - End Property - - - Public Property additionalCosts7Specified() As Boolean - Get - Return Me.additionalCosts7FieldSpecified - End Get - Set - Me.additionalCosts7FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts8() As Decimal - Get - Return Me.additionalCosts8Field - End Get - Set - Me.additionalCosts8Field = Value - End Set - End Property - - - Public Property additionalCosts8Specified() As Boolean - Get - Return Me.additionalCosts8FieldSpecified - End Get - Set - Me.additionalCosts8FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts9() As Decimal - Get - Return Me.additionalCosts9Field - End Get - Set - Me.additionalCosts9Field = Value - End Set - End Property - - - Public Property additionalCosts9Specified() As Boolean - Get - Return Me.additionalCosts9FieldSpecified - End Get - Set - Me.additionalCosts9FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts10() As Decimal - Get - Return Me.additionalCosts10Field - End Get - Set - Me.additionalCosts10Field = Value - End Set - End Property - - - Public Property additionalCosts10Specified() As Boolean - Get - Return Me.additionalCosts10FieldSpecified - End Get - Set - Me.additionalCosts10FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts11() As Decimal - Get - Return Me.additionalCosts11Field - End Get - Set - Me.additionalCosts11Field = Value - End Set - End Property - - - Public Property additionalCosts11Specified() As Boolean - Get - Return Me.additionalCosts11FieldSpecified - End Get - Set - Me.additionalCosts11FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts12() As Decimal - Get - Return Me.additionalCosts12Field - End Get - Set - Me.additionalCosts12Field = Value - End Set - End Property - - - Public Property additionalCosts12Specified() As Boolean - Get - Return Me.additionalCosts12FieldSpecified - End Get - Set - Me.additionalCosts12FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts13() As Decimal - Get - Return Me.additionalCosts13Field - End Get - Set - Me.additionalCosts13Field = Value - End Set - End Property - - - Public Property additionalCosts13Specified() As Boolean - Get - Return Me.additionalCosts13FieldSpecified - End Get - Set - Me.additionalCosts13FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts14() As Decimal - Get - Return Me.additionalCosts14Field - End Get - Set - Me.additionalCosts14Field = Value - End Set - End Property - - - Public Property additionalCosts14Specified() As Boolean - Get - Return Me.additionalCosts14FieldSpecified - End Get - Set - Me.additionalCosts14FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts15() As Decimal - Get - Return Me.additionalCosts15Field - End Get - Set - Me.additionalCosts15Field = Value - End Set - End Property - - - Public Property additionalCosts15Specified() As Boolean - Get - Return Me.additionalCosts15FieldSpecified - End Get - Set - Me.additionalCosts15FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts16() As Decimal - Get - Return Me.additionalCosts16Field - End Get - Set - Me.additionalCosts16Field = Value - End Set - End Property - - - Public Property additionalCosts16Specified() As Boolean - Get - Return Me.additionalCosts16FieldSpecified - End Get - Set - Me.additionalCosts16FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts17() As Decimal - Get - Return Me.additionalCosts17Field - End Get - Set - Me.additionalCosts17Field = Value - End Set - End Property - - - Public Property additionalCosts17Specified() As Boolean - Get - Return Me.additionalCosts17FieldSpecified - End Get - Set - Me.additionalCosts17FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts18() As Decimal - Get - Return Me.additionalCosts18Field - End Get - Set - Me.additionalCosts18Field = Value - End Set - End Property - - - Public Property additionalCosts18Specified() As Boolean - Get - Return Me.additionalCosts18FieldSpecified - End Get - Set - Me.additionalCosts18FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts19() As Decimal - Get - Return Me.additionalCosts19Field - End Get - Set - Me.additionalCosts19Field = Value - End Set - End Property - - - Public Property additionalCosts19Specified() As Boolean - Get - Return Me.additionalCosts19FieldSpecified - End Get - Set - Me.additionalCosts19FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts20() As Decimal - Get - Return Me.additionalCosts20Field - End Get - Set - Me.additionalCosts20Field = Value - End Set - End Property - - - Public Property additionalCosts20Specified() As Boolean - Get - Return Me.additionalCosts20FieldSpecified - End Get - Set - Me.additionalCosts20FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValuesCust)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValuesCust object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValuesCust object - ''' - '''string workflow markup to deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValuesCust - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValuesCust) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValuesCust 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValuesCust object - ''' - '''string xml file to load and deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - 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 TCalcValuesCust) 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 TCalcValuesCust - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValues - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private statValueField As Decimal - - Private statValueFieldSpecified As Boolean - - Private freightStatValField As Decimal - - Private freightStatValFieldSpecified As Boolean - - Private freightInternationalField As Decimal - - Private freightInternationalFieldSpecified As Boolean - - Private freightEUField As Decimal - - Private freightEUFieldSpecified As Boolean - - Private freightNationalField As Decimal - - Private freightNationalFieldSpecified As Boolean - - Private insuranceField As Decimal - - Private insuranceFieldSpecified As Boolean - - Private shipAddCostsField As List(Of Decimal) - - Private invAddCostsField As List(Of Decimal) - - Private lineAddCostsField As List(Of Decimal) - - Private custValueField As Decimal - - Private custValueFieldSpecified As Boolean - - Private assistValueField As Decimal - - Private assistValueFieldSpecified As Boolean - - Private vatAddCostsField As Decimal - - Private vatAddCostsFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.lineAddCostsField = New List(Of Decimal)() - Me.invAddCostsField = New List(Of Decimal)() - Me.shipAddCostsField = New List(Of Decimal)() - End Sub - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property statValue() As Decimal - Get - Return Me.statValueField - End Get - Set - Me.statValueField = Value - End Set - End Property - - - Public Property statValueSpecified() As Boolean - Get - Return Me.statValueFieldSpecified - End Get - Set - Me.statValueFieldSpecified = Value - End Set - End Property - - Public Property freightStatVal() As Decimal - Get - Return Me.freightStatValField - End Get - Set - Me.freightStatValField = Value - End Set - End Property - - - Public Property freightStatValSpecified() As Boolean - Get - Return Me.freightStatValFieldSpecified - End Get - Set - Me.freightStatValFieldSpecified = Value - End Set - End Property - - Public Property freightInternational() As Decimal - Get - Return Me.freightInternationalField - End Get - Set - Me.freightInternationalField = Value - End Set - End Property - - - Public Property freightInternationalSpecified() As Boolean - Get - Return Me.freightInternationalFieldSpecified - End Get - Set - Me.freightInternationalFieldSpecified = Value - End Set - End Property - - Public Property freightEU() As Decimal - Get - Return Me.freightEUField - End Get - Set - Me.freightEUField = Value - End Set - End Property - - - Public Property freightEUSpecified() As Boolean - Get - Return Me.freightEUFieldSpecified - End Get - Set - Me.freightEUFieldSpecified = Value - End Set - End Property - - Public Property freightNational() As Decimal - Get - Return Me.freightNationalField - End Get - Set - Me.freightNationalField = Value - End Set - End Property - - - Public Property freightNationalSpecified() As Boolean - Get - Return Me.freightNationalFieldSpecified - End Get - Set - Me.freightNationalFieldSpecified = Value - End Set - End Property - - Public Property insurance() As Decimal - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - - Public Property insuranceSpecified() As Boolean - Get - Return Me.insuranceFieldSpecified - End Get - Set - Me.insuranceFieldSpecified = Value - End Set - End Property - - Public Property shipAddCosts() As List(Of Decimal) - Get - Return Me.shipAddCostsField - End Get - Set - Me.shipAddCostsField = Value - End Set - End Property - - Public Property invAddCosts() As List(Of Decimal) - Get - Return Me.invAddCostsField - End Get - Set - Me.invAddCostsField = Value - End Set - End Property - - Public Property lineAddCosts() As List(Of Decimal) - Get - Return Me.lineAddCostsField - End Get - Set - Me.lineAddCostsField = Value - End Set - End Property - - Public Property custValue() As Decimal - Get - Return Me.custValueField - End Get - Set - Me.custValueField = Value - End Set - End Property - - - Public Property custValueSpecified() As Boolean - Get - Return Me.custValueFieldSpecified - End Get - Set - Me.custValueFieldSpecified = Value - End Set - End Property - - Public Property assistValue() As Decimal - Get - Return Me.assistValueField - End Get - Set - Me.assistValueField = Value - End Set - End Property - - - Public Property assistValueSpecified() As Boolean - Get - Return Me.assistValueFieldSpecified - End Get - Set - Me.assistValueFieldSpecified = Value - End Set - End Property - - Public Property vatAddCosts() As Decimal - Get - Return Me.vatAddCostsField - End Get - Set - Me.vatAddCostsField = Value - End Set - End Property - - - Public Property vatAddCostsSpecified() As Boolean - Get - Return Me.vatAddCostsFieldSpecified - End Get - Set - Me.vatAddCostsFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValues)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValues object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValues object - ''' - '''string workflow markup to deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValues - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValues) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValues 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValues object - ''' - '''string xml file to load and deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - 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 TCalcValues) 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 TCalcValues - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDetailContainerInfo - - Private containerNumberField As String - - Private containerSealNumberField As String - - Private containerPackagesField As Decimal - - Private containerPackagesFieldSpecified As Boolean - - Private containerGrossWeightField As Decimal - - Private containerGrossWeightFieldSpecified As Boolean - - Private containerNetWeightField As Decimal - - Private containerNetWeightFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerSealNumber() As String - Get - Return Me.containerSealNumberField - End Get - Set - Me.containerSealNumberField = Value - End Set - End Property - - Public Property containerPackages() As Decimal - Get - Return Me.containerPackagesField - End Get - Set - Me.containerPackagesField = Value - End Set - End Property - - - Public Property containerPackagesSpecified() As Boolean - Get - Return Me.containerPackagesFieldSpecified - End Get - Set - Me.containerPackagesFieldSpecified = Value - End Set - End Property - - Public Property containerGrossWeight() As Decimal - Get - Return Me.containerGrossWeightField - End Get - Set - Me.containerGrossWeightField = Value - End Set - End Property - - - Public Property containerGrossWeightSpecified() As Boolean - Get - Return Me.containerGrossWeightFieldSpecified - End Get - Set - Me.containerGrossWeightFieldSpecified = Value - End Set - End Property - - Public Property containerNetWeight() As Decimal - Get - Return Me.containerNetWeightField - End Get - Set - Me.containerNetWeightField = Value - End Set - End Property - - - Public Property containerNetWeightSpecified() As Boolean - Get - Return Me.containerNetWeightFieldSpecified - End Get - Set - Me.containerNetWeightFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDetailContainerInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDetailContainerInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDetailContainerInfo object - ''' - '''string workflow markup to deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDetailContainerInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDetailContainerInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDetailContainerInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDetailContainerInfo object - ''' - '''string xml file to load and deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - 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 TDetailContainerInfo) 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 TDetailContainerInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportRegistrationNo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private registrationNumber4Field As String - - Private messageRefNumber1Field As String - - Private messageRefNumber2Field As String - - Private messageRefNumber3Field As String - - Private positionNumber1Field As Decimal - - Private positionNumber1FieldSpecified As Boolean - - Private positionNumber2Field As Decimal - - Private positionNumber2FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property registrationNumber4() As String - Get - Return Me.registrationNumber4Field - End Get - Set - Me.registrationNumber4Field = Value - End Set - End Property - - Public Property messageRefNumber1() As String - Get - Return Me.messageRefNumber1Field - End Get - Set - Me.messageRefNumber1Field = Value - End Set - End Property - - Public Property messageRefNumber2() As String - Get - Return Me.messageRefNumber2Field - End Get - Set - Me.messageRefNumber2Field = Value - End Set - End Property - - Public Property messageRefNumber3() As String - Get - Return Me.messageRefNumber3Field - End Get - Set - Me.messageRefNumber3Field = Value - End Set - End Property - - Public Property positionNumber1() As Decimal - Get - Return Me.positionNumber1Field - End Get - Set - Me.positionNumber1Field = Value - End Set - End Property - - - Public Property positionNumber1Specified() As Boolean - Get - Return Me.positionNumber1FieldSpecified - End Get - Set - Me.positionNumber1FieldSpecified = Value - End Set - End Property - - Public Property positionNumber2() As Decimal - Get - Return Me.positionNumber2Field - End Get - Set - Me.positionNumber2Field = Value - End Set - End Property - - - Public Property positionNumber2Specified() As Boolean - Get - Return Me.positionNumber2FieldSpecified - End Get - Set - Me.positionNumber2FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportRegistrationNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportRegistrationNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportRegistrationNo object - ''' - '''string workflow markup to deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportRegistrationNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportRegistrationNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportRegistrationNo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportRegistrationNo object - ''' - '''string xml file to load and deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - 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 TImportRegistrationNo) 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 TImportRegistrationNo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReceipt - - Private receiptNumberField As String - - Private receiptDateField As Date - - Private receiptDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property receiptNumber() As String - Get - Return Me.receiptNumberField - End Get - Set - Me.receiptNumberField = Value - End Set - End Property - - Public Property receiptDate() As Date - Get - Return Me.receiptDateField - End Get - Set - Me.receiptDateField = Value - End Set - End Property - - - Public Property receiptDateSpecified() As Boolean - Get - Return Me.receiptDateFieldSpecified - End Get - Set - Me.receiptDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReceipt)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReceipt object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReceipt object - ''' - '''string workflow markup to deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReceipt - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReceipt) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TReceipt 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TReceipt object - ''' - '''string xml file to load and deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - 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 TReceipt) 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 TReceipt - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private packageDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property packageDescription() As String - Get - Return Me.packageDescriptionField - End Get - Set - Me.packageDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBom - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBom)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBom object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBom object - ''' - '''string workflow markup to deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBom - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBom) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TBom 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TBom object - ''' - '''string xml file to load and deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - 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 TBom) 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 TBom - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrevDoc - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private previousDocDateField As Date - - Private previousDocDateFieldSpecified As Boolean - - Private departureCustomsOfficeField As String - - Private destinationCustomsOfficeField As String - - Private typeField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property previousDocDate() As Date - Get - Return Me.previousDocDateField - End Get - Set - Me.previousDocDateField = Value - End Set - End Property - - - Public Property previousDocDateSpecified() As Boolean - Get - Return Me.previousDocDateFieldSpecified - End Get - Set - Me.previousDocDateFieldSpecified = Value - End Set - End Property - - Public Property departureCustomsOffice() As String - Get - Return Me.departureCustomsOfficeField - End Get - Set - Me.departureCustomsOfficeField = Value - End Set - End Property - - Public Property destinationCustomsOffice() As String - Get - Return Me.destinationCustomsOfficeField - End Get - Set - Me.destinationCustomsOfficeField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrevDoc)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrevDoc object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrevDoc object - ''' - '''string workflow markup to deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrevDoc - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrevDoc) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrevDoc 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrevDoc object - ''' - '''string xml file to load and deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - 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 TPrevDoc) 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 TPrevDoc - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCostsVAT - - Private addAmountVATField As Decimal - - Private addAmountVATFieldSpecified As Boolean - - Private addCurrencyVATField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addAmountVAT() As Decimal - Get - Return Me.addAmountVATField - End Get - Set - Me.addAmountVATField = Value - End Set - End Property - - - Public Property addAmountVATSpecified() As Boolean - Get - Return Me.addAmountVATFieldSpecified - End Get - Set - Me.addAmountVATFieldSpecified = Value - End Set - End Property - - Public Property addCurrencyVAT() As String - Get - Return Me.addCurrencyVATField - End Get - Set - Me.addCurrencyVATField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCostsVAT)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCostsVAT object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCostsVAT object - ''' - '''string workflow markup to deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCostsVAT - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCostsVAT) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAddCostsVAT 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAddCostsVAT object - ''' - '''string xml file to load and deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - 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 TAddCostsVAT) 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 TAddCostsVAT - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebateLine - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebateLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebateLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebateLine object - ''' - '''string workflow markup to deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebateLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebateLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebateLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebateLine object - ''' - '''string xml file to load and deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - 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 TRebateLine) 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 TRebateLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsLine - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - 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 TInsuranceCostsLine) 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 TInsuranceCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsLine - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtFlagPercentOrValueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.frtFlagPercentOrValueField = "P" - End Sub - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - - Public Property frtFlagPercentOrValue() As String - Get - Return Me.frtFlagPercentOrValueField - End Get - Set - Me.frtFlagPercentOrValueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - 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 TFreightCostsLine) 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 TFreightCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPricing - - Private prcTypeField As String - - Private prcReferenceField As String - - Private prcDateField As Date - - Private prcDateFieldSpecified As Boolean - - Private prcSystemField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property prcType() As String - Get - Return Me.prcTypeField - End Get - Set - Me.prcTypeField = Value - End Set - End Property - - Public Property prcReference() As String - Get - Return Me.prcReferenceField - End Get - Set - Me.prcReferenceField = Value - End Set - End Property - - Public Property prcDate() As Date - Get - Return Me.prcDateField - End Get - Set - Me.prcDateField = Value - End Set - End Property - - - Public Property prcDateSpecified() As Boolean - Get - Return Me.prcDateFieldSpecified - End Get - Set - Me.prcDateFieldSpecified = Value - End Set - End Property - - Public Property prcSystem() As String - Get - Return Me.prcSystemField - End Get - Set - Me.prcSystemField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPricing)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPricing object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPricing object - ''' - '''string workflow markup to deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPricing - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPricing) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPricing 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPricing object - ''' - '''string xml file to load and deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - 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 TPricing) 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 TPricing - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportLineLicense - - Private typeField As String - - Private codeField As String - - Private numberField As String - - Private dateField As Date - - Private dateFieldSpecified As Boolean - - Private notRequiredField As Boolean - - Private notRequiredFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property number() As String - Get - Return Me.numberField - End Get - Set - Me.numberField = Value - End Set - End Property - - Public Property [date]() As Date - Get - Return Me.dateField - End Get - Set - Me.dateField = Value - End Set - End Property - - - Public Property dateSpecified() As Boolean - Get - Return Me.dateFieldSpecified - End Get - Set - Me.dateFieldSpecified = Value - End Set - End Property - - Public Property notRequired() As Boolean - Get - Return Me.notRequiredField - End Get - Set - Me.notRequiredField = Value - End Set - End Property - - - Public Property notRequiredSpecified() As Boolean - Get - Return Me.notRequiredFieldSpecified - End Get - Set - Me.notRequiredFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportLineLicense)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportLineLicense object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportLineLicense object - ''' - '''string workflow markup to deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportLineLicense - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportLineLicense) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportLineLicense 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportLineLicense object - ''' - '''string xml file to load and deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - 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 TImportLineLicense) 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 TImportLineLicense - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TTariffCode - - Private hsCodeField As String - - Private vatCodeField As String - - Private exciseTaxCodeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property hsCode() As String - Get - Return Me.hsCodeField - End Get - Set - Me.hsCodeField = Value - End Set - End Property - - Public Property vatCode() As String - Get - Return Me.vatCodeField - End Get - Set - Me.vatCodeField = Value - End Set - End Property - - Public Property exciseTaxCode() As String - Get - Return Me.exciseTaxCodeField - End Get - Set - Me.exciseTaxCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TTariffCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TTariffCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TTariffCode object - ''' - '''string workflow markup to deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TTariffCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TTariffCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TTariffCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TTariffCode object - ''' - '''string xml file to load and deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - 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 TTariffCode) 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 TTariffCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private partNumberField As String - - Private partDescriptionField As String - - Private serialNumberField As String - - Private productGroupField As String - - Private modelField As String - - Private brandField As String - - Private manufacturerNumberField As String - - Private ctoNumberField As String - - Private confidenceLevelField As Long - - Private confidenceLevelFieldSpecified As Boolean - - Private productCategoryField As String - - Private tariffCodeField As TTariffCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tariffCodeField = New TTariffCode() - End Sub - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Public Property serialNumber() As String - Get - Return Me.serialNumberField - End Get - Set - Me.serialNumberField = Value - End Set - End Property - - Public Property productGroup() As String - Get - Return Me.productGroupField - End Get - Set - Me.productGroupField = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property manufacturerNumber() As String - Get - Return Me.manufacturerNumberField - End Get - Set - Me.manufacturerNumberField = Value - End Set - End Property - - Public Property ctoNumber() As String - Get - Return Me.ctoNumberField - End Get - Set - Me.ctoNumberField = Value - End Set - End Property - - Public Property confidenceLevel() As Long - Get - Return Me.confidenceLevelField - End Get - Set - Me.confidenceLevelField = Value - End Set - End Property - - - Public Property confidenceLevelSpecified() As Boolean - Get - Return Me.confidenceLevelFieldSpecified - End Get - Set - Me.confidenceLevelFieldSpecified = Value - End Set - End Property - - Public Property productCategory() As String - Get - Return Me.productCategoryField - End Get - Set - Me.productCategoryField = Value - End Set - End Property - - Public Property TariffCode() As TTariffCode - Get - Return Me.tariffCodeField - End Get - Set - Me.tariffCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNumberField As Decimal - - Private itemField As TItem - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private quantityUomField As String - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private reportingQuantityField As Decimal - - Private reportingQuantityFieldSpecified As Boolean - - Private reportingQuantityUomField As String - - Private priceField As Decimal - - Private priceFieldSpecified As Boolean - - Private lineValueField As Decimal - - Private lineValueFieldSpecified As Boolean - - Private licenseField As TImportLineLicense - - Private pricingField As TPricing - - Private freightCostsField As TFreightCostsLine - - Private insuranceCostsField As TInsuranceCostsLine - - Private additionalCostField As List(Of TAddCosts) - - Private rebateField As TRebateLine - - Private additionalCostsVATField As TAddCostsVAT - - Private countryOfOriginField As String - - Private prefCountryOfOriginField As String - - Private locationOfGoodsField As String - - Private importQuotaField As String - - Private importQuotaKeyField As String - - Private importQuotaQuantityField As Decimal - - Private importQuotaQuantityFieldSpecified As Boolean - - Private importQuotaUnitOfMeasurementField As String - - Private importQuotaQualifierField As String - - Private customsProcedureField As String - - Private statisticalCodeField As String - - Private endUseIndicatorField As String - - Private transactionTypeField As String - - Private addCodeField As List(Of String) - - Private prefRequestCodeField As String - - Private documentsField As List(Of TDocument) - - Private previousDocumentField As List(Of TPrevDoc) - - Private bOMField As TBom - - Private stockTypeField As String - - Private stockType2Field As String - - Private stockExpiryDateField As Date - - Private stockExpiryDateFieldSpecified As Boolean - - Private packageField As TPackage - - Private accountNumberField As String - - Private deliveryNoteField As String - - Private orderNumberField As String - - Private receiptField As TReceipt - - Private asnNumberField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private referenceCurrencyField As String - - Private textField As String - - Private text2Field As String - - Private registrationNumbersField As TImportRegistrationNo - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containerInfoField As List(Of TDetailContainerInfo) - - Private partnersField As List(Of TPartner) - - Private calculatedValuesField As TCalcValues - - Private calculatedValuesCustField As TCalcValuesCust - - Private dutiesField As List(Of TDuty) - - Private dutyTaxesField As List(Of TDutyTax) - - Private dutySavingsField As List(Of TDutySaving) - - Private oprDetailsField As TOprInfo - - Private uniqueIdField As Decimal - - Private uniqueIdFieldSpecified As Boolean - - Private externalProcessingField As String - - Private additionalInformationField As List(Of TAttribute) - - Private intraField As TCustIntraLine - - Private preSupplierField As TPreSupplier - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private valuationIndicatorField As String - - Private referencePreviousProceduresField As List(Of TRefPrevProcedure) - - Private packagesDataField As TPackagesData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packagesDataField = New TPackagesData() - Me.referencePreviousProceduresField = New List(Of TRefPrevProcedure)() - Me.preSupplierField = New TPreSupplier() - Me.intraField = New TCustIntraLine() - Me.additionalInformationField = New List(Of TAttribute)() - Me.oprDetailsField = New TOprInfo() - Me.dutySavingsField = New List(Of TDutySaving)() - Me.dutyTaxesField = New List(Of TDutyTax)() - Me.dutiesField = New List(Of TDuty)() - Me.calculatedValuesCustField = New TCalcValuesCust() - Me.calculatedValuesField = New TCalcValues() - Me.partnersField = New List(Of TPartner)() - Me.containerInfoField = New List(Of TDetailContainerInfo)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.registrationNumbersField = New TImportRegistrationNo() - Me.receiptField = New TReceipt() - Me.packageField = New TPackage() - Me.bOMField = New TBom() - Me.previousDocumentField = New List(Of TPrevDoc)() - Me.documentsField = New List(Of TDocument)() - Me.addCodeField = New List(Of String)() - Me.additionalCostsVATField = New TAddCostsVAT() - Me.rebateField = New TRebateLine() - Me.additionalCostField = New List(Of TAddCosts)() - Me.insuranceCostsField = New TInsuranceCostsLine() - Me.freightCostsField = New TFreightCostsLine() - Me.pricingField = New TPricing() - Me.licenseField = New TImportLineLicense() - Me.itemField = New TItem() - End Sub - - Public Property lineNumber() As Decimal - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - Public Property Item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property quantityUom() As String - Get - Return Me.quantityUomField - End Get - Set - Me.quantityUomField = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantity() As Decimal - Get - Return Me.reportingQuantityField - End Get - Set - Me.reportingQuantityField = Value - End Set - End Property - - - Public Property reportingQuantitySpecified() As Boolean - Get - Return Me.reportingQuantityFieldSpecified - End Get - Set - Me.reportingQuantityFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantityUom() As String - Get - Return Me.reportingQuantityUomField - End Get - Set - Me.reportingQuantityUomField = Value - End Set - End Property - - Public Property price() As Decimal - Get - Return Me.priceField - End Get - Set - Me.priceField = Value - End Set - End Property - - - Public Property priceSpecified() As Boolean - Get - Return Me.priceFieldSpecified - End Get - Set - Me.priceFieldSpecified = Value - End Set - End Property - - Public Property lineValue() As Decimal - Get - Return Me.lineValueField - End Get - Set - Me.lineValueField = Value - End Set - End Property - - - Public Property lineValueSpecified() As Boolean - Get - Return Me.lineValueFieldSpecified - End Get - Set - Me.lineValueFieldSpecified = Value - End Set - End Property - - Public Property License() As TImportLineLicense - Get - Return Me.licenseField - End Get - Set - Me.licenseField = Value - End Set - End Property - - Public Property Pricing() As TPricing - Get - Return Me.pricingField - End Get - Set - Me.pricingField = Value - End Set - End Property - - Public Property FreightCosts() As TFreightCostsLine - Get - Return Me.freightCostsField - End Get - Set - Me.freightCostsField = Value - End Set - End Property - - Public Property InsuranceCosts() As TInsuranceCostsLine - Get - Return Me.insuranceCostsField - End Get - Set - Me.insuranceCostsField = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property Rebate() As TRebateLine - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property AdditionalCostsVAT() As TAddCostsVAT - Get - Return Me.additionalCostsVATField - End Get - Set - Me.additionalCostsVATField = Value - End Set - End Property - - Public Property countryOfOrigin() As String - Get - Return Me.countryOfOriginField - End Get - Set - Me.countryOfOriginField = Value - End Set - End Property - - Public Property prefCountryOfOrigin() As String - Get - Return Me.prefCountryOfOriginField - End Get - Set - Me.prefCountryOfOriginField = Value - End Set - End Property - - Public Property locationOfGoods() As String - Get - Return Me.locationOfGoodsField - End Get - Set - Me.locationOfGoodsField = Value - End Set - End Property - - Public Property importQuota() As String - Get - Return Me.importQuotaField - End Get - Set - Me.importQuotaField = Value - End Set - End Property - - Public Property importQuotaKey() As String - Get - Return Me.importQuotaKeyField - End Get - Set - Me.importQuotaKeyField = Value - End Set - End Property - - Public Property importQuotaQuantity() As Decimal - Get - Return Me.importQuotaQuantityField - End Get - Set - Me.importQuotaQuantityField = Value - End Set - End Property - - - Public Property importQuotaQuantitySpecified() As Boolean - Get - Return Me.importQuotaQuantityFieldSpecified - End Get - Set - Me.importQuotaQuantityFieldSpecified = Value - End Set - End Property - - Public Property importQuotaUnitOfMeasurement() As String - Get - Return Me.importQuotaUnitOfMeasurementField - End Get - Set - Me.importQuotaUnitOfMeasurementField = Value - End Set - End Property - - Public Property importQuotaQualifier() As String - Get - Return Me.importQuotaQualifierField - End Get - Set - Me.importQuotaQualifierField = Value - End Set - End Property - - Public Property customsProcedure() As String - Get - Return Me.customsProcedureField - End Get - Set - Me.customsProcedureField = Value - End Set - End Property - - Public Property statisticalCode() As String - Get - Return Me.statisticalCodeField - End Get - Set - Me.statisticalCodeField = Value - End Set - End Property - - Public Property endUseIndicator() As String - Get - Return Me.endUseIndicatorField - End Get - Set - Me.endUseIndicatorField = Value - End Set - End Property - - Public Property transactionType() As String - Get - Return Me.transactionTypeField - End Get - Set - Me.transactionTypeField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property prefRequestCode() As String - Get - Return Me.prefRequestCodeField - End Get - Set - Me.prefRequestCodeField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property PreviousDocument() As List(Of TPrevDoc) - Get - Return Me.previousDocumentField - End Get - Set - Me.previousDocumentField = Value - End Set - End Property - - Public Property BOM() As TBom - Get - Return Me.bOMField - End Get - Set - Me.bOMField = Value - End Set - End Property - - Public Property stockType() As String - Get - Return Me.stockTypeField - End Get - Set - Me.stockTypeField = Value - End Set - End Property - - Public Property stockType2() As String - Get - Return Me.stockType2Field - End Get - Set - Me.stockType2Field = Value - End Set - End Property - - Public Property stockExpiryDate() As Date - Get - Return Me.stockExpiryDateField - End Get - Set - Me.stockExpiryDateField = Value - End Set - End Property - - - Public Property stockExpiryDateSpecified() As Boolean - Get - Return Me.stockExpiryDateFieldSpecified - End Get - Set - Me.stockExpiryDateFieldSpecified = Value - End Set - End Property - - Public Property Package() As TPackage - Get - Return Me.packageField - End Get - Set - Me.packageField = Value - End Set - End Property - - Public Property accountNumber() As String - Get - Return Me.accountNumberField - End Get - Set - Me.accountNumberField = Value - End Set - End Property - - Public Property deliveryNote() As String - Get - Return Me.deliveryNoteField - End Get - Set - Me.deliveryNoteField = Value - End Set - End Property - - Public Property orderNumber() As String - Get - Return Me.orderNumberField - End Get - Set - Me.orderNumberField = Value - End Set - End Property - - Public Property Receipt() As TReceipt - Get - Return Me.receiptField - End Get - Set - Me.receiptField = Value - End Set - End Property - - Public Property asnNumber() As String - Get - Return Me.asnNumberField - End Get - Set - Me.asnNumberField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property referenceCurrency() As String - Get - Return Me.referenceCurrencyField - End Get - Set - Me.referenceCurrencyField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property RegistrationNumbers() As TImportRegistrationNo - Get - Return Me.registrationNumbersField - End Get - Set - Me.registrationNumbersField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property ContainerInfo() As List(Of TDetailContainerInfo) - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - Public Property CalculatedValues() As TCalcValues - Get - Return Me.calculatedValuesField - End Get - Set - Me.calculatedValuesField = Value - End Set - End Property - - Public Property CalculatedValuesCust() As TCalcValuesCust - Get - Return Me.calculatedValuesCustField - End Get - Set - Me.calculatedValuesCustField = Value - End Set - End Property - - - Public Property Duties() As List(Of TDuty) - Get - Return Me.dutiesField - End Get - Set - Me.dutiesField = Value - End Set - End Property - - - Public Property DutyTaxes() As List(Of TDutyTax) - Get - Return Me.dutyTaxesField - End Get - Set - Me.dutyTaxesField = Value - End Set - End Property - - - Public Property DutySavings() As List(Of TDutySaving) - Get - Return Me.dutySavingsField - End Get - Set - Me.dutySavingsField = Value - End Set - End Property - - Public Property OprDetails() As TOprInfo - Get - Return Me.oprDetailsField - End Get - Set - Me.oprDetailsField = Value - End Set - End Property - - Public Property uniqueId() As Decimal - Get - Return Me.uniqueIdField - End Get - Set - Me.uniqueIdField = Value - End Set - End Property - - - Public Property uniqueIdSpecified() As Boolean - Get - Return Me.uniqueIdFieldSpecified - End Get - Set - Me.uniqueIdFieldSpecified = Value - End Set - End Property - - Public Property externalProcessing() As String - Get - Return Me.externalProcessingField - End Get - Set - Me.externalProcessingField = Value - End Set - End Property - - - Public Property AdditionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property Intra() As TCustIntraLine - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - Public Property PreSupplier() As TPreSupplier - Get - Return Me.preSupplierField - End Get - Set - Me.preSupplierField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property valuationIndicator() As String - Get - Return Me.valuationIndicatorField - End Get - Set - Me.valuationIndicatorField = Value - End Set - End Property - - - Public Property ReferencePreviousProcedures() As List(Of TRefPrevProcedure) - Get - Return Me.referencePreviousProceduresField - End Get - Set - Me.referencePreviousProceduresField = Value - End Set - End Property - - Public Property PackagesData() As TPackagesData - Get - Return Me.packagesDataField - End Get - Set - Me.packagesDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private addTypeField As String - - Private addAmountField As Decimal - - Private addAmountFieldSpecified As Boolean - - Private addCurrencyField As String - - Private addProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addType() As String - Get - Return Me.addTypeField - End Get - Set - Me.addTypeField = Value - End Set - End Property - - Public Property addAmount() As Decimal - Get - Return Me.addAmountField - End Get - Set - Me.addAmountField = Value - End Set - End Property - - - Public Property addAmountSpecified() As Boolean - Get - Return Me.addAmountFieldSpecified - End Get - Set - Me.addAmountFieldSpecified = Value - End Set - End Property - - Public Property addCurrency() As String - Get - Return Me.addCurrencyField - End Get - Set - Me.addCurrencyField = Value - End Set - End Property - - Public Property addProRating() As String - Get - Return Me.addProRatingField - End Get - Set - Me.addProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocument - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docCategoryField As String - - Private docWriteOffQuantityField As Decimal - - Private docWriteOffQuantityFieldSpecified As Boolean - - Private docIssuerCountryField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Public Property docWriteOffQuantity() As Decimal - Get - Return Me.docWriteOffQuantityField - End Get - Set - Me.docWriteOffQuantityField = Value - End Set - End Property - - - Public Property docWriteOffQuantitySpecified() As Boolean - Get - Return Me.docWriteOffQuantityFieldSpecified - End Get - Set - Me.docWriteOffQuantityFieldSpecified = Value - End Set - End Property - - Public Property docIssuerCountry() As String - Get - Return Me.docIssuerCountryField - End Get - Set - Me.docIssuerCountryField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocument object - ''' - '''string workflow markup to deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDocument 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDocument object - ''' - '''string xml file to load and deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - 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 TDocument) 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 TDocument - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property Texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property Dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property Flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property Numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attrTypeField As String - - Private attrTextField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attrType() As String - Get - Return Me.attrTypeField - End Get - Set - Me.attrTypeField = Value - End Set - End Property - - Public Property attrText() As String - Get - Return Me.attrTextField - End Get - Set - Me.attrTextField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypeField As String - - Private partnerAddressField As TAddress - - Private partnerRelationField As String - - Private partnerInfoField As String - - Private partnerTelephoneField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TAddress() - End Sub - - Public Property partnerType() As String - Get - Return Me.partnerTypeField - End Get - Set - Me.partnerTypeField = Value - End Set - End Property - - Public Property PartnerAddress() As TAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property partnerInfo() As String - Get - Return Me.partnerInfoField - End Get - Set - Me.partnerInfoField = Value - End Set - End Property - - Public Property partnerTelephone() As String - Get - Return Me.partnerTelephoneField - End Get - Set - Me.partnerTelephoneField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntra - - Private vendorVatIdField As String - - Private statisticalProcedureField As String - - Private internalReferenceField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property vendorVatId() As String - Get - Return Me.vendorVatIdField - End Get - Set - Me.vendorVatIdField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property internalReference() As String - Get - Return Me.internalReferenceField - End Get - Set - Me.internalReferenceField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntra)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntra object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntra object - ''' - '''string workflow markup to deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntra - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntra) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntra 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntra object - ''' - '''string xml file to load and deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - 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 TCustIntra) 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 TCustIntra - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAtlasCompSumDEntry - - Private idTypeField As String - - Private quantityField As Long - - Private quantityFieldSpecified As Boolean - - Private packageTypeField As String - - Private registrationNumberField As String - - Private lineNumberField As Long - - Private lineNumberFieldSpecified As Boolean - - Private depositorField As String - - Private spoTypeField As String - - Private spoField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property idType() As String - Get - Return Me.idTypeField - End Get - Set - Me.idTypeField = Value - End Set - End Property - - Public Property quantity() As Long - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property lineNumber() As Long - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - - Public Property lineNumberSpecified() As Boolean - Get - Return Me.lineNumberFieldSpecified - End Get - Set - Me.lineNumberFieldSpecified = Value - End Set - End Property - - Public Property depositor() As String - Get - Return Me.depositorField - End Get - Set - Me.depositorField = Value - End Set - End Property - - Public Property spoType() As String - Get - Return Me.spoTypeField - End Get - Set - Me.spoTypeField = Value - End Set - End Property - - Public Property spo() As String - Get - Return Me.spoField - End Get - Set - Me.spoField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAtlasCompSumDEntry)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAtlasCompSumDEntry object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAtlasCompSumDEntry object - ''' - '''string workflow markup to deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAtlasCompSumDEntry - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAtlasCompSumDEntry) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAtlasCompSumDEntry 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAtlasCompSumDEntry object - ''' - '''string xml file to load and deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - 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 TAtlasCompSumDEntry) 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 TAtlasCompSumDEntry - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private containerIndicatorField As String - - Private containerNumberField As String - - Private containerTypeField As String - - Private containerLCLIndicatorField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerIndicator() As String - Get - Return Me.containerIndicatorField - End Get - Set - Me.containerIndicatorField = Value - End Set - End Property - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerType() As String - Get - Return Me.containerTypeField - End Get - Set - Me.containerTypeField = Value - End Set - End Property - - Public Property containerLCLIndicator() As String - Get - Return Me.containerLCLIndicatorField - End Get - Set - Me.containerLCLIndicatorField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportPaymentInfo - - Private paymentTypeField As String - - Private paymentDateField As Date - - Private paymentDateFieldSpecified As Boolean - - Private paymentBankCodeField As String - - Private paymentBankBranchCodeField As String - - Private paymentCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property paymentType() As String - Get - Return Me.paymentTypeField - End Get - Set - Me.paymentTypeField = Value - End Set - End Property - - Public Property paymentDate() As Date - Get - Return Me.paymentDateField - End Get - Set - Me.paymentDateField = Value - End Set - End Property - - - Public Property paymentDateSpecified() As Boolean - Get - Return Me.paymentDateFieldSpecified - End Get - Set - Me.paymentDateFieldSpecified = Value - End Set - End Property - - Public Property paymentBankCode() As String - Get - Return Me.paymentBankCodeField - End Get - Set - Me.paymentBankCodeField = Value - End Set - End Property - - Public Property paymentBankBranchCode() As String - Get - Return Me.paymentBankBranchCodeField - End Get - Set - Me.paymentBankBranchCodeField = Value - End Set - End Property - - Public Property paymentCurrency() As String - Get - Return Me.paymentCurrencyField - End Get - Set - Me.paymentCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportPaymentInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportPaymentInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportPaymentInfo object - ''' - '''string workflow markup to deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportPaymentInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportPaymentInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportPaymentInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportPaymentInfo object - ''' - '''string xml file to load and deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - 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 TImportPaymentInfo) 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 TImportPaymentInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsInv - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - 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 TInsuranceCostsInv) 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 TInsuranceCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsInv - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - 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 TFreightCostsInv) 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 TFreightCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebate - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private rebProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Public Property rebProRating() As String - Get - Return Me.rebProRatingField - End Get - Set - Me.rebProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebate object - ''' - '''string workflow markup to deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebate 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebate object - ''' - '''string xml file to load and deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - 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 TRebate) 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 TRebate - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private calculationOfFreightCostsField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property calculationOfFreightCosts() As String - Get - Return Me.calculationOfFreightCostsField - End Get - Set - Me.calculationOfFreightCostsField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLines - - Private lineField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.lineField = New List(Of TInvoiceLine)() - End Sub - - Public Property Line() As List(Of TInvoiceLine) - Get - Return Me.lineField - End Get - Set - Me.lineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLines)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLines object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLines object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLines object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLines, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLines) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLines) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLines - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLines) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInvoiceLines 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInvoiceLines object - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLines object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInvoiceLines, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLines) - 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 TInvoiceLines) 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 TInvoiceLines - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TParameters - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TParameters)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TParameters object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TParameters object - ''' - '''string workflow markup to deserialize - '''Output TParameters object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TParameters, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TParameters) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TParameters) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TParameters - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TParameters) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TParameters 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TParameters object - ''' - '''string xml file to load and deserialize - '''Output TParameters object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TParameters, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TParameters) - 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 TParameters) 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 TParameters - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttachments - - Private attachmentField As List(Of TAttachmentsAttachment) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.attachmentField = New List(Of TAttachmentsAttachment)() - End Sub - - Public Property attachment() As List(Of TAttachmentsAttachment) - Get - Return Me.attachmentField - End Get - Set - Me.attachmentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttachments)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttachments object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttachments object - ''' - '''string workflow markup to deserialize - '''Output TAttachments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachments) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachments) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttachments - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttachments) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAttachments 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAttachments object - ''' - '''string xml file to load and deserialize - '''Output TAttachments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttachments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachments) - 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 TAttachments) 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 TAttachments - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttachmentsAttachment - - Private descriptionField As TAttachmentDescription - - Private binAttachmentField() As Byte - - Private parameterField As List(Of TParameters) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.parameterField = New List(Of TParameters)() - Me.descriptionField = New TAttachmentDescription() - End Sub - - Public Property description() As TAttachmentDescription - Get - Return Me.descriptionField - End Get - Set - Me.descriptionField = Value - End Set - End Property - - Public Property binAttachment() As Byte() - Get - Return Me.binAttachmentField - End Get - Set - Me.binAttachmentField = Value - End Set - End Property - - Public Property parameter() As List(Of TParameters) - Get - Return Me.parameterField - End Get - Set - Me.parameterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttachmentsAttachment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttachmentsAttachment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttachmentsAttachment object - ''' - '''string workflow markup to deserialize - '''Output TAttachmentsAttachment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachmentsAttachment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachmentsAttachment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachmentsAttachment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttachmentsAttachment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttachmentsAttachment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAttachmentsAttachment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAttachmentsAttachment object - ''' - '''string xml file to load and deserialize - '''Output TAttachmentsAttachment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttachmentsAttachment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachmentsAttachment) - 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 TAttachmentsAttachment) 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 TAttachmentsAttachment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttachmentDescription - - Private contentTypeField As String - - Private dateTimeField As Date - - Private creatorField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property contentType() As String - Get - Return Me.contentTypeField - End Get - Set - Me.contentTypeField = Value - End Set - End Property - - Public Property dateTime() As Date - Get - Return Me.dateTimeField - End Get - Set - Me.dateTimeField = Value - End Set - End Property - - Public Property creator() As String - Get - Return Me.creatorField - End Get - Set - Me.creatorField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttachmentDescription)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttachmentDescription object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttachmentDescription object - ''' - '''string workflow markup to deserialize - '''Output TAttachmentDescription object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachmentDescription, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachmentDescription) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttachmentDescription) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttachmentDescription - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttachmentDescription) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAttachmentDescription 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAttachmentDescription object - ''' - '''string xml file to load and deserialize - '''Output TAttachmentDescription object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttachmentDescription, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttachmentDescription) - 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 TAttachmentDescription) 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 TAttachmentDescription - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motModeField As String - - Private meansOfTransportField As String - - Private motCountryField As String - - Private motVehicleField As String - - Private meansOfTransportDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property motMode() As String - Get - Return Me.motModeField - End Get - Set - Me.motModeField = Value - End Set - End Property - - Public Property meansOfTransport() As String - Get - Return Me.meansOfTransportField - End Get - Set - Me.meansOfTransportField = Value - End Set - End Property - - Public Property motCountry() As String - Get - Return Me.motCountryField - End Get - Set - Me.motCountryField = Value - End Set - End Property - - Public Property motVehicle() As String - Get - Return Me.motVehicleField - End Get - Set - Me.motVehicleField = Value - End Set - End Property - - Public Property meansOfTransportDescription() As String - Get - Return Me.meansOfTransportDescriptionField - End Get - Set - Me.meansOfTransportDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCosts - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private frtInternationalAbsField As Decimal - - Private frtInternationalAbsFieldSpecified As Boolean - - Private frtIntCurrencyField As String - - Private frtCommunityAbsField As Decimal - - Private frtCommunityAbsFieldSpecified As Boolean - - Private frtCommunityCurrencyField As String - - Private frtNatAbsField As Decimal - - Private frtNatAbsFieldSpecified As Boolean - - Private frtNatCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Public Property frtInternationalAbs() As Decimal - Get - Return Me.frtInternationalAbsField - End Get - Set - Me.frtInternationalAbsField = Value - End Set - End Property - - - Public Property frtInternationalAbsSpecified() As Boolean - Get - Return Me.frtInternationalAbsFieldSpecified - End Get - Set - Me.frtInternationalAbsFieldSpecified = Value - End Set - End Property - - Public Property frtIntCurrency() As String - Get - Return Me.frtIntCurrencyField - End Get - Set - Me.frtIntCurrencyField = Value - End Set - End Property - - Public Property frtCommunityAbs() As Decimal - Get - Return Me.frtCommunityAbsField - End Get - Set - Me.frtCommunityAbsField = Value - End Set - End Property - - - Public Property frtCommunityAbsSpecified() As Boolean - Get - Return Me.frtCommunityAbsFieldSpecified - End Get - Set - Me.frtCommunityAbsFieldSpecified = Value - End Set - End Property - - Public Property frtCommunityCurrency() As String - Get - Return Me.frtCommunityCurrencyField - End Get - Set - Me.frtCommunityCurrencyField = Value - End Set - End Property - - Public Property frtNatAbs() As Decimal - Get - Return Me.frtNatAbsField - End Get - Set - Me.frtNatAbsField = Value - End Set - End Property - - - Public Property frtNatAbsSpecified() As Boolean - Get - Return Me.frtNatAbsFieldSpecified - End Get - Set - Me.frtNatAbsFieldSpecified = Value - End Set - End Property - - Public Property frtNatCurrency() As String - Get - Return Me.frtNatCurrencyField - End Get - Set - Me.frtNatCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCosts object - ''' - '''string workflow markup to deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCosts object - ''' - '''string xml file to load and deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - 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 TFreightCosts) 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 TFreightCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCosts - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCosts object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCosts object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - 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 TInsuranceCosts) 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 TInsuranceCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttributes - - Private attributeField As List(Of TAttribute) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.attributeField = New List(Of TAttribute)() - End Sub - - Public Property Attribute() As List(Of TAttribute) - Get - Return Me.attributeField - End Get - Set - Me.attributeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttributes)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttributes object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttributes object - ''' - '''string workflow markup to deserialize - '''Output TAttributes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttributes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttributes) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttributes) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttributes - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttributes) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAttributes 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAttributes object - ''' - '''string xml file to load and deserialize - '''Output TAttributes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAttributes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttributes) - 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 TAttributes) 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 TAttributes - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartners - - Private partnerField As List(Of TPartner) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerField = New List(Of TPartner)() - End Sub - - Public Property Partner() As List(Of TPartner) - Get - Return Me.partnerField - End Get - Set - Me.partnerField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartners)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartners object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartners object - ''' - '''string workflow markup to deserialize - '''Output TPartners object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartners, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartners) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartners) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartners - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartners) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPartners 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPartners object - ''' - '''string xml file to load and deserialize - '''Output TPartners object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPartners, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartners) - 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 TPartners) 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 TPartners - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainerInfo - - Private detailContainerInfoField As List(Of TDetailContainerInfo) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.detailContainerInfoField = New List(Of TDetailContainerInfo)() - End Sub - - Public Property DetailContainerInfo() As List(Of TDetailContainerInfo) - Get - Return Me.detailContainerInfoField - End Get - Set - Me.detailContainerInfoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainerInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainerInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainerInfo object - ''' - '''string workflow markup to deserialize - '''Output TContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainerInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainerInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainerInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainerInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TContainerInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TContainerInfo object - ''' - '''string xml file to load and deserialize - '''Output TContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainerInfo) - 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 TContainerInfo) 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 TContainerInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocuments - - Private documentField As List(Of TDocument) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.documentField = New List(Of TDocument)() - End Sub - - Public Property Document() As List(Of TDocument) - Get - Return Me.documentField - End Get - Set - Me.documentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocuments)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocuments object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocuments object - ''' - '''string workflow markup to deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocuments) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocuments - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocuments) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrevDocs - - Private previousDocumentField As List(Of TPrevDoc) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.previousDocumentField = New List(Of TPrevDoc)() - End Sub - - Public Property PreviousDocument() As List(Of TPrevDoc) - Get - Return Me.previousDocumentField - End Get - Set - Me.previousDocumentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrevDocs)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrevDocs object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrevDocs object - ''' - '''string workflow markup to deserialize - '''Output TPrevDocs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDocs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDocs) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDocs) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrevDocs - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrevDocs) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrevDocs 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrevDocs object - ''' - '''string xml file to load and deserialize - '''Output TPrevDocs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrevDocs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDocs) - 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 TPrevDocs) 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 TPrevDocs - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDuties - - Private dutyField As List(Of TDuty) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.dutyField = New List(Of TDuty)() - End Sub - - Public Property Duty() As List(Of TDuty) - Get - Return Me.dutyField - End Get - Set - Me.dutyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDuties)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDuties object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDuties object - ''' - '''string workflow markup to deserialize - '''Output TDuties object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuties, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuties) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuties) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDuties - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDuties) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDuties 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDuties object - ''' - '''string xml file to load and deserialize - '''Output TDuties object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDuties, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuties) - 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 TDuties) 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 TDuties - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutyTaxes - - Private dutyTaxField As List(Of TDutyTax) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.dutyTaxField = New List(Of TDutyTax)() - End Sub - - Public Property DutyTax() As List(Of TDutyTax) - Get - Return Me.dutyTaxField - End Get - Set - Me.dutyTaxField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutyTaxes)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutyTaxes object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutyTaxes object - ''' - '''string workflow markup to deserialize - '''Output TDutyTaxes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTaxes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTaxes) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTaxes) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutyTaxes - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutyTaxes) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutyTaxes 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutyTaxes object - ''' - '''string xml file to load and deserialize - '''Output TDutyTaxes object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutyTaxes, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTaxes) - 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 TDutyTaxes) 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 TDutyTaxes - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutySavings - - Private dutySavingField As List(Of TDutySaving) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.dutySavingField = New List(Of TDutySaving)() - End Sub - - Public Property DutySaving() As List(Of TDutySaving) - Get - Return Me.dutySavingField - End Get - Set - Me.dutySavingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutySavings)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutySavings object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutySavings object - ''' - '''string workflow markup to deserialize - '''Output TDutySavings object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySavings, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySavings) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySavings) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutySavings - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutySavings) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutySavings 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutySavings object - ''' - '''string xml file to load and deserialize - '''Output TDutySavings object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutySavings, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySavings) - 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 TDutySavings) 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 TDutySavings - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrevDocSeals - - Private containerIDField As String - - Private validField As String - - Private cancelField As String - - Private sealDescSollField As String - - Private sealDescIstField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerID() As String - Get - Return Me.containerIDField - End Get - Set - Me.containerIDField = Value - End Set - End Property - - Public Property valid() As String - Get - Return Me.validField - End Get - Set - Me.validField = Value - End Set - End Property - - Public Property cancel() As String - Get - Return Me.cancelField - End Get - Set - Me.cancelField = Value - End Set - End Property - - Public Property sealDescSoll() As String - Get - Return Me.sealDescSollField - End Get - Set - Me.sealDescSollField = Value - End Set - End Property - - Public Property sealDescIst() As String - Get - Return Me.sealDescIstField - End Get - Set - Me.sealDescIstField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrevDocSeals)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrevDocSeals object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrevDocSeals object - ''' - '''string workflow markup to deserialize - '''Output TPrevDocSeals object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDocSeals, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDocSeals) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDocSeals) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrevDocSeals - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrevDocSeals) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrevDocSeals 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrevDocSeals object - ''' - '''string xml file to load and deserialize - '''Output TPrevDocSeals object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrevDocSeals, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDocSeals) - 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 TPrevDocSeals) 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 TPrevDocSeals - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustImportInvoice - - Private companyField As String - - Private plantField As String - - Private typeField As String - - Private invoiceNumberField As String - - Private invoiceVersionField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private invoiceHeadExtendedField As TCustImportInvoiceInvoiceHeadExtended - - Private attributesField As List(Of TAttribute) - - Private partnersField As List(Of TPartner) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private invoiceLinesField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLinesField = New List(Of TInvoiceLine)() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.partnersField = New List(Of TPartner)() - Me.attributesField = New List(Of TAttribute)() - Me.invoiceHeadExtendedField = New TCustImportInvoiceInvoiceHeadExtended() - End Sub - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property invoiceNumber() As String - Get - Return Me.invoiceNumberField - End Get - Set - Me.invoiceNumberField = Value - End Set - End Property - - Public Property invoiceVersion() As String - Get - Return Me.invoiceVersionField - End Get - Set - Me.invoiceVersionField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property InvoiceHeadExtended() As TCustImportInvoiceInvoiceHeadExtended - Get - Return Me.invoiceHeadExtendedField - End Get - Set - Me.invoiceHeadExtendedField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - - Public Property InvoiceLines() As List(Of TInvoiceLine) - Get - Return Me.invoiceLinesField - End Get - Set - Me.invoiceLinesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustImportInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustImportInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustImportInvoice object - ''' - '''string workflow markup to deserialize - '''Output TCustImportInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustImportInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustImportInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustImportInvoice 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustImportInvoice object - ''' - '''string xml file to load and deserialize - '''Output TCustImportInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustImportInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoice) - 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 TCustImportInvoice) 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 TCustImportInvoice - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustImportInvoiceInvoiceHeadExtended - Inherits TInvoiceHead - - Private customsDateField As Date - - Private customsDateFieldSpecified As Boolean - - Private locationsField As TCustImportInvoiceInvoiceHeadExtendedLocations - - Private motBorderField As TMot - - Private motInlandField As TMot - - Private containerField As TContainer - - Private prevDocumentField As TCustImportInvoiceInvoiceHeadExtendedPrevDocument - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.prevDocumentField = New TCustImportInvoiceInvoiceHeadExtendedPrevDocument() - Me.containerField = New TContainer() - Me.motInlandField = New TMot() - Me.motBorderField = New TMot() - Me.locationsField = New TCustImportInvoiceInvoiceHeadExtendedLocations() - End Sub - - Public Property customsDate() As Date - Get - Return Me.customsDateField - End Get - Set - Me.customsDateField = Value - End Set - End Property - - - Public Property customsDateSpecified() As Boolean - Get - Return Me.customsDateFieldSpecified - End Get - Set - Me.customsDateFieldSpecified = Value - End Set - End Property - - Public Property Locations() As TCustImportInvoiceInvoiceHeadExtendedLocations - Get - Return Me.locationsField - End Get - Set - Me.locationsField = Value - End Set - End Property - - Public Property MotBorder() As TMot - Get - Return Me.motBorderField - End Get - Set - Me.motBorderField = Value - End Set - End Property - - Public Property MotInland() As TMot - Get - Return Me.motInlandField - End Get - Set - Me.motInlandField = Value - End Set - End Property - - Public Property Container() As TContainer - Get - Return Me.containerField - End Get - Set - Me.containerField = Value - End Set - End Property - - Public Property PrevDocument() As TCustImportInvoiceInvoiceHeadExtendedPrevDocument - Get - Return Me.prevDocumentField - End Get - Set - Me.prevDocumentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustImportInvoiceInvoiceHeadExtended)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtended object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustImportInvoiceInvoiceHeadExtended object - ''' - '''string workflow markup to deserialize - '''Output TCustImportInvoiceInvoiceHeadExtended object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtended, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtended) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtended) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustImportInvoiceInvoiceHeadExtended - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustImportInvoiceInvoiceHeadExtended) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtended 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustImportInvoiceInvoiceHeadExtended object - ''' - '''string xml file to load and deserialize - '''Output TCustImportInvoiceInvoiceHeadExtended object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtended, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtended) - 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 TCustImportInvoiceInvoiceHeadExtended) 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 TCustImportInvoiceInvoiceHeadExtended - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustImportInvoiceInvoiceHeadExtendedLocations - - Private dispatchCountryField As String - - Private lastDispatchCountryField As String - - Private destinationPlaceField As String - - Private destinationRegionField As String - - Private officeEntryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property dispatchCountry() As String - Get - Return Me.dispatchCountryField - End Get - Set - Me.dispatchCountryField = Value - End Set - End Property - - Public Property lastDispatchCountry() As String - Get - Return Me.lastDispatchCountryField - End Get - Set - Me.lastDispatchCountryField = Value - End Set - End Property - - Public Property destinationPlace() As String - Get - Return Me.destinationPlaceField - End Get - Set - Me.destinationPlaceField = Value - End Set - End Property - - Public Property destinationRegion() As String - Get - Return Me.destinationRegionField - End Get - Set - Me.destinationRegionField = Value - End Set - End Property - - Public Property officeEntry() As String - Get - Return Me.officeEntryField - End Get - Set - Me.officeEntryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustImportInvoiceInvoiceHeadExtendedLocations)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtendedLocations object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustImportInvoiceInvoiceHeadExtendedLocations object - ''' - '''string workflow markup to deserialize - '''Output TCustImportInvoiceInvoiceHeadExtendedLocations object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedLocations, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtendedLocations) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedLocations) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustImportInvoiceInvoiceHeadExtendedLocations - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustImportInvoiceInvoiceHeadExtendedLocations) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtendedLocations 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustImportInvoiceInvoiceHeadExtendedLocations object - ''' - '''string xml file to load and deserialize - '''Output TCustImportInvoiceInvoiceHeadExtendedLocations object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedLocations, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtendedLocations) - 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 TCustImportInvoiceInvoiceHeadExtendedLocations) 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 TCustImportInvoiceInvoiceHeadExtendedLocations - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustImportInvoiceInvoiceHeadExtendedPrevDocument - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private previousDocDateField As Date - - Private previousDocDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property previousDocDate() As Date - Get - Return Me.previousDocDateField - End Get - Set - Me.previousDocDateField = Value - End Set - End Property - - - Public Property previousDocDateSpecified() As Boolean - Get - Return Me.previousDocDateFieldSpecified - End Get - Set - Me.previousDocDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustImportInvoiceInvoiceHeadExtendedPrevDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtendedPrevDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustImportInvoiceInvoiceHeadExtendedPrevDocument object - ''' - '''string workflow markup to deserialize - '''Output TCustImportInvoiceInvoiceHeadExtendedPrevDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedPrevDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtendedPrevDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedPrevDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustImportInvoiceInvoiceHeadExtendedPrevDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustImportInvoiceInvoiceHeadExtendedPrevDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustImportInvoiceInvoiceHeadExtendedPrevDocument 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustImportInvoiceInvoiceHeadExtendedPrevDocument object - ''' - '''string xml file to load and deserialize - '''Output TCustImportInvoiceInvoiceHeadExtendedPrevDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustImportInvoiceInvoiceHeadExtendedPrevDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustImportInvoiceInvoiceHeadExtendedPrevDocument) - 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 TCustImportInvoiceInvoiceHeadExtendedPrevDocument) 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 TCustImportInvoiceInvoiceHeadExtendedPrevDocument - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAtlasCompSumD - - Private atlasCompletionSumDField As List(Of TAtlasCompSumDEntry) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.atlasCompletionSumDField = New List(Of TAtlasCompSumDEntry)() - End Sub - - Public Property AtlasCompletionSumD() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDField - End Get - Set - Me.atlasCompletionSumDField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAtlasCompSumD)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAtlasCompSumD object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAtlasCompSumD object - ''' - '''string workflow markup to deserialize - '''Output TAtlasCompSumD object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumD, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumD) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumD) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAtlasCompSumD - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAtlasCompSumD) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAtlasCompSumD 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAtlasCompSumD object - ''' - '''string xml file to load and deserialize - '''Output TAtlasCompSumD object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAtlasCompSumD, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumD) - 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 TAtlasCompSumD) 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 TAtlasCompSumD - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRefPrevProcedures - - Private referencePreviousProcedureField As List(Of TRefPrevProcedure) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.referencePreviousProcedureField = New List(Of TRefPrevProcedure)() - End Sub - - Public Property ReferencePreviousProcedure() As List(Of TRefPrevProcedure) - Get - Return Me.referencePreviousProcedureField - End Get - Set - Me.referencePreviousProcedureField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRefPrevProcedures)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRefPrevProcedures object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRefPrevProcedures object - ''' - '''string workflow markup to deserialize - '''Output TRefPrevProcedures object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedures, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedures) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedures) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRefPrevProcedures - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRefPrevProcedures) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRefPrevProcedures 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRefPrevProcedures object - ''' - '''string xml file to load and deserialize - '''Output TRefPrevProcedures object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRefPrevProcedures, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedures) - 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 TRefPrevProcedures) 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 TRefPrevProcedures - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerTexts - - Private textField As List(Of TCustomerText) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.textField = New List(Of TCustomerText)() - End Sub - - Public Property Text() As List(Of TCustomerText) - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerTexts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerTexts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerTexts object - ''' - '''string workflow markup to deserialize - '''Output TCustomerTexts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerTexts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerTexts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerTexts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerTexts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerTexts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerTexts object - ''' - '''string xml file to load and deserialize - '''Output TCustomerTexts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerTexts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerTexts) - 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 TCustomerTexts) 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 TCustomerTexts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDates - - Private dateField As List(Of TCustomerDate) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.dateField = New List(Of TCustomerDate)() - End Sub - - Public Property [Date]() As List(Of TCustomerDate) - Get - Return Me.dateField - End Get - Set - Me.dateField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDates)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDates object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDates object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDates object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDates) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDates) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDates - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDates) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerDates 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerDates object - ''' - '''string xml file to load and deserialize - '''Output TCustomerDates object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerDates, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDates) - 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 TCustomerDates) 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 TCustomerDates - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlags - - Private flagField As List(Of TCustomerFlag) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.flagField = New List(Of TCustomerFlag)() - End Sub - - Public Property Flag() As List(Of TCustomerFlag) - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlags)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlags object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlags object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlags object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlags) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlags) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlags - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlags) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerFlags 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerFlags object - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlags object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerFlags, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlags) - 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 TCustomerFlags) 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 TCustomerFlags - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumbers - - Private numberField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numberField = New List(Of TCustomerNumber)() - End Sub - - Public Property Number() As List(Of TCustomerNumber) - Get - Return Me.numberField - End Get - Set - Me.numberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumbers)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumbers object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumbers object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumbers object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumbers) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumbers) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumbers - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumbers) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustomerNumbers 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustomerNumbers object - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumbers object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustomerNumbers, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumbers) - 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 TCustomerNumbers) 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 TCustomerNumbers - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.xsd deleted file mode 100644 index eb1a3f7f..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportInvoiceTypes.xsd +++ /dev/null @@ -1,11393 +0,0 @@ - - - - - - Import invoice type - - - - - - Invoice Number - Rechnungsnummer - - - true - String1..30 - - MIC_ALL_EAVKOP - EAKFAKTNR - MIC_EINKOP - EFKFAKTNR - - - - - - - - - - - - - - An unique version id. - Versionsnummer - - - false - String1..50 - - MIC_ALL_EAVKOP - EAKVERSION - MIC_EINKOP - EFKLOCKVERSION - - - - - - - - - - - - - Date of invoice - Rechnungsdatum - - - false - xs:date - - MIC_ALL_EAVKOP - EAKFAKTDAT - MIC_EINKOP - EFKFAKTDAT - - - - - - - - - - - - true - - - - - - - - - - - - - - Invoice attributes - Rechnungsattribute - - - false - - 1-n - - - - - - - - - - - - Invoice documents - Rechnungsunterlagen - - - false - - 1-n - - - - - - - - - - - - Invoice business partner - Rechnungsgeschäftspartner - - - false - - 1-n - - - MIC_EINSDGDOC - - - - - - - - - - Invoice completion parts of summary declaration - Rechnungsbeendigungsanteile der Summarischen Anmeldung (SumA) - - - false - - 1-n - - - - - - - - - - - - Intrastat information on invoice level - Intrastatdaten auf Rechnungsebene - - - false - - - - - - - - - - - - - - Invoice lines - Rechnungspositionen - - - true - - 1-n - - - - - - - - - - - - - - - Einfuhrposition - - - true - - 1-n - - - - - - - - - - - - Invoice line - Rechnungsposition - - - true - - - - - - - - - - - - - - - Import invoice line type - - - - - - Invoice Line - Rechnungsposition - - - true - Decimal(4) - - MIC_ALL_EAVPOS - EAPFAKTPOS - MIC_EINPOS - EFPFAKTPOS - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - Quantity - Abgangsmenge - - - false - Decimal(13,3) - - MIC_ALL_EAVPOS - EAPMENGE - MIC_EINPOS - EFPMENGE - - - - - - - - - - - - - - Unit of Measurement - Mengeneinheit - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPMEH - MIC_EINPOS - EFPMEH - - - - - - - - - - - - - Net Weight (kg) - Eigenmasse (kg) - - - false - Decimal(14,6) - - MIC_ALL_EAVPOS - EAPEIGMAS - MIC_EINPOS - EFPEIGMAS - - - - - - - - - - - - - - Gross Weight (kg) - Rohmasse (kg) - - - false - Decimal(14,6) - - MIC_ALL_EAVPOS - EAPROHMAS - MIC_EINPOS - EFPROHMAS - - - - - - - - - - - - - - Statistical Quantity - Statistische Menge - - - false - Decimal(13,3) - - MIC_ALL_EAVPOS - EAPBESM - MIC_EINPOS - EFPBESM - - - - - - - - - - - - - - Quantity Unit - Mengeneinheit - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPBESMEH - MIC_EINPOS - EFPBESMEH - - - - - - - - - - - - - Unit Price - Stückpreis - - - false - Decimal(18,6) - - MIC_ALL_EAVPOS - EAPPREIS - MIC_EINPOS - EFPPREIS - - - - - - - - - - - - - - Line Value - Wert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPWERT - MIC_EINPOS - EFPWERT - - - - - - - - - - - - - - License information - - - - - - - Pricing information to document how the invoice line was priced - - - - false - - - - - - - - - - - - - - Line freight costs - Positionsfrachtkosten - - - false - - - - - - - - - - - - - - Line insurance costs - Positionsversicherungskosten - - - false - - - - - - - - - - - - - - Line additional costs - Positionsnebenkosten - - - false - - 0-8 - MIC_ALL_EAVPOS - EAP___ - MIC_EINPOS - EFP___ - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - Country of Origin - Ursprungsland - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPURLD - MIC_EINPOS - EFPURLD - - - - - - - - - - - - - Preferential country of origin - Präferenz Ursprungsland - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPPRAEFURLD - MIC_EINPOS - EFPPRAEFURLD - - - - - - - - - - - - - Location of Goods - Warenort - - - false - String1..35 - - MIC_ALL_EAVPOS - EAPLOCATIONOFGOODS - MIC_EINPOS - EFPLOCATIONOFGOODS - - - - - - - - - - - - - Contingent Number - Kontingentnummer - - - false - String1..8 - - MIC_ALL_EAVPOS - EAPKONTGT - MIC_EINPOS - EFPKONTGT - - - - - - - - - - - - - Contingent Key - Schlüssel des Kontingents - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPEFAKKA2 - MIC_EINBPARA - EFAKKA2 - - - - - - - - - - - - - Contingent Quantity - Begünstigungsmenge - - - false - Decimal(38,0) - - MIC_ALL_EAVPOS - EAPEFABEGMENGE - MIC_EINBPARA - EFABEGMENGE - - - - - - - - - - - - - - Contingent Quantity UoM - Mengeneinheit der Begünstigungsmenge - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPEFABEGMEH - MIC_EINBPARA - EFABEGMEH - - - - - - - - - - - - - Contingent Quantity Qualifier - Qualifikator der Begünstigungsmenge - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPEFABEGMEHQ - MIC_EINBPARA - EFABEGMEHQ - - - - - - - - - - - - - Import Customs Procedure - Zollverfahren - - - false - String1..6 - - MIC_ALL_EAVPOS - EAPEVCASE - MIC_EINPOS - EFPEVCASE - - - - - - - - - - - - - The statistical code of the customs procedure. - Einfuhr Verfahrenscode - - - false - String1..6 - - MIC_ALL_EAVPOS - EAPEVKZ - MIC_EINPOS - EFPEVKZ - - - - - - - - - - - - - Special Use - Besondere Verwendung - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPBESVERWKZ - MIC_EINPOS - EFPBESVERWKZ - - - - - - - - - - - - - Nature of Transaction - Geschäftsart - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPGSART - MIC_EINPOS - EFPGSART - - - - - - - - - - - - - Additonal Code 1, Additonal Code 2, Additonal Code 3 - Zusatzcode 1, Zusatzcode 2, Zusatzcode 3 - - - false - String1..4 - 0-3 - MIC_ALL_EAVPOS - EAPZUSCD1, EAPZUSCD2, EAPZUSCD3 - MIC_EINPOS - EFPZUSCD1, EFPZUSCD2, EFPZUSCD3 - - - - - - - - - - - - - PAC/The preference request code that indicates if a preferential duty rate should be applied. - Beantragte Begünstigung - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPPAC - MIC_EINPOS - EFPPAC - - - - - - - - - - - - - Documents - Unterlagen - - - false - - 1-n - - - - - - - - - - - - Invoice line previous documents - Positionsvorpapiere - - - false - - 1-n - - - - - - - - - - - - Bill of material - - - - false - - - - - - - - - - - - - - Stock Type 1/The stock type for duty regimes with additions to the inventory. - Bestandsart 1 - - - false - String1..20 - - MIC_ALL_EAVPOS - EAPBESTART1 - MIC_EINPOS - EFPBESTART1 - - - - - - - - - - - - - Stock Type 2/The stock type for duty regimes with additions to the inventory. - Bestandsart 2 - - - false - String1..20 - - MIC_ALL_EAVPOS - EAPBESTART2 - MIC_EINPOS - EFPBESTART2 - - - - - - - - - - - - - Expiry date/date on which the stock expires - Ablaufdatum - - - false - Date - - MIC_ALL_EAVPOS - EAPSTOCKEXPDAT - MIC_EINPOS - EFPSTOCKEXPDAT - - - - - - - - Package - - - - false - - - - - - - - - - - - - - Account/The account number for the transaction. - Konto - - - false - String1..50 - - MIC_ALL_EAVPOS - EAPKONTO - MIC_EINPOS - EFPKONTO - - - - - - - - - - - - - Del. Note Number - Lieferscheinnr. - - - false - String1..15 - - MIC_ALL_EAVPOS - EAPLSNR - MIC_EINPOS - EFPLSNR - - - - - - - - - - - - - Order Note Number - Bestellschein. - - - false - String1..22 - - MIC_ALL_EAVPOS - EAPBSNR - MIC_EINPOS - EFPBSNR - - - - - - - - - - - - - Receipt - - - - false - - - - - - - - - - - - - - ASN Number/Advanced shipping notice Number(ASN). - Lieferantragsnummer. - - - false - String1..30 - - MIC_ALL_EAVPOS - EAPLANR - MIC_EINPOS - EFPLANR - - - - - - - - - - - - - Reference Value/The reference value. This can be used to store the invoice line value in original currency. - Referenzwert. - - - false - Decimal(18,6) - - MIC_ALL_EAVPOS - EAPREFWERT - MIC_EINPOS - EFPREFWERT - - - - - - - - - - - - - - Reference Currency - Referenzwährung. - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPREFWAE - MIC_EINPOS - EFPREFWAE - - - - - - - - - - - - - Remarks - Zusätzliche Angaben. - - - false - String1..80 - - MIC_ALL_EAVPOS - EAPINFO - MIC_EINPOS - EFPINFO - - - - - - - - - - - - - Remarks - Zusätzliche Angaben. - - - false - String1..80 - - MIC_ALL_EAVPOS - EAPINFO2 - MIC_EINPOS - EFPINFO - - - - - - - - - - - - - Registration numbers - - - - false - - - - - - - - - - - - - - Customer specific fields - Kundenspezifische Felder - - - false - - - MIC_ALL_EAVPOS - EAP___ - MIC_EINPOS - EFP___ - - - - - - - - Invoice line attributes - Positionsattribute - - - false - - 1-n - - - - - - - - - - - - Invoice line containers - Positionscontainer - - - false - - - - - - - - - - - - - - Invoice line business partner - Positionsgeschäftspartner - - - false - - 1-n - - - - - - - - - - - - Calculated values - calculated by external system - - - - false - - - - - - - - - - - - - - Custom relevant values in MIC - - - - false - - - - - - - - - - - - - - Duties - calculated by external system - - - - false - - 0-n - - - - - - - - - - - - Duties - calculated by MIC and customs FT (MIC_EINABG) AV (MIC_EAVABG) - - - - false - - 0-n - - - - - - - - - - - - Duties - calculated by MIC and customs FT (MIC_EINABG) AV (MIC_EAVABG) - - - - false - - 0-n - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - SID - Nachrichten-SID - - - false - Decimal(10) - - MIC_ALL_EAVPOS - EAPSID - MIC_EINPOS - EFPSID - - - - - - - - - - - - - External processing - Externe Verarbeitung - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPEXTERNALPROCESSING - MIC_EINPOS - EFPEXTERNALPROCESSING - - - - - - - - - - - - - Invoice line additional information - Zusätzliche Information auf Positionsebene - - - false - - 1-n - - - - - - - - - - - - Intrastat information on line level - Intrastatdaten auf Positionsebene - - - - - - - Pre-Supplier - Vorveredler - - - false - - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_ALL_EAVPOS - EAPCREUSER - MIC_EINPOS - EFPCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_ALL_EAVPOS - EAPCREDAT - MIC_EINPOS - EFPCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_ALL_EAVPOS - EAPUSE - MIC_EINPOS - EFPUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_ALL_EAVPOS - EAPUSEDAT - MIC_EINPOS - EFPUSEDAT - - - - - - - - Valuation Indicators - Bewertungskennzeichen - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPVALUATIONINDICATOR - MIC_EINPOS - EFPVALUATIONINDICATOR - - - - - - - - - - - Invoice line previous document references - Positionsbeendigungsanteile Vorpapiere - - - - - - - Invoice line packages - Positionspackstücke - - - false - - 0-n - - - - - - - - - - - - - Fields for pre-supplier. - - - - - - INF Duty Value - INF Zollwert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPINFZOBAS - - - - - - - - - - - - - - - - INF Duty Rate - INF Zollsatz - - - false - Decimal(6,3) - - MIC_ALL_EAVPOS - EAPINFZOBET1 - - - - - - - - - - - - - - - - INF Duty - INF Abgabe - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPINFZO - - - - - - - - - - - - - - - - INF Duty Currency - INF Abgabenwährung - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPINFZOW - - - - - - - - - - - - - - - - - - - External Customs Value - Externer Zollwert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPCUSTOMSVALUE_EXT - MIC_EINPOS - EFPCUSTOMSVALUE_EXT - - - - - - - - - - - - - - External Net Value - Externer Nettowert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPNETVALUE_EXT - MIC_EINPOS - EFPNETVALUE_EXT - - - - - - - - - - - - - - External Net Value - Externer Nettowert - - - false - Decimal(16,4) - - MIC_EINPOS - EFPCALCSTATWERT - MIC_EINPOS - EFPCALCSTATWERT - - - - - - - - - - - - - - External Freight Statistical Value - Externer statistischer Wert für Fracht - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFREIGHTSTATVAL_EXT - MIC_EINPOS - EFPFREIGHTSTATVAL_EXT - - - - - - - - - - - - - - External Freight International - Externe internationale Fracht - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFREIGHTINTERNATIONAL_EXT - MIC_EINPOS - EFPFREIGHTINTERNATIONAL_EXT - - - - - - - - - - - - - - External Freight Community - Externe Fracht Gemeinschaft - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFREIGHTEU_EXT - MIC_EINPOS - EFPFREIGHTEU_EXT - - - - - - - - - - - - - - External Freight National - Externe nationale Fracht - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFREIGHTNATIONAL_EXT - MIC_EINPOS - EFPFREIGHTNATIONAL_EXT - - - - - - - - - - - - - - External Insurance - Externe Versicherung - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPINSURANCE_EXT - MIC_EINPOS - EFPINSURANCE_EXT - - - - - - - - - - - - - - External Insurance - Externe Versicherung - - - false - Decimal(16,4) - 0-2 - MIC_ALL_EAVPOS - EAPSHIPADDCOSTS1/2_EXT - MIC_EINPOS - EFPSHIPADDCOSTS1/2_EXT - - - - - - - - - - - - - - External Insurance - Externe Versicherung - - - false - Decimal(16,4) - 0-2 - MIC_ALL_EAVPOS - EAPINVADDCOSTS1/2_EXT - MIC_EINPOS - EFPINVADDCOSTS1/2_EXT - - - - - - - - - - - - - - External Insurance - Externe Versicherung - - - false - Decimal(16,4) - 0-8 - MIC_ALL_EAVPOS - EAPLINEADDCOSTS1/8_EXT - MIC_EINPOS - EFPLINEADDCOSTS1/8_EXT - - - - - - - - - - - - - - External Cust Value - Externer Cust Value - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPCUSTVALUE_EXT - MIC_EINPOS - EFPCUSTVALUE_EXT - - - - - - - - - - - - - - External Assist Value - Externer Beistellwert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPASSISTVALUE_EXT - MIC_EINPOS - EFPASSISTVALUE_EXT - - - - - - - - - - - - - - External VAT Additional Costs - Externe UST Nebenkosten - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPVATADDCOSTS_EXT - MIC_EINPOS - EFPVATADDCOSTS_EXT - - - - - - - - - - - - - - - - - - Customs value - Externe UST Nebenkosten - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPGRWERT - - - - - - - - - - - - - - Net Value - Externe UST Nebenkosten - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPWERTNTO - - - - - - - - - - - - - - Additional statistical value - Zuschlag stat. Wert - - - false - Decimal(17,4) - - - - MIC_EINPOS - EFPADDITIONALSTATISTICALVALUE - - - - - - - - - - - - - - Additoinal cost VAT - Zuschlag EUSt. - - - false - Decimal(17,4) - - - - MIC_EINPOS - EFPZUEUST - - - - - - - - - - - - - - Customs value added - Grenzwert Zu/Ab - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPGRWERTZUAB1 - - - - - - - - - - - - - - OPR ingredients value - Beistellwert - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBEISTELL - - - - - - - - - - - - - - Additional costs 1 - Fracht f. Grenzw. - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB1 - - - - - - - - - - - - - - Additional costs 2 - Versicherung - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB2 - - - - - - - - - - - - - - Additional costs 3 - Sdg. Nebenk. 1 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB3 - - - - - - - - - - - - - - Additional costs 4 - Sdg. Nebenk. 2 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB4 - - - - - - - - - - - - - - Additional costs 5 - Fakt. Nebenk. 1 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB5 - - - - - - - - - - - - - - Additional costs 6 - Fakt. Nebenk. 2 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB6 - - - - - - - - - - - - - - Additional costs 7 - Pos. Nebenk. 1 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB7 - - - - - - - - - - - - - - Additional costs 8 - Pos. Nebenk. 2 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB8 - - - - - - - - - - - - - - Additional costs 9 - Pos. Nebenk. 3 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB9 - - - - - - - - - - - - - - Additional costs 10 - Pos. Nebenk. 4 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB10 - - - - - - - - - - - - - - Additional costs 11 - Pos. Nebenk. 5 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB11 - - - - - - - - - - - - - - Additional costs 12 - Pos. Nebenk. 6 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB12 - - - - - - - - - - - - - - Additional costs 13 - Pos. Nebenk. 7 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB13 - - - - - - - - - - - - - - Additional costs 14 - Pos. Nebenk. 8 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB14 - - - - - - - - - - - - - - Additional costs 15 - Pos. Nebenk. 9 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB15 - - - - - - - - - - - - - - Additional costs 16 - Pos. Nebenk. 10 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB16 - - - - - - - - - - - - - - Additional costs 17 - Pos. Nebenk. 11 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB17 - - - - - - - - - - - - - - Additional costs 18 - Pos. Nebenk. 12 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB18 - - - - - - - - - - - - - - Additional costs 19 - Pos. Nebenk. 13 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB19 - - - - - - - - - - - - - - Additional costs 20 - Pos. Nebenk. 14 - - - false - Decimal(16,4) - - - - MIC_EINPOS - EFPBZUAB20 - - - - - - - - - - - - - - - Additional parameters (generic) - - - - - Key - - - - - Value - - - - - - - This element allows to send attached documents. The format allows to send multiple files in one message - - - - - This entity allows to send attachments, e.g. pdf, jpg, xml, or other binary formats - - - - Attachment (eg. pdf, xml, EDIFACT) - - - - - description of attachment - - - - - Attached file in base64 binary encoding - - - - - Additional parameters as key-value pairs - - - - - - - - - - Description of attachement eg. Name of file, creation date/time etc. - - - - - Mime type of attached document - - - - - - - - - - Creation timestamp of the attached document - - - - - Creation user of the attached document - - - - - - - - - - - - Mode of transportation information - - - - - - Mode of transportation - Art des Verkehrszweigs - String1..2 - - - - - - - - - - - - - Means of transport - Art des aktiven Beförderungsmittels - String1..2 - - - - - - - - - - - - Means of transportation country - Staatszugehörigkeit des Beförderungsmittels - String1..3 - - - - - - - - - - - - Means of transportation vehicle - Kennzeichen des Beförderungsmittels - String1..30 - - - - - - - - - - - - Means of transportation description - Beschreibung des Beförderungsmittels - String1..17 - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - Tariff Number - Tarifnummer - - - true - String1..13 - - MIC_ALL_EAVPOS - EAPTARNR - MIC_EINPOS - EFPTARNR - - - - - - - - - - - - - - VAT code - Einfuhrumsatzsteuercode - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPEUSTCD - MIC_EINPOS - EFPEUSTCD - - - - - - - - - - - - - - Excise tax code - Verbrauchssteuercode - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPVSTCD - MIC_EINPOS - EFPVSTCD - - - - - - - - - - - - - - - License on import invoice line. - - - - - - License type. - Typ der Menge / Wert - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPEGART - MIC_EINPOS - EFPEGART - - - - - - - - - - - - - - License code. - Einfuhrrechtliches Papier - - - false - String1..4 - - MIC_ALL_EAVPOS - EAPEGEAW - MIC_EINPOS - EFPEGEAW - - - - - - - - - - - - - - License number. - Nummer - - - false - String1..16 - - MIC_ALL_EAVPOS - EAPEGNR - MIC_EINPOS - EFPEGNR - - - - - - - - - - - - - - License date. - Datum - - - false - xs:date - - MIC_ALL_EAVPOS - EAPEGDAT - MIC_EINPOS - EFPEGDAT - - - - - - - - License not required flag. If used the other fields are not needed. - Einfuhrerl. nicht benötigt - - - false - Boolean - - MIC_ALL_EAVPOS - EAPNOEGKZ - MIC_EINPOS - EFPNOEGKZ - - - - - - - - - - Pricing information to document how the invoice line was priced - - - - false - - - - - - - - - - - - - - The pricing type - Preistyp - - - false - String1..10 - - MIC_ALL_EAVPOS - EAPPREISTYP - MIC_EINPOS - EFPPREISTYP - - - - - - - - - - - - - The pricing reference, e.g. the contract number. - Preisreferenz - - - false - String1..20 - - MIC_ALL_EAVPOS - EAPPREISREFNO - MIC_EINPOS - EFPPREISREFNO - - - - - - - - - - - - - The pricing date. - Preidatum - - - false - xs:date - - MIC_ALL_EAVPOS - EAPPREISDAT - MIC_EINPOS - EFPPREISDAT - - - - - - - - The pricing system, e.g. SAP. - Preissystem - - - false - String1..10 - - MIC_ALL_EAVPOS - EAPPREISSYS - MIC_EINPOS - EFPPREISSYS - - - - - - - - - - - - - - - Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - false - - - - - - - - - - - - - - Freight cost amount. - Frachtkosten - - - true - Decimal(17,4) - - MIC_EAVSDG - EASFRAWRT - MIC_EINSDG - EFSFRAWRT - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_EAVSDG - EASFRAWAE - MIC_EINSDG - EFSFRAWAE - - - - - - - - - - - - - - Freight International/(Percentage OR Value) of international freight costs of total freight costs. - Frachtkosten International - - - false - Decimal(5,2) - - MIC_EAVSDG - EASNONEU - MIC_EINSDG - EFSNONEU - - - - - - - - - - - - - - Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. - Frachtkosten EU - - - false - Decimal(5,2) - - MIC_EAVSDG - EASEUNAT - MIC_EINSDG - EFSEUNAT - - - - - - - - - - - - - - Freight National/(Percentage OR Value) of inland freight of total freight costs. - Frachtkosten National - - - false - Decimal(5,2) - - MIC_EAVSDG - EASNAT - MIC_EINSDG - EFSNAT - - - - - - - - - - - - - - Calculation Type of Freight Costs/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. - Berechnungsart der Frachtkosten - - - false - String1..1 - - MIC_EAVSDG - EASFRAKZ - MIC_EINSDG - EFSFRAKZ - - - - - - - - - - - - - Absolute international freight cost amount - Frachtwert - - - true - Decimal(17,4) - - MIC_EAVSDG - EASABSNONEUFREIGHT - MIC_EINSDG - EFSFRAWRTNONEUABS - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_EAVSDG - EASABSNONEUFREIGHTCURRENCY - MIC_EINSDG - EFSFRAWAENONEUABS - - - - - - - - - - - - - - Absolute community freight cost amount - Frachtwert - - - true - Decimal(17,4) - - MIC_EAVSDG - EASABSEUFREIGHT - MIC_EINSDG - EFSFRAWRTNEUABS - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_EAVSDG - EASABSEUFREIGHTCURRENCY - MIC_EINSDG - EFSFRAWAENEUABS - - - - - - - - - - - - - - Absolute national freight cost amount - Frachtwert - - - true - Decimal(17,4) - - MIC_EAVSDG - EASABSNATFREIGHT - MIC_EINSDG - EFSFRAWRTNATABS - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_EAVSDG - EASABSNATFREIGHTCURRENCY - MIC_EINSDG - EFSFRAWAENATABS - - - - - - - - - - - - - - - Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - - - Freight Costs - Frachtkosten - - - true - Decimal(16,4) - - MIC_ALL_EAVKOP - EAKFRAWRT - MIC_EINKOP - EFKFRAWRT - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_ALL_EAVKOP - EAKFRAWAE - MIC_EINKOP - EFKFRAWAE - - - - - - - - - - - - - - Freight International/(Percentage OR Value) of international freight costs of total freight costs. - Frachtkosten International - - - false - Decimal(5,2) - - MIC_ALL_EAVKOP - EAKFRANONEU - MIC_EINKOP - EFKFRANONEU - - - - - - - - - - - - - - Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. - Frachtkosten EU - - - false - Decimal(5,2) - - MIC_ALL_EAVKOP - EAKFRAEUNAT - MIC_EINKOP - EFKFRAEUNAT - - - - - - - - - - - - - - Freight National/(Percentage OR Value) of inland freight of total freight costs. - Frachtkosten National - - - false - Decimal(5,2) - - MIC_ALL_EAVKOP - EAKNAT - MIC_EINKOP - EFKNAT - - - - - - - - - - - - - - Calculation Type of Freight Costs/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. - Berechnungsart der Frachtkosten - - - false - String1..1 - - MIC_ALL_EAVKOP - EAKFRAKZ - MIC_EINKOP - EFKFRAKZ - - - - - - - - - - - - - - Freight costs can be added on shipment or invoice level when freight is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - - - Freight Costs - Frachtkosten - - - true - Decimal(17,4) - - MIC_ALL_EAVPOS - EAPFAMOUNT - MIC_EINPOS - EFPFAMOUNT - - - - - - - - - - - - - - Currency Freight Costs - Währung Frachtkosten - - - true - String1..3 - - MIC_ALL_EAVPOS - EAPFWAE - MIC_EINPOS - EFPFWAE - - - - - - - - - - - - - - Freight International/(Percentage OR Value) of international freight costs of total freight costs. - Frachtkosten International - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFNONEU - MIC_EINPOS - EFPFNONEU - - - - - - - - - - - - - - Freight Community/(Percentage OR Value) of freight cost from EU-border to national border of total freight costs. - Frachtkosten EU - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFEU - MIC_EINPOS - EFPFEU - - - - - - - - - - - - - - Freight National/(Percentage OR Value) of inland freight of total freight costs. - Frachtkosten National - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPFNAT - MIC_EINPOS - EFPFNAT - - - - - - - - - - - - - - - Attribut from FreightCosts, P Percentage OR V Value, decides in which form the Freightcosts would be split. - - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPFFLAG - MIC_EINPOS - FIX VALUE "V" - - - - - - - - - - - - - Intra specific fields. - - - - - - Vendor VAT ID - Umsatzsteuernummer des Lieferanten - - - false - String1..20 - - EAVKOP - EAKVATNR - - - - - - - - - - - - - - - Statistical procedure - Statistisches Verfahren - - - false - String1..5 - - EAVKOP - EAKCCTR - - - - - - - - - - - - - - - Internal reference - Interne Referenz - - - false - String1..30 - - EAVKOP - EAKREFI - - - - - - - - - - - - - - - - Intra specific fields. - - - - - - Status - Status - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPSTATUS - - - - - - - - - - - - - - - Invoice date - Rechnungsdatum - - - false - xs:date - - MIC_ALL_EAVPOS - EAPDATUM - - - - - - - - - - Period - Periode - - - false - Long 6 - - MIC_ALL_EAVPOS - EAPPERIODE - - - - - - - - - - - - - - - - Region - Region - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPREGION - - - - - - - - - - - - - - - Statistical procedure - Statistisches Verfahren - - - false - String1..5 - - MIC_ALL_EAVPOS - EAPCCTR - - - - - - - - - - - - - - - Statistical value - Statistischer Wert - - - false - Decimal(16,4) - - MIC_ALL_EAVPOS - EAPGRWERT - - - - - - - - - - - - - - - - Additional costs currency 1 - Nebenkostenwährung 1 - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPPBK1WAE - - - - - - - - - - - - - - - Additional costs type 1 - Nebenkostenart 1 - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPPBK1TYP - - - - - - - - - - - - - - - Additional costs currency 2 - Nebenkostenwährung 2 - - - false - String1..3 - - MIC_ALL_EAVPOS - EAPPBK2WAE - - - - - - - - - - - - - - - Additional costs type 2 - Nebenkostenart 2 - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPPBK2TYP - - - - - - - - - - - - - - - - Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - - - Insurance Costs - Versicherungskosten - - - true - Decimal(19,6) - - MIC_EAVSDG - EASVERSWRT - MIC_EINSDG - EFSVERSWRT - - - - - - - - - - - - - - Currency Insurance - Währung Versicherungskosten - - - true - String1..3 - - MIC_EAVSDG - EASVERSWAE - MIC_EINSDG - EFSVERSWAE - - - - - - - - - - - - - - Calculation Type of Insurance - Berechnungsart der Versicherung - - - false - String1..1 - - MIC_EAVSDG - EASVERSKZ - MIC_EINSDG - EFSVERSKZ - - - - - - - - - - - - - - Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - - - Insurance Costs - Versicherungskosten - - - true - Decimal(19,6) - - MIC_ALL_EAVKOP - EAKVERSWRT - MIC_EINKOP - EFKVERSWRT - - - - - - - - - - - - - - Currency Insurance - Währung Versicherungskosten - - - true - String1..3 - - MIC_ALL_EAVKOP - EAKVERSWAE - MIC_EINKOP - EFKVERSWAE - - - - - - - - - - - - - - Calculation Type of Insurance - Berechnungsart der Versicherung - - - false - String1..1 - - MIC_ALL_EAVKOP - EAKVERSKZ - MIC_EINKOP - EFKVERSKZ - - - - - - - - - - - - - - Insurance costs can be added on shipment or invoice level when insurance is not included in invoice value. They are pro-rated to the invoice lines as indicated. - - - - - - Insurance Costs - Versicherungskosten - - - true - Decimal(17,4) - - MIC_ALL_EAVPOS - EAPVERSWERT - MIC_EINPOS - EFPVERSWERT - - - - - - - - - - - - - - Currency Insurance - Währung Versicherungskosten - - - true - String1..3 - - MIC_ALL_EAVPOS - EAPVERSWAE - MIC_EINPOS - EFPVERSWAE - - - - - - - - - - - - - - - Rebates can be added on invoice level . They are pro-rated to the invoice lines as indicated. - - - - - - Discount - Rabatt - - - true - Decimal(17,4) - - MIC_ALL_EAVKOP - EAKRABATTWERT - MIC_EINKOP - EFKRABATTWERT - - - - - - - - - - - - - - Currency Discount/ISO currency code - Währung Rabatt - - - true - String1..3 - - MIC_ALL_EAVKOP - EAKRABATTWAE - MIC_EINKOP - EFKRABATTWAE - - - - - - - - - - - - - - Calculation Type of Discount/Indicator for how the rebate is pro-rated to the invoice lines. V=value based, Q=quantity based. - Berechnungsart Rabatt - - - false - String1..1 - - MIC_ALL_EAVKOP - EAKRABATTKZ - MIC_EINKOP - EFKRABATTKZ - - - - - - - - - - - - - - Rebates can be added on invoice level . They are pro-rated to the invoice lines as indicated. - - - - - - Discount - Rabatt - - - true - Decimal(17,4) - - MIC_ALL_EAVPOS - EAPRABATTWERT - MIC_EINPOS - EFPRABATTWERT - - - - - - - - - - - - - - Currency Discount - Währung Rabatt - - - true - String1..3 - - MIC_ALL_EAVPOS - EAPRABATTWAE - MIC_EINPOS - EFPRABATTWAE - - - - - - - - - - - - - - - - Addition IVAT/AdditionalCostsVAT can be added on invoice level - Zuschlag EUSt. - - - false - - - - - - - - - - - - - Manual Addition IVAT - Manueller Zuschlag EUSt. - - - true - Decimal(17,4) - - MIC_ALL_EAVPOS - EAPMANZUEUST - MIC_EINPOS - EFPMANZUEUST - - - - - - - - - - - - - - Currency Manual Addition IVAT - Währung Manueller Zuschlag EUSt. - - - true - String1..3 - - MIC_ALL_EAVPOS - EAPMANZUEUSTWAE - MIC_EINPOS - EFPMANZUEUSTWAE - - - - - - - - - - - - - - - - Additional costs can be added on all levels as additional part value components. They are pro-rated to the invoice lines as indicated. - - - - false - - 0-2 - - - - - - - - - - - - Add. Costs Type 1, Add. Costs Type 2/Additional cost type. The type is a description like ASSIST, REBATE, etc. - Art der Nebenkosten1, Art der Nebenkosten 2 - - - true - String1..10 - - - ___ABART1, ___ABART2 - - ___ABART1, ___ABART2 - - - - - - - - - - - - - - Value Additional Costs 1, Value Additional Costs 2/Additional cost amount. (negative amounts are possible for deductions). - Wert der Nebenkosten 1, Wert der Nebenkosten 2 - - - true - Decimal(17,4) - - - ___ABWRT1, ___ABWRT2 - - ___ABWRT1, ___ABWRT2 - - - - - - - - - - - - - - Currency Additional Costs 1,Currency Additional Costs 1/Iso currency code. - Währung Nebenkosten 1, Währung Nebenkosten 2 - - - true - String1..3 - - - ___ABWAE1, ___ABWAE2 - - ___ABWAE1, ___ABWAE2 - - - - - - - - - - - - - - Calculation Type of Insurance/Indicator for how the additional costs are pro-rated to the invoice lines. V=value based, Q=quantity based. - Berechnungsart der Versicherung - - - false - String1..1 - - - ___VERSKZ - - ___VERSKZ - - - - - - - - - - - - - - Additional attributes can be used to add customer specific fields to the module as customization. - - - - - - Attribute - Attribut - - - - - - - - - Attribute - Attribut - - - - - - - Attribute type - Adresstyp - - - true - String1..20 - - MIC_AVATTRIBUTE - AVATYP - MIC_ATTRIBUTE - ATRTYP - - - - - - - - - - - - - - Attribute text - Text - - - true - String1..2000 - - MIC_AVATTRIBUTE - AVATEXT - MIC_ATTRIBUTE - ATRTEXT - - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_AVATTRIBUTE - AVACREUSER - MIC_ATTRIBUTE - ATRCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_AVATTRIBUTE - AVACREDAT - MIC_ATTRIBUTE - ATRCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_AVATTRIBUTE - AVAUSER - MIC_ATTRIBUTE - ATRUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_AVATTRIBUTE - AVAUSEDAT - MIC_ATTRIBUTE - ATRUSEDAT - - - - - - - - - Business partner information - - - - - - Business partner - Geschaeftspartner - - - true - - - - - MIC_CUST_PARTNER - - - - - - - - - - Partner as address number, type and optional address details - - - - - - Address type - Adresstyp - - - true - String1..2 - - MIC_CUST_AVPARTNER - AVPTYP - MIC_CUST_PARTNER - PARTYP - - - - - - - - - - - - - - Address details - Adressdetails - - - true - - - MIC_CUST_AVPARTNER - addrNo:AVPNR, addrNoType:AVPNRTYP, addrName:AVPNAME1,AVPNAME2, addrStreet:AVPSTR1, addrLoc:AVPORT, addrCtry:AVPLD, addrState:AVPREGION, addrZip:AVPPLZ, addrTin:AVPTIN, addrEori:AVPEORI, partnerRelation:AVPKVB, addrDistrict:AVPORTSTEIL, addrBranchNo:AVPBRANCHNO, email:AVPSACHMAIL, addrVatNumber:AVPVATNUMBER - MIC_CUST_PARTNER - addrNo:PARNR, addrNoType:PARNRTYP, addrName:PARNAME1,PARNAME2, addrStreet:PARSTR1, addrLoc:PARORT, addrCtry:PARLD, addrState:PARREGION, addrZip:PARPLZ, addrTin:PARTIN, addrEori:PAREORI, partnerRelation:PARKVB, addrDistrict:PARORTSTEIL, addrBranchNo:PARBRANCHNO, email:PARSACHMAIL, addrVatNumber:PARVATNUMBER - - - - - - - - Related party indicator - Verbundenheit - - - false - String1..1 - - MIC_CUST_AVPARTNER - AVPKVB - MIC_CUST_PARTNER - PARKVB - - - - - - - - - - - - - Additional information - Zusätzliche Angaben - - - false - String1..50 - - MIC_CUST_AVPARTNER - AVPINFO - MIC_CUST_PARTNER - PARINFO - - - - - - - - - - - - - Contact Phone Number - Kontakt Telefonnummer - - - false - String1..40 - - MIC_CUST_AVPARTNER - AVPTELNR - MIC_CUST_PARTNER - PARTELNR - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_CUST_AVPARTNER - AVPCREUSER - MIC_CUST_PARTNER - PARCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_CUST_AVPARTNER - AVPCREDAT - MIC_CUST_PARTNER - PARCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_CUST_AVPARTNER - AVPUSEDAT - MIC_CUST_PARTNER - PARUSEDAT - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_CUST_AVPARTNER - AVPUSER - MIC_CUST_PARTNER - PARUSER - - - - - - - - - Container - - - - - - This is not mapped for shipment. Container/Indicator whether this is a containerized shipment. 1=yes, 0=no. - Container - - - false - String1..1 - - - ___CON - - ___CON - - - - - - - - - - - - - Number of Containers - Containernummern - - - false - String1..20 - - - ___CONTNO - - ___CONTNR - - - - - - - - - - - - - Container type - Containertyp - - - false - String1..10 - - - ___CONTTYP - - ___REFTYP - - - - - - - - - - - - - This is not mapped for shipment. Container/Indicator whether this is a containerized shipment. 1=yes, 0=no. - Container - - - false - String1..1 - - - ___CONTLCL - - ___CONTLCL - - - - - - - - - - - - - - List of Detail container infos - - - - - - Container information - Containerdaten - - - true - - - - - MIC_CUST_CONT - - - - - - - - - - Detail container info - - - - - - Number of Containers - Containernummern - - - true - String1..17 - - MIC_CUST_AVCONT - COACONTNR - MIC_CUST_CONT - CONCONTNR - - - - - - - - - - - - - Number of seal container - Siegelnummer - - - true - String1..20 - - MIC_CUST_AVCONT - COASEALNR - MIC_CUST_CONT - CONSEALNR - - - - - - - - - - - - - Container packages - Anzahl Packstücke im Container - - - false - Decimal(6) - - not mapped - - - - - - - - - - - - - - - - - Container gross weight - Bruttogewicht ds Containers - - - false - Decimal(14,6) - - not mapped - - - - - - - - - - - - - - - - - Container net weight - Nettogewicht des Containers - - - false - Decimal(14,6) - - not mapped - - - - - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_CUST_AVCONT - COACREUSER - MIC_CUST_CONT - CONCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_CUST_AVCONT - COACREDAT - MIC_CUST_CONT - CONCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_CUST_AVCONT - COAUSER - MIC_CUST_CONT - CONUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_CUST_AVCONT - COAUSEDAT - MIC_CUST_CONT - CONUSEDAT - - - - - - - - - Address - - - - - - Address number - Adressnummer - String1..15 - - - - - - - - - - - - - Address number type - Adressnummerntyp - String1..10 - - - - - - - - - - - - Address name - Name - String1..40 - - - - - - - - - - Address street - Straße - String1..80 - - - - - - - - - - Address location - Ort - String1..80 - - - - - - - - - - Address country - Land - String1..3 - - - - - - - - - - Address state - Region - String1..10 - - - - - - - - - - Address zip code - Postleitzahl - String1..10 - - - - - - - - - - Trader identification number (TIN) - Zollnummer (TIN) - String1..17 - - - - - - - - - - Economic operator's registration and identification number (EORI) - Identifizierung des Wirtschaftsbeteiligten (EORI) - String1..17 - - - - - - - - - - - - Related party indicator - Verbundenheit - String1..1 - - - - - - - - - - - - Address district - Ortsteil - String1..35 - - - - - - - - - - - - Branch number - Niederlassungsnummer - String1..4 - - - - - - - - - - - - E-Mail - E-Mail - String1..256 - - - - - - - - - - - - VAT registration number - Umsatzsteuernummer - String1..20 - - - - - - - - - - - - - Address number - - - - - - - - Address name - - - - - - - - Address street - - - - - - - - Address postal code - - - - - - - - Address location - - - - - - - - Address country - - - - - - - - - Address state - - - - - - - - Address TIN - - - - - - - - Address national tin flag - - - - - - - - - Documents - - - - false - 1-n - - MIC_EINSDGDOC - - - - - - - - - - - Document - Unterlage - - - true - - - MIC_EINSDGDOC - - - - - - - - - - - - - - - Document number - Unterlagennummer - - - true - String1..35 - - MIC_EINSDGDOC - ESDNR - MIC_EINSDGDOC - ESDNR - - - - - - - - - - - - - - Document date - Datum der Unterlage - - - true - xs:date - - MIC_EINSDGDOC - ESDDAT - MIC_EINSDGDOC - ESDDAT - - - - - - - - Type of identification - Art der Identifikation - - - true - String1..6 - - MIC_EINSDGDOC - ESDART - MIC_EINSDGDOC - ESDART - - - - - - - - - - - - - - Document qualification - Qualifikation - - - false - String1..3 - - MIC_EINSDGDOC - ESDQUAL - MIC_EINSDGDOC - ESDQUAL - - - - - - - - - - - - - Document vaid from date - Gültig von - - - false - xs:date - - MIC_EINSDGDOC - ESDAVAILDAT - MIC_EINSDGDOC - ESDAVAILDAT - - - - - - - - Document valid to date - Gültig bis - - - false - xs:date - - MIC_EINSDGDOC - ESDENDDAT - MIC_EINSDGDOC - ESDENDDAT - - - - - - - - Additional text of document - Zusatzinformation - - - false - String1..35 - - MIC_EINSDGDOC - ESDINFO - MIC_EINSDGDOC - ESDINFO - - - - - - - - - - - - - Quantity - Menge - - - false - Decimal(13,4) - - MIC_EINSDGDOC - ESDMENGE - MIC_EINSDGDOC - ESDMENGE - - - - - - - - - - - - - - Unit write-off quantity - Einheit der Abschreibungsmenge - - - false - String1..4 - - MIC_EINSDGDOC - ESDABMEH2 - MIC_EINSDGDOC - ESDABMEH2 - - - - - - - - - - - - - Value - Wert - - - false - Number(16,6) - - MIC_EINSDGDOC - ESDWERT - MIC_EINSDGDOC - ESDWERT - - - - - - - - - - - - - - Category - Bereich - - - false - String1..8 - - MIC_EINSDGDOC - ESDBEREICH - MIC_EINSDGDOC - ESDBEREICH - - - - - - - - - - - - - Write-off Quantity - Abschreibungsmenge - - - false - Decimal(16,7) - - MIC_EINSDGDOC - ESDABMENGE - MIC_EINSDGDOC - ESDABMENGE - - - - - - - - - - - - - - Issuer country - Ausstellerland - - - false - String1..3 - - MIC_EINSDGDOC - ESDAUSSTELLERLD - MIC_EINSDGDOC - ESDAUSSTELLERLD - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_EINSDGDOC - ESDCREUSER - MIC_EINSDGDOC - ESDCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_EINSDGDOC - ESDCREDAT - MIC_EINSDGDOC - ESDCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_EINSDGDOC - ESDUSER - MIC_EINSDGDOC - ESDUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_EINSDGDOC - ESDUSEDAT - MIC_EINSDGDOC - ESDUSEDAT - - - - - - - - - - Delivery terms - - - - false - - - - - - - - - - - - - - Term of Delivery - Lieferbedingung - - - true - String1..4 - - MIC_ALL_EAVKOP - EAKELICODE - MIC_EINKOP - EFKELICODE - - - - - - - - - - - - - - Place of the Terms of Delivery - Ort der Lieferbedingung - - - false - String1..35 - - MIC_ALL_EAVKOP - EAKELIBEZ - MIC_EINKOP - EFKELIBEZ - - - - - - - - - - - - - Calculation of Freight Costs - Frachtkostenberechnung - - - false - String1..4 - - MIC_ALL_EAVKOP - EAKELIFORMULA - MIC_EINKOP - EFKELIFORMULA - - - - - - - - - - - - - The terms of delivery code 2 - Lieferbedingung 2 - - - false - String1..2 - - MIC_ALL_EAVKOP - EAKELICOD2 - MIC_EINKOP - EFKELICOD2 - - - - - - - - - - - - - - - Item - - - - true - - - - - - - - - - - - - - Part Number - Artikelnummer - - - false - String1..30 - - EAVPOS - EAPARTNR - EINPOS - EFPARTNR - - - - - - - - - - - - - - Part Description - Warenbezeichnung - - - false - String1..240 - - EAVPOS - EAPARTBEZ - EINPOS - EFPARTBEZ - - - - - - - - - - - - - - Serial Number - Seriennummer - - - false - String1..30 - - EAVPOS - EAPSERNR - EINPOS - EFPSERNR - - - - - - - - - - - - - - Product Family - Produktgruppe - - - false - String1..10 - - EAVPOS - EAPPRODGR - EINPOS - EFPPRODGR - - - - - - - - - - - - - - Model - Modell - - - false - String1..400 - - MIC_ALL_EAVPOS - EAPMODEL - MIC_EINPOS - EFPMODEL - - - - - - - - - - - - - - Brand - Marke - - - false - String1..400 - - MIC_ALL_EAVPOS - EAPBRAND - MIC_EINPOS - EFPBRAND - - - - - - - - - - - - - - Manufacturer - Hersteller - - - false - String1..15 - - MIC_ALL_EAVPOS - EAPMFRNR - MIC_EINPOS - EFPMFRNR - - - - - - - - - - - - - - CTO Number - CTO Nummer - - - false - String1..41 - - MIC_ALL_EAVPOS - EAPGTCTOID - MIC_EINPOS - EFPGTCTOID - - - - - - - - - - - - - - Confidence Level - Tariffierungskennzeichen - - - false - Long 5 - - MIC_ALL_EAVPOS - EAPCONFIDENCELEVEL - MIC_EINPOS - EFPCONFIDENCELEVEL - - - - - - - - - - - Product Category - Warengruppe - - - false - String1..1 - - MIC_ALL_EAVPOS - EAPWG - MIC_EINPOS - EFPWG - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - Package - - - - false - - - - - - - - - - - - - - Number of Packages - Anzahl Packstücke - - - true - Decimal(6) - - MIC_ALL_EAVPOS - EAPKOLANZ - MIC_EINPOS - EFPKOLANZ - - - - - - - - - - - - - - Package Description - Packstückbezeichnung - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPKOLLIART - MIC_EINPOS - EFPKOLLIART - - - - - - - - - - - - - Package Type - Packstückart - - - false - String1..25 - - MIC_ALL_EAVPOS - EAPKOLART - MIC_EINPOS - EFPKOLART - - - - - - - - - - - - - - - Receipt - - - - false - - - - - - - - - - - - - - Goods Receipt Number - Wareneingangsnummer - - - false - String1..15 - - MIC_ALL_EAVPOS - EAPWENR - MIC_EINPOS - EFPWENR - - - - - - - - - - - - - The goods receipt date. - Wareneingangsdatum - - - false - xs:date - - MIC_ALL_EAVPOS - EAPWEDAT - MIC_EINPOS - EFPWEDAT - - - - - - - - - - Bill of material - - - - false - - - - - - - - - - - - - - Bill of Materials - Stückliste - - - false - String1..40 - - MIC_ALL_EAVPOS - EAPREZNR - MIC_EINPOS - EFPREZNR - - - - - - - - - - - - - - BoM Variant - Stücklistenvariante - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPREZVAR - MIC_EINPOS - EFPREZVAR - - - - - - - - - - - - - - - - Bill of material - - - - false - - - - - - - - - - - - - - Due Group 1 - Abgabengruppe 1 - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPEFAAGRPVV1 - MIC_EINPOS - EFPEFAAGRPVV1 - - - - - - - - - - - - - Reduction Amount 1 - Minderungsbetrag 1 - - - false - Decimal(11,2) - - MIC_ALL_EAVPOS - EAPEFAMBPV1 - MIC_EINPOS - EFPEFAMBPV1 - - - - - - - - - - - - - - Due Group 2 - Abgabengruppe 2 - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPEFAAGRPVV2 - MIC_EINPOS - EFPEFAAGRPVV2 - - - - - - - - - - - - - Reduction Amount 2 - Minderungsbetrag 2 - - - false - Decimal(11,2) - - MIC_ALL_EAVPOS - EAPEFAMBPV2 - MIC_EINPOS - EFPEFAMBPV2 - - - - - - - - - - - - - - Due Group 3 - Abgabengruppe 3 - - - false - String1..2 - - MIC_ALL_EAVPOS - EAPEFAAGRPVV3 - MIC_EINPOS - EFPEFAAGRPVV3 - - - - - - - - - - - - - Reduction Amount 3 - Minderungsbetrag 3 - - - false - Decimal(11,2) - - MIC_ALL_EAVPOS - EAPEFAMBPV3 - MIC_EINPOS - EFPEFAMBPV3 - - - - - - - - - - - - - - - Previous documents - - - - - - Previous document - Vorpapier - - - true - - - - - MIC_EINDOC - - - - - - - - - - - - - Previous Document Type - Art des Vorpapiers - - - true - String1..9 - - MIC_EAVDOC - EADVSSART - MIC_EINDOC - EFDVSSART - - - - - - - - - - - - - Previous Document Number - Vorpapiernummer - - - true - String1..24 - - MIC_EAVDOC - EADVSSNR - MIC_EINDOC - EFDVSSNR - - - - - - - - - - - - - Previous document date - Vorpapierdatum - - - true - xs:date - - MIC_EAVDOC - EADVSSDAT - MIC_EINDOC - EFDVSSDAT - - - - - - - - Departure Customs Office - Abgang Zollstelle - - - false - String1..20 - - MIC_EAVDOC - EADABZOST - MIC_EINDOC - EFDABZOST - - - - - - - - - - - - - Destination Customs Office - Bestimmungszollstelle - - - false - String1..8 - - MIC_EAVDOC - EADZOST - MIC_EINDOC - EFDZOST - - - - - - - - - - - - - Category - Kategorie - - - false - String1..1 - - MIC_EAVDOC - EADTYP - MIC_EINDOC - EFDTYP - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_EAVDOC - EADCREUSER - MIC_EINDOC - EFDCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_EAVDOC - EADCREDAT - MIC_EINDOC - EFDCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_EAVDOC - EADUSER - MIC_EINDOC - EFDUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_EAVDOC - EADUSEDAT - MIC_EINDOC - EFDUSEDAT - - - - - - - - - - - - - - false - - - - - - - - - - - - - - Type of identification of transport on arrival - Art der Transportidentifikation bei Ankunft - - - false - String1..2 - - MIC_EAVSDG - EASVKZINIDENTIFICATIONTYPE - MIC_EINSDG - EFSVKZINIDENTIFICATIONTYPE - - - - - - - - - - - - - Declaration type - Kz. Nachrichtensteuerung - - - false - String1..1 - - MIC_EAVSDG - EASMESSVORZKZ - MIC_EINSDG - EFSMESSVORZKZ - - - - - - - - - - - - - - Data elements including payment information - - - - - - Payment Type - Zahlungsart - - - false - String1..1 - - MIC_ALL_EAVKOP - EAKPAYMENTTYPE - MIC_EINKOP - EFKPAYMENTTYPE - - - - - - - - - - - - - Payment Date - Zahlungstermin - - - false - xs:datetime - - MIC_ALL_EAVKOP - EAKPAYMENTDATE - MIC_EINKOP - EFKPAYMENTDATE - - - - - - - - - - - Payment Bank Code - Zahlungsbankleitzahl - - - false - String1..20 - - MIC_ALL_EAVKOP - EAKPAYMENTBANKCODE - MIC_EINKOP - EFKPAYMENTBANKCODE - - - - - - - - - - - - - Payment Bank Branch Code - Zahlung Bank Branch Code - - - false - String1..20 - - MIC_ALL_EAVKOP - EAKPAYMENTBANKBRANCHCODE - MIC_EINKOP - EFKPAYMENTBANKBRANCHCODE - - - - - - - - - - - - - Payment Currency - Zahlungswährung - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKPAYMENTCURRENCY - MIC_EINKOP - EFKPAYMENTCURRENCY - - - - - - - - - - - - - - Data elements including registration numbers - - - - - - CRN / Registration No. - Registriernummer Abfertigung - - - false - String1..35 - - MIC_ALL_EAVPOS - EAPMESSREGNR - MIC_EINPOS - EFPMESSREGNR - - - - - - - - - - - - - EGZ / Registration No. - Registriernummer EGZ - - - false - String1..35 - - MIC_ALL_EAVPOS - EAPMESSREGNR2 - MIC_EINPOS - EFPMESSREGNR2 - - - - - - - - - - - - - Registr. No. 3 - Registriernummer 3 - - - false - String1..35 - - MIC_ALL_EAVPOS - EAPMESSREGNR3 - MIC_EINPOS - EFPMESSREGNR3 - - - - - - - - - - - - - Registr. No. 4 - Registriernummer 4 - - - false - String1..35 - - MIC_ALL_EAVPOS - EAPMESSREGNR4 - MIC_EINPOS - EFPMESSREGNR4 - - - - - - - - - - - - - Message Ref Number 1 - Nachr.Referenz Abf. - - - false - String1..22 - - - - MIC_EINPOS - EFPMESSREFNR - - - - - - - - - - - - - Message Ref Number 2 - Nachr.Referenz EGZ - - - false - String1..52 - - - - MIC_EINPOS - EFPMESSREFNR2 - - - - - - - - - - - - - Message Ref Number 3 - Nachr.Referenz 3 - - - false - String1..22 - - - - MIC_EINPOS - EFPMESSREFNR3 - - - - - - - - - - - - - Position Number 1 - Positionnummer Abf. - - - false - Decimal(5) - - - - MIC_EINPOS - EFPMESSPOSNR1 - - - - - - - - - - - - - Position Number 2 - Positionsnummer EGZ. - - - false - Decimal(5) - - - - MIC_EINPOS - EFPMESSPOSNR2 - - - - - - - - - - - - - - - - - - - - - Duties - calculated by external system - - - - false - - 0-n - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - Type of Identification - Art der Identifikation - - - true - String1..3 - - MIC_CUST_WB_EXTDUTY - EXWTYPE - MIC_CUST_WB_EXTDUTY - EXWTYPE - - - - - - - - - - - - - Calculated Duty Base - - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWCALCDUTYBASE - MIC_CUST_WB_EXTDUTY - EXWCALCDUTYBASE - - - - - - - - - - - - - - Currency - - - - false - String1..3 - - MIC_CUST_WB_EXTDUTY - EXWCURRENCY - MIC_CUST_WB_EXTDUTY - EXWCURRENCY - - - - - - - - - - - - - Code - Code - - - false - String1..4 - - MIC_CUST_WB_EXTDUTY - EXWCODE - MIC_CUST_WB_EXTDUTY - EXWCODE - - - - - - - - - - - - - Rate - Satz - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWRATE - MIC_CUST_WB_EXTDUTY - EXWRATE - - - - - - - - - - - - - - Amount - Betrag - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWAMOUNT - MIC_CUST_WB_EXTDUTY - EXWAMOUNT - - - - - - - - - - - - - - Add deduct - Abzug hinzufügen - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWADDDEDUCT - MIC_CUST_WB_EXTDUTY - EXWADDDEDUCT - - - - - - - - - - - - - - Calculated Duty - - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWCALCDUTY - MIC_CUST_WB_EXTDUTY - EXWCALCDUTY - - - - - - - - - - - - - - Duty - - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWDUTY - MIC_CUST_WB_EXTDUTY - EXWDUTY - - - - - - - - - - - - - - Duty base - - - - false - Decimal(14,4) - - MIC_CUST_WB_EXTDUTY - EXWDUTYBASE - MIC_CUST_WB_EXTDUTY - EXWDUTYBASE - - - - - - - - - - - - - - Measure Code - - - - false - String1..4 - - MIC_CUST_WB_EXTDUTY - EXWMEASURECODE - MIC_CUST_WB_EXTDUTY - EXWMEASURECODE - - - - - - - - - - - - - Measure - - - - false - String1..100 - - MIC_CUST_WB_EXTDUTY - EXWMEASURE - MIC_CUST_WB_EXTDUTY - EXWMEASURE - - - - - - - - - - - - - Authority duty code - - - - false - String1..4 - - MIC_CUST_WB_EXTDUTY - EXWAUTHORITYDUTYCODE - MIC_CUST_WB_EXTDUTY - EXWAUTHORITYDUTYCODE - - - - - - - - - - - - - Territory - - - - false - String1..4 - - MIC_CUST_WB_EXTDUTY - EXWTERRITORY - MIC_CUST_WB_EXTDUTY - EXWTERRITORY - - - - - - - - - - - - - Type add Code - - - - false - String1..1 - - MIC_CUST_WB_EXTDUTY - EXWTYPEADDCODE - MIC_CUST_WB_EXTDUTY - EXWTYPEADDCODE - - - - - - - - - - - - - Number add code - - - - false - String1..3 - - MIC_CUST_WB_EXTDUTY - EXWNUMBERADDCODE - MIC_CUST_WB_EXTDUTY - EXWNUMBERADDCODE - - - - - - - - - - - - - Tariff rate quota - - - - false - String1..6 - - MIC_CUST_WB_EXTDUTY - EXWTARIFFRATEQUOTA - MIC_CUST_WB_EXTDUTY - EXWTARIFFRATEQUOTA - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_CUST_WB_EXTDUTY - EXWCREUSER - MIC_CUST_WB_EXTDUTY - EXWCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_CUST_WB_EXTDUTY - EXWCREDAT - MIC_CUST_WB_EXTDUTY - EXWCREDAT - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_CUST_WB_EXTDUTY - EXWUSER - MIC_CUST_WB_EXTDUTY - EXWUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_CUST_WB_EXTDUTY - EXWUSEDAT - MIC_CUST_WB_EXTDUTY - EXWUSEDAT - - - - - - - - - - - - - - - - true - - - MIC_EINABG - - - - - - - - - - - - - - - Type - Abgabenart - - - true - String1..6 - - - - MIC_EINABG - EFAABART - - - - - - - - - - - - - Code - Code - - - true - String1..4 - - - - MIC_EINABG - EFACODE - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - true - Decimal(16,4) - - - - MIC_EINABG - EFAABGABE - - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - false - Decimal(16,4) - - - - MIC_EINABG - EFAABGABEZW - - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - false - String1..1 - - - - MIC_EINABG - EFAANLKZ - - - - - - - - - - - - - Unit - Einheit - - - false - String1..4 - - - - MIC_EINABG - EFABEMEH - - - - - - - - - - - - - Base - ATLAS Bemessungsgrundlage - - - false - Decimal(16,4) - - - - MIC_EINABG - EFABEMESSG - - - - - - - - - - - - - - Base - ATLAS Bemessungsgrundlage - - - false - String1..2 - - - - MIC_EINABG - EFACTRY - - - - - - - - - - - - - Calculated Duty - Abgabe - - - false - Decimal(16,4) - - - - MIC_EINABG - EFAERRABGABE - - - - - - - - - - - - - - Calculation Base - Bemessungsgrundlage - - - false - Decimal(16,4) - - - - MIC_EINABG - EFAERRBEMESSG - - - - - - - - - - - - - - Area Code - - - - false - String1..4 - - - - MIC_EINABG - EFAGEOGRGEBID - - - - - - - - - - - - - Measure - Massnahmenart - - - false - String1..6 - - - - MIC_EINABG - EFAMASSN - - - - - - - - - - - - - Measure - Massnahmenart - - - false - String1..4 - - - - MIC_EINABG - EFAOFFCODE - - - - - - - - - - - - - Indenture Number - - - - false - String1..6 - - - - MIC_EINABG - EFAORDNUNGSNR - - - - - - - - - - - - - Rate - Satz - - - false - Decimal(16,4) - - - - MIC_EINABG - EFASATZ - - - - - - - - - - - - - - Cancellation Flag - Storno - - - false - String1..1 - - - - MIC_EINABG - EFASTORNO - - - - - - - - - - - - - Duty amount increase or decrease - - - - false - Decimal(16,4) - - - - MIC_EINABG - EFAZUAB - - - - - - - - - - - - - - Type of additional code - - - - false - String1..1 - - - - MIC_EINABG - EFAZUSCDART - - - - - - - - - - - - - Number of additional code - - - - false - String1..3 - - - - MIC_EINABG - EFAZUSCDNR - - - - - - - - - - - - - Calculated duty rate - - - - false - Decimal(16,4) - - - - MIC_EINABG - EFAERRSATZ - - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - - - MIC_EINABG - EFACREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - - - MIC_EINABG - EFACREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - - - MIC_EINABG - EFAUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - - - MIC_EINABG - EFAUSEDAT - - - - - - - - - - - - - - - - true - - - - - MIC_CUST_DUTY_SAVING - - - - - - - - - - - - - Type - Abgabenart - - - false - String1..6 - - - - MIC_CUST_DUTY_SAVING - CDSDUTYTYPE - - - - - - - - - - - - - Code - Code - - - false - String1..4 - - - - MIC_CUST_DUTY_SAVING - CDSCODE - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSDUTY - - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSDUTYZW - - - - - - - - - - - - - - "A" for automatically created, "M" for manually created - Erstellungs KZ - - - false - String1..1 - - - - MIC_CUST_DUTY_SAVING - CDSCREATIONFLAG - - - - - - - - - - - - - Unit - Einheit - - - false - String1..4 - - - - MIC_CUST_DUTY_SAVING - CDSCALCBASEUNIT - - - - - - - - - - - - - Base - ATLAS Bemessungsgrundlage - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSCALCBASE - - - - - - - - - - - - - - Base - ATLAS Bemessungsgrundlage - - - false - String1..2 - - - - MIC_CUST_DUTY_SAVING - CDSCTRY - - - - - - - - - - - - - Duty - ATLAS Abgabe - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSCALCULATEDDUTY - - - - - - - - - - - - - - Base - ATLAS Bemessungsgrundlage - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSCALCULATEDCALCBASE - - - - - - - - - - - - - - Measure - Massnahmenart - - - false - String1..6 - - - - MIC_CUST_DUTY_SAVING - CDSMEASURE - - - - - - - - - - - - - Rate - Satz - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSRATE - - - - - - - - - - - - - - Addition - Zusatz - - - false - Decimal(16,4) - - - - MIC_CUST_DUTY_SAVING - CDSADDITION - - - - - - - - - - - - - - Preferential flag - Präferenziell - - - false - String1..1 - - - - MIC_CUST_DUTY_SAVING - CDSPREFERENTIAL - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - - - MIC_CUST_DUTY_SAVING - CDSCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - - - MIC_CUST_DUTY_SAVING - CDSCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - - - MIC_CUST_DUTY_SAVING - CDSUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - - - MIC_CUST_DUTY_SAVING - CDSUSEDAT - - - - - - - - - - - Container ID .mapped by 'eseconid' - - - - - - - - - - Validierungskennzeichen.mapped by 'esevalidkz' - - - - - - - - - - Storno.mapped by 'esestorno' - - - - - - - - - - Zeichen des angebrachten Verschlusses laut Versandanmeldung.mapped by 'esezeichensoll' - - - - - - - - - - Tatsächliches Zeichen des angebrachten Verschlusses..mapped by 'esezeichenist' - - - - - - - - - - - - - - - Company - Mandant - - - true - String1..2 - - MIC_ALL_EAVKOP - EAKMANDANT - - - - - - - - - - - - - - - Plant - Werk - - - true - String1..2 - - MIC_ALL_EAVKOP - EAKWERK - - - - - - - - - - - - - - - Type - - - - false - String1..1 - - MIC_ALL_EAVKOP - EAKTYP - - - - - - - - - - - - - - - The invoice number. - Rechnungsnummer - - - true - String1..30 - - MIC_ALL_EAVKOP - EAKFAKTNR - - - - - - - - - - - - - - - - An unique version id. - - - - false - String1..50 - - MIC_ALL_EAVKOP - EAKVERSION - - - - - - - - - - - - - - - The invoice date. - Rechnungsdatum - - - false - xs:date - - MIC_ALL_EAVKOP - EAKFAKTDAT - - - - - - - - - - - - - - - Customs date - - - - false - xs:dateTime - - MIC_ALL_EAVKOP - EAKVZDAT - - - - - - - - - - - - - Dispatch country - - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKHELD - - - - - - - - - - - - - - - Last dispatch country - - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKLEHELD - - - - - - - - - - - - - - - Destination place - - - - false - String1..20 - - MIC_ALL_EAVKOP - EAKBSTORT - - - - - - - - - - - - - - - Destination region - - - - false - String1..2 - - MIC_ALL_EAVKOP - destinationRegion - - - - - - - - - - - - - - - Office entry - - - - false - String1..8 - - MIC_ALL_EAVKOP - EAKEINZOST - - - - - - - - - - - - - - - - - The mode of transportation at the border. -EAKVKZGR -EAKVKMART -EAKVKML -EAKVKMGRK -EAKVKMINBEZ - - - - - The inland mode of transport information -EAKVKZIN -EAKVKMINK -EAKVKMINK - - - - - - - - - - false - - - MIC_EAVSDG - EAK___ - - - - - - - - - - PreviousDocument - - - - - - - Previous doc type - Art des Vorpapiers - - - true - String1..3 - - MIC_ALL_EAVKOP - EAKVSSART - - - - - - - - - - - - - - - Previous doc number - Vorpapiernummer - - - true - String1..18 - - MIC_ALL_EAVKOP - EAKVSSNR - - - - - - - - - - - - - - - Previous doc date - Vorpapierdatum - - - true - xs:date - - MIC_EAVDOC - EADVSSDAT - - - - - - - - - - - - - - - - - - Shipment attributes - Rechnungsattribute - - - false - - 1-n - - - - - - - - - - - Business partner information - - - - - - - Invoice lines - Rechnungspositionen - - - true - - 1-n - - - - - - - - - - - - - - - - - Invoice type - Rechnungstyp - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKFAKTTYP - MIC_EINKOP - EFKFAKTTYP - - - - - - - - - - - - - The contract date. - Vertragsdatum - - - false - xs:date - - MIC_ALL_EAVKOP - EAKDATVTG - MIC_EINKOP - EFKDATVTG - - - - - - - - Country of Trade - Handelsland - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKHALD - MIC_EINKOP - EFKHALD - - - - - - - - - - - - - Supplier - Lieferant - - - false - - - MIC_ALL_EAVKOP - addrNo:EAKLFRNR, addrName:EAKLFRNM1,EAKLFRNM2, addrStreet:EAKLFRSTR, addrLoc:EAKLFRORT, addrCtry:EAKLFRLD, addrState:EAKLFRREGION, addrZip:EAKLFRPLZ, addrTin:EAKLFRTIN, addrEori:EAKLFREORI, partnerRelation:EAKLFRREL, addrDistrict:not mapped - - - - - - - - - - Gross Weight (kg) - Rohmasse (kg) - - - false - Decimal(17,4) - - MIC_ALL_EAVKOP - EAKROHMAS - MIC_EINKOP - EFKROHMAS - - - - - - - - - - - - - - Net Weight (kg)/The net weight of this invoice (sum of all invoice line net weights). - Eigenmasse (kg) - - - false - Decimal(15,6) - - MIC_ALL_EAVKOP - EAKGEWSUM - MIC_EINKOP - EFKGEWSUM - - - - - - - - - - - - - - Invoice Value/The total invoice value. - Rechnungswert - - - false - Decimal(17,4) - - MIC_ALL_EAVKOP - EAKLIEWERT - MIC_EINKOP - EFKLIEWERT - - - - - - - - - - - - - - Currency Invoice/The invoice currency as ISO currency code. - Währung Rechnung - - - false - String1..3 - - MIC_ALL_EAVKOP - EAKLIEWAE - MIC_EINKOP - EFKLIEWAE - - - - - - - - - - - - - Delivery terms - - - - false - - - - - - - - - - - - - - Rebate - Rabatt/Nachlass - - - false - - - - - - - - - - - - - - Discount/Discount for invoice value. - Skonto - - - false - Decimal(5,2) - - MIC_ALL_EAVKOP - EAKSKONTO - MIC_EINKOP - EFKSKONTO - - - - - - - - - - - - - - Additional costs can be added on all levels as additional part value components. They are pro-rated to the invoice lines as indicated. - - - - false - - 0-2 - MIC_ALL_EAVKOP - EAK___ - MIC_EINKOP - EFK___ - - - - - - - - Position additions/Additional remarks and information - Zusätzliche Angaben - - - false - String1..80 - - MIC_ALL_EAVKOP - EAKINFO - MIC_EINKOP - EFKINFO - - - - - - - - - - - - - Position additions/Additional remarks and information 2 - Zusätzliche Angaben 2 - - - false - String1..80 - - MIC_ALL_EAVKOP - EAKINFO2 - MIC_EINKOP - EAKINFO2 - - - - - - - - - - - - - Invoice freight costs - Sendungsfrachtkosten - - - - - - - - - - - - - - - Reference Number - Referenznummer - - - false - String1..30 - - MIC_ALL_EAVKOP - EAKREFNR - MIC_EINKOP - EFKREFNR - - - - - - - - - - - - - Transport Number - Transportnummer - - - false - String1..20 - - MIC_ALL_EAVKOP - EAKTRANSPNR - MIC_EINKOP - EFKTRANSPNR - - - - - - - - - - - - - Type of Transport - Art des Transports - - - false - String1..10 - - MIC_ALL_EAVKOP - EAKTRANSPTYP - MIC_EINKOP - EFKTRANSPTYP - - - - - - - - - - - - - Acceptance Date - Datum der Annahme (ZiA) - - - false - xs:date - - MIC_ALL_EAVKOP - EAKANNAHMEDAT - MIC_EINSDG - EFSANNAHMEDAT - - - - - - - - Release Date - Datum der Überlassung (ZiA) - - - false - xs:date - - MIC_ALL_EAVKOP - EAKUEBERLASSDAT - MIC_EINSDG - EFSUEBERLASSDAT - - - - - - - - Frist (ZiA) - Term of Application - - - false - xs:date - - MIC_ALL_EAVKOP - EAKFRIST - MIC_EINSDG - EFSFRIST - - - - - - - - Customs Register Number - Registriernummer (ZiA) - - - false - String1..35 - - MIC_ALL_EAVKOP - EAKREGNR - MIC_EINSDG - EFSREGNR - - - - - - - - - - - - - Seal number - Verschlussnummer - - - false - String1..50 - - MIC_ALL_EAVKOP - EAKPLOMBE - MIC_EINKOP - EFKPLOMBE - - - - - - - - - - - - - Bill of lading - Konnossement / Frachtbrief - - - false - String1..20 - - MIC_ALL_EAVKOP - EAKBOL - MIC_EINKOP - EFKBOL - - - - - - - - - - - - - Number of Packages - Anzahl Packstücke - - - false - Decimal(6) - - MIC_ALL_EAVKOP - EAKKOLANZ - MIC_EINKOP - EFKKOLANZ - - - - - - - - - - - - - - Package Type - Packstückart - - - false - String1..15 - - MIC_ALL_EAVKOP - EAKKOLART - MIC_EINKOP - EFKKOLART - - - - - - - - - - - - - Buyer - Käufer - - - false - String1..15 - - MIC_ALL_EAVKOP - EAKKAUFNR - MIC_EINKOP - EFKKAUFNR - - - - - - - - - - - - - Consignee - Empfänger - - - false - String1..15 - - MIC_ALL_EAVKOP - EAKEMPNR - MIC_EINKOP - EFKEMPNR - - - - - - - - - - - - Data elements including payment information - - - - - - Customer specific fields - Kundenspezifische Felder - - - false - - - MIC_ALL_EAVKOP - EAK___ - MIC_EINKOP - EFK___ - - - - - - - - Seller - Verkäufer - - - false - - - MIC_ALL_EAVKOP - addrNo:EAKSELLERNR, addrName:EAKSELLERNAME1,EAKSELLERNAME2, addrStreet:EAKSELLERSTREET, addrLoc:EAKSELLERPLACE, addrCtry:EAKSELLERCTRY, addrState:EAKORT, addrZip:EAKSELLERZIP, addrTin:EAKSELLERTIN, addrEori:EAKSELLEREORI, partnerRelation:EAKSELLERKVB, addrDistrict:not mapped, addrBranchNo:EAKSELLERBRANCHNO - - - - - - - - - - Exchange Rate - Wechselkurs - - - false - Decimal - - MIC_ALL_EAVKOP - EAKKURS - MIC_EINKOP - EFKKURS - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_ALL_EAVKOP - EAKCREUSER - MIC_EINKOP - EFKCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_ALL_EAVKOP - EAKCREADAT - MIC_EINKOP - EFKCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_ALL_EAVKOP - EAKUSER - MIC_EINKOP - EFKUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_ALL_EAVKOP - EAKUSEDAT - MIC_EINKOP - EFKUSEDAT - - - - - - - - - - - - false - - - MIC_ALL_EAVKOP - EAK___ - MIC_EINKOP - EFK___ - - - - - - - - - - Mapping to table MIC_CUST_WB_ATLAS_COMP_SUMD - - - - - - Completion parts - Beendigunsgsanteile - - - true - - - - - MIC_ATLAS_COMPLETION_SUMD - - - - - - - - - - - - - - Type of Identification - Art der Identifikation - - - false - String1..3 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSIDTYPE - MIC_ATLAS_COMPLETION_SUMD - ACSIDTYPE - - - - - - - - - - - - - Quantity - Stückzahl - - - false - xs:long 5 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSQUANTITY - MIC_ATLAS_COMPLETION_SUMD - ACSQUANTITY - - - - - - - - - - - - - Package Type - Packstückart - - - false - String1..2 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSPACKAGETYPE - MIC_ATLAS_COMPLETION_SUMD - ACSPACKAGETYPE - - - - - - - - - - - - - Customs Register Number - Registriernummer (ZiA) - - - false - String1..21 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSREGNR - MIC_ATLAS_COMPLETION_SUMD - ACSREGNR - - - - - - - - - - - - - Position Number - Positionsnummer - - - false - xs:long 4 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSPOSNR - MIC_ATLAS_COMPLETION_SUMD - ACSPOSNR - - - - - - - - - - - - - Depository - Verwahrer - - - false - String1..17 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSDEPOSITOR - MIC_ATLAS_COMPLETION_SUMD - ACSDEPOSITOR - - - - - - - - - - - - - Type of specific defining argument - Art des spezifischen Ordnungsbegriffs - - - false - String1..3 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSSPECDEFTYPE - MIC_ATLAS_COMPLETION_SUMD - ACSSPECDEFTYPE - - - - - - - - - - - - - Specific defining argument - Spezifischer Ordnungsbegriff - - - false - String1..44 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSSPECDEFARG - MIC_ATLAS_COMPLETION_SUMD - ACSSPECDEFARG - - - - - - - - - - - - - Created by - Erstellt von - - - false - String1..12 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSCREUSER - MIC_ATLAS_COMPLETION_SUMD - ACSCREUSER - - - - - - - - Created on - Erstellt am - - - false - Xs:datetime - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSCREDAT - MIC_ATLAS_COMPLETION_SUMD - EFDCREDAT - - - - - - - - Modified by - Geändert von - - - false - String1..12 - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSUSER - MIC_ATLAS_COMPLETION_SUMD - ACSUSER - - - - - - - - Modified on - Geändert am - - - false - Xs:datetime - - MIC_CUST_WB_ATLAS_COMP_SUMD - ECSUSEDAT - MIC_ATLAS_COMPLETION_SUMD - ACSUSEDAT - - - - - - - - - - Invoice line previous document references - Positionsbeendigungsanteile Vorpapiere - - - - - - - Previous document reference - Beendigungsanteil Vorpapier - - - true - - 1-n - MIC_CUST_AVBEENDIGUNG - - - - - - - - - - - - - - Reference previous procedures - - - - - - - Reference type - Art des BE-Anteils - - - false - String1..3 - - MIC_CUST_AVBEENDIGUNG - MCBART - - - - - - - - - - - - - - - Reference number - Bezugsnummer - - - false - String1..35 - - MIC_CUST_AVBEENDIGUNG - MCBBEZUGNR - - - - - - - - - - - - - - - Authorization number - Bewilligungsnummer - - - false - String1..35 - - MIC_CUST_AVBEENDIGUNG - MCBBEWILLNR - - - - - - - - - - - - - - - Registration number - Registriernummer Zugang - - - false - String1..36 - - MIC_CUST_AVBEENDIGUNG - MCBREGNR - - - - - - - - - - - - - - - Position number - Positionsnummer Zugang - - - false - Long 5 - - MIC_CUST_AVBEENDIGUNG - MCBZUGPOSNR - - - - - - - - - - - - - - - Part number - Artikelnummer - - - false - String1..30 - - MIC_CUST_AVBEENDIGUNG - MCBARTNR - - - - - - - - - - - - - - - Tariff number - Tarifnummer - - - false - String1..13 - - MIC_CUST_AVBEENDIGUNG - MCBTARNR - - - - - - - - - - - - - - - Trade quantity - Handelsmenge - - - false - Decimal(12,3) - - MIC_CUST_AVBEENDIGUNG - MCBHMENGE - - - - - - - - - - - - - - - - Trade unit of measurement - Handelsmengeneinheit - - - false - String1..3 - - MIC_CUST_AVBEENDIGUNG - MCBHMEH - - - - - - - - - - - - - - - Trade qualifier - Handelsqualifikator - - - false - String1..1 - - MIC_CUST_AVBEENDIGUNG - MCBHQUAL - - - - - - - - - - - - - - - Deduction quantity - Abbuchungsmenge - - - false - Decimal(12,3) - - MIC_CUST_AVBEENDIGUNG - MCBMENGE - - - - - - - - - - - - - - - - Deduction unit of measurement - Abbuchungsmengeneinheit - - - false - String1..3 - - MIC_CUST_AVBEENDIGUNG - MCBMEH - - - - - - - - - - - - - - - Deduction qualifier - Abbuchungsqualifikator - - - false - String1..1 - - MIC_CUST_AVBEENDIGUNG - MCBQUAL - - - - - - - - - - - - - - - Additional information - Zusatzinformation - - - false - String1..4000 - - MIC_CUST_AVBEENDIGUNG - MCBINFO - - - - - - - - - - - - - - - Normal treatment flag - Kennzeichen Normales Verfahren - - - false - xs:boolean - - MIC_CUST_AVBEENDIGUNG - MCBKZUEBLBEH - - - - - - - - - - Atlas flag - ATLAS Kennzeichen - - - false - xs:boolean - - MIC_CUST_AVBEENDIGUNG - MCBKZATLAS - - - - - - - - - - Customs number - Zollnummer - - - false - String1..17 - - MIC_CUST_AVBEENDIGUNG - MCBZNRAB - - - - - - - - - - - - - - - Statistical quantity - Statistiche Menge - - - false - Decimal(13,3) - - MIC_CUST_AVBEENDIGUNG - MCBBESM - - - - - - - - - - - - - - - - Net mass - Eigenmasse (kg) - - - false - Decimal(13,4) - - MIC_CUST_AVBEENDIGUNG - MCBEIGMAS - - - - - - - - - - - - - - - - Gross mass - Rohmasse (kg) - - - false - Decimal(13,4) - - MIC_CUST_AVBEENDIGUNG - MCBROHMAS - - - - - - - - - - - - - - - - Package quantity - Packstückanzahl - - - false - Decimal - - MIC_CUST_AVBEENDIGUNG - MCBKOLANZ - - - - - - - - - - Simple IPR application flag - Kennzeichen einfache Bewilligung für aktive Veredelung - - - false - xs:boolean - - MIC_CUST_AVBEENDIGUNG - MCBSIMPLEIPRAPPLICATION - - - - - - - - - - Supervising office - Überwachungszollstelle - - - false - String1..8 - - MIC_CUST_AVBEENDIGUNG - MCBSUPERVISINGOFFICE - - - - - - - - - - - - - - - - Customer-specific fields - - - - - - Customer-specific text field - Kundenspezifischer Text - - - false - - - - ___TEXT___ + KEY - - ___TEXT___ + KEY - - - - - - - - Customer-specific date field - Kundenspezifisches Datum - - - false - - - - ___DATE___ + KEY - - ___DATE___ + KEY - - - - - - - - Customer-specific boolean field - Kundenspezifischer boolscher Wert - - - false - - - - ___FLAG___ + KEY - - ___FLAG___ + KEY - - - - - - - - Customer-specific number field - Kundenspezifischer numerische Wert - - - false - - - - ___NUMBER___ + KEY - - ___NUMBER___ + KEY - - - - - - - - - - - - - - - - - Number of Customer Specific Item: 1-10 on Shipment and Invoice; 1-15 on line - Nummer vom Kundenspezifischen Feld: 1-10 auf Sendung und Rechnung; 1-15 auf Line - - - false - Number - - - - - - - - - - - - - Value of Customer Specific Item - Wert vom Kundespezifache Feld - - - false - String1..400 - - - - - - - - - - - - - - - - - - - - - - - - - - - Number of Customer Specific Item: 1-10 on Shipment and Invoice; 1-15 on line - Nummer vom Kundenspezifischen Feld: 1-10 auf Sendung und Rechnung; 1-15 auf Line - - - false - Number - - - - - - - - - - - - - Number of Customer Specific Item: 1-10 on Shipment and Invoice; 1-15 on line - Nummer vom Kundenspezifischen Feld: 1-10 auf Sendung und Rechnung; 1-15 auf Line - - - false - Number(15,4) - - - - - - - - - - - - - - - - - - - - - - - - - Number of Customer Specific Item: 1-10 on Shipment and Invoice; 1-15 on line - Nummer vom Kundenspezifischen Feld: 1-10 auf Sendung und Rechnung; 1-15 auf Line - - - false - Number - - - - - - - - - - - - - Value of Customer Specific Item - Wert vom Kundespezifache Feld - - - false - Boolean - - - - - - - - - - - - - - - - - - - - - - Number of Customer Specific Item: 1-10 on Shipment and Invoice; 1-15 on line - Nummer vom Kundenspezifischen Feld: 1-10 auf Sendung und Rechnung; 1-15 auf Line - - - false - Number - - - - - - - - - - - - - Value of Customer Specific Item - Wert vom Kundespezifache Feld - - - false - Xs:datetime - - - - - - - - - - - - - - - - - - - - Packages - - - - - - Package - Packstück - - - true - String1..8 - - MIC_CUST_WB_PACKAGES - - MIC_CUST_PACKAGES - - - - - - - - - - Import packages type - - - - - - Signo - Zeichen/Nummer - - - true - String1..140 - - MIC_CUST_WB_PACKAGES - WBPSIGNO - MIC_CUST_PACKAGES - PCKSIGNO - - - - - - - - - - - Quantity - Menge - - - true - xs:long 15 - - MIC_CUST_WB_PACKAGES - WBPANZAR - MIC_CUST_PACKAGES - PCKANZAR - - - - - - - - - - - Package Type - Packstückart - - - true - String1..5 - - MIC_CUST_WB_PACKAGES - WBPART - MIC_CUST_PACKAGES - PCKART - - - - - - - - - - - - - - - - - - diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.Designer.vb deleted file mode 100644 index 7d9d0901..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicCustImportShipment.Designer.vb +++ /dev/null @@ -1,17259 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicCustImportShipmentListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicCustImportShipment - - Partial Public Class ImportShipment - - Private shipmentField As TShipment - - Private invoiceField As List(Of TInvoice) - - Private schemaVersionField As Decimal - - Private schemaVersionFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceField = New List(Of TInvoice)() - Me.shipmentField = New TShipment() - End Sub - - Public Property Shipment() As TShipment - Get - Return Me.shipmentField - End Get - Set - Me.shipmentField = Value - End Set - End Property - - Public Property Invoice() As List(Of TInvoice) - Get - Return Me.invoiceField - End Get - Set - Me.invoiceField = Value - End Set - End Property - - Public Property schemaVersion() As Decimal - Get - Return Me.schemaVersionField - End Get - Set - Me.schemaVersionField = Value - End Set - End Property - - - Public Property schemaVersionSpecified() As Boolean - Get - Return Me.schemaVersionFieldSpecified - End Get - Set - Me.schemaVersionFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ImportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ImportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ImportShipment object - ''' - '''string workflow markup to deserialize - '''Output ImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ImportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ImportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ImportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ImportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current ImportShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an ImportShipment object - ''' - '''string xml file to load and deserialize - '''Output ImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ImportShipment) - 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 ImportShipment) 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 ImportShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipment - - Private companyField As String - - Private plantField As String - - Private shipmentIdField As String - - Private shipmentPartialField As String - - Private shipmentVersionField As String - - Private documentNumberField As Decimal - - Private shipmentHeadField As TShipmentHead - - Private containersField As List(Of TDetailContainerInfo) - - Private documentsField As List(Of TDocument) - - Private attributesField As List(Of TAttribute) - - Private partnersField As List(Of TPartner) - - Private previousDocumentsField As List(Of TPrevDoc) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private additionalInformationField As List(Of TAttribute) - - Private authorisationHoldersField As TAuthHolders - - Private defermentAccountsField As TDeferAccs - - Private guaranteesField As TGuarantees - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.guaranteesField = New TGuarantees() - Me.defermentAccountsField = New TDeferAccs() - Me.authorisationHoldersField = New TAuthHolders() - Me.additionalInformationField = New List(Of TAttribute)() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.previousDocumentsField = New List(Of TPrevDoc)() - Me.partnersField = New List(Of TPartner)() - Me.attributesField = New List(Of TAttribute)() - Me.documentsField = New List(Of TDocument)() - Me.containersField = New List(Of TDetailContainerInfo)() - Me.shipmentHeadField = New TShipmentHead() - Me.shipmentVersionField = "1" - Me.documentNumberField = CType(1D, Decimal) - End Sub - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property shipmentId() As String - Get - Return Me.shipmentIdField - End Get - Set - Me.shipmentIdField = Value - End Set - End Property - - Public Property shipmentPartial() As String - Get - Return Me.shipmentPartialField - End Get - Set - Me.shipmentPartialField = Value - End Set - End Property - - - Public Property shipmentVersion() As String - Get - Return Me.shipmentVersionField - End Get - Set - Me.shipmentVersionField = Value - End Set - End Property - - - Public Property documentNumber() As Decimal - Get - Return Me.documentNumberField - End Get - Set - Me.documentNumberField = Value - End Set - End Property - - Public Property ShipmentHead() As TShipmentHead - Get - Return Me.shipmentHeadField - End Get - Set - Me.shipmentHeadField = Value - End Set - End Property - - - Public Property Containers() As List(Of TDetailContainerInfo) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property PreviousDocuments() As List(Of TPrevDoc) - Get - Return Me.previousDocumentsField - End Get - Set - Me.previousDocumentsField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - - Public Property AdditionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property AuthorisationHolders() As TAuthHolders - Get - Return Me.authorisationHoldersField - End Get - Set - Me.authorisationHoldersField = Value - End Set - End Property - - Public Property DefermentAccounts() As TDeferAccs - Get - Return Me.defermentAccountsField - End Get - Set - Me.defermentAccountsField = Value - End Set - End Property - - Public Property Guarantees() As TGuarantees - Get - Return Me.guaranteesField - End Get - Set - Me.guaranteesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipment object - ''' - '''string workflow markup to deserialize - '''Output TShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TShipment object - ''' - '''string xml file to load and deserialize - '''Output TShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipment) - 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 TShipment) 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 TShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHead - - Private shipmentTypeField As TShipmentHeadShipmentType - - Private customsDateField As Date - - Private customsDateFieldSpecified As Boolean - - Private declTypeField As TDeclType - - Private mrnField As String - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private departurePlaceField As String - - Private dispatchCountryField As String - - Private lastDispatchCountryField As String - - Private destinationPlaceField As String - - Private destinationRegionField As String - - Private officeEntryField As String - - Private importStateField As String - - Private substituteFlagField As String - - Private typeOfImportField As String - - Private authorizationNumberField As String - - Private placeOfDispatchDescriptionField As String - - Private typeOfAirTransportationField As String - - Private motBorderField As TMot - - Private motBorderCrossingField As TMot - - Private motInlandField As TMot - - Private containerIndicatorField As String - - Private containerField As TContainer - - Private freightField As TFreightCosts - - Private insuranceField As TInsuranceCosts - - Private additionalCostsField As List(Of TAddCosts) - - Private additionalCostVATField As Decimal - - Private additionalCostVATFieldSpecified As Boolean - - Private textField As String - - Private exportDateField As Date - - Private exportDateFieldSpecified As Boolean - - Private importDateField As Date - - Private importDateFieldSpecified As Boolean - - Private estArrivalDateField As Date - - Private estArrivalDateFieldSpecified As Boolean - - Private partyConstField As String - - Private periodField As String - - Private customerFieldsField As TCustomerFields - - Private countryDestinationField As String - - Private clearenceTypeField As String - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private customsOfficeOfDestinationField As String - - Private carrierNumberField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private supervisingOfficeField As String - - Private typeIdentificationOfTransportArrivalField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.customerFieldsField = New TCustomerFields() - Me.additionalCostsField = New List(Of TAddCosts)() - Me.insuranceField = New TInsuranceCosts() - Me.freightField = New TFreightCosts() - Me.containerField = New TContainer() - Me.motInlandField = New TMot() - Me.motBorderCrossingField = New TMot() - Me.motBorderField = New TMot() - Me.declTypeField = New TDeclType() - Me.shipmentTypeField = TShipmentHeadShipmentType.E - Me.containerIndicatorField = "0" - End Sub - - - Public Property shipmentType() As TShipmentHeadShipmentType - Get - Return Me.shipmentTypeField - End Get - Set - Me.shipmentTypeField = Value - End Set - End Property - - Public Property customsDate() As Date - Get - Return Me.customsDateField - End Get - Set - Me.customsDateField = Value - End Set - End Property - - - Public Property customsDateSpecified() As Boolean - Get - Return Me.customsDateFieldSpecified - End Get - Set - Me.customsDateFieldSpecified = Value - End Set - End Property - - Public Property declType() As TDeclType - Get - Return Me.declTypeField - End Get - Set - Me.declTypeField = Value - End Set - End Property - - Public Property mrn() As String - Get - Return Me.mrnField - End Get - Set - Me.mrnField = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property departurePlace() As String - Get - Return Me.departurePlaceField - End Get - Set - Me.departurePlaceField = Value - End Set - End Property - - Public Property dispatchCountry() As String - Get - Return Me.dispatchCountryField - End Get - Set - Me.dispatchCountryField = Value - End Set - End Property - - Public Property lastDispatchCountry() As String - Get - Return Me.lastDispatchCountryField - End Get - Set - Me.lastDispatchCountryField = Value - End Set - End Property - - Public Property destinationPlace() As String - Get - Return Me.destinationPlaceField - End Get - Set - Me.destinationPlaceField = Value - End Set - End Property - - Public Property destinationRegion() As String - Get - Return Me.destinationRegionField - End Get - Set - Me.destinationRegionField = Value - End Set - End Property - - Public Property officeEntry() As String - Get - Return Me.officeEntryField - End Get - Set - Me.officeEntryField = Value - End Set - End Property - - Public Property importState() As String - Get - Return Me.importStateField - End Get - Set - Me.importStateField = Value - End Set - End Property - - Public Property substituteFlag() As String - Get - Return Me.substituteFlagField - End Get - Set - Me.substituteFlagField = Value - End Set - End Property - - Public Property typeOfImport() As String - Get - Return Me.typeOfImportField - End Get - Set - Me.typeOfImportField = Value - End Set - End Property - - Public Property authorizationNumber() As String - Get - Return Me.authorizationNumberField - End Get - Set - Me.authorizationNumberField = Value - End Set - End Property - - Public Property placeOfDispatchDescription() As String - Get - Return Me.placeOfDispatchDescriptionField - End Get - Set - Me.placeOfDispatchDescriptionField = Value - End Set - End Property - - Public Property typeOfAirTransportation() As String - Get - Return Me.typeOfAirTransportationField - End Get - Set - Me.typeOfAirTransportationField = Value - End Set - End Property - - Public Property MotBorder() As TMot - Get - Return Me.motBorderField - End Get - Set - Me.motBorderField = Value - End Set - End Property - - Public Property MotBorderCrossing() As TMot - Get - Return Me.motBorderCrossingField - End Get - Set - Me.motBorderCrossingField = Value - End Set - End Property - - Public Property MotInland() As TMot - Get - Return Me.motInlandField - End Get - Set - Me.motInlandField = Value - End Set - End Property - - - Public Property containerIndicator() As String - Get - Return Me.containerIndicatorField - End Get - Set - Me.containerIndicatorField = Value - End Set - End Property - - Public Property Container() As TContainer - Get - Return Me.containerField - End Get - Set - Me.containerField = Value - End Set - End Property - - Public Property Freight() As TFreightCosts - Get - Return Me.freightField - End Get - Set - Me.freightField = Value - End Set - End Property - - Public Property Insurance() As TInsuranceCosts - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - Public Property AdditionalCosts() As List(Of TAddCosts) - Get - Return Me.additionalCostsField - End Get - Set - Me.additionalCostsField = Value - End Set - End Property - - Public Property additionalCostVAT() As Decimal - Get - Return Me.additionalCostVATField - End Get - Set - Me.additionalCostVATField = Value - End Set - End Property - - - Public Property additionalCostVATSpecified() As Boolean - Get - Return Me.additionalCostVATFieldSpecified - End Get - Set - Me.additionalCostVATFieldSpecified = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property exportDate() As Date - Get - Return Me.exportDateField - End Get - Set - Me.exportDateField = Value - End Set - End Property - - - Public Property exportDateSpecified() As Boolean - Get - Return Me.exportDateFieldSpecified - End Get - Set - Me.exportDateFieldSpecified = Value - End Set - End Property - - Public Property importDate() As Date - Get - Return Me.importDateField - End Get - Set - Me.importDateField = Value - End Set - End Property - - - Public Property importDateSpecified() As Boolean - Get - Return Me.importDateFieldSpecified - End Get - Set - Me.importDateFieldSpecified = Value - End Set - End Property - - Public Property estArrivalDate() As Date - Get - Return Me.estArrivalDateField - End Get - Set - Me.estArrivalDateField = Value - End Set - End Property - - - Public Property estArrivalDateSpecified() As Boolean - Get - Return Me.estArrivalDateFieldSpecified - End Get - Set - Me.estArrivalDateFieldSpecified = Value - End Set - End Property - - Public Property partyConst() As String - Get - Return Me.partyConstField - End Get - Set - Me.partyConstField = Value - End Set - End Property - - Public Property period() As String - Get - Return Me.periodField - End Get - Set - Me.periodField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property countryDestination() As String - Get - Return Me.countryDestinationField - End Get - Set - Me.countryDestinationField = Value - End Set - End Property - - Public Property clearenceType() As String - Get - Return Me.clearenceTypeField - End Get - Set - Me.clearenceTypeField = Value - End Set - End Property - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property customsOfficeOfDestination() As String - Get - Return Me.customsOfficeOfDestinationField - End Get - Set - Me.customsOfficeOfDestinationField = Value - End Set - End Property - - Public Property carrierNumber() As String - Get - Return Me.carrierNumberField - End Get - Set - Me.carrierNumberField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property supervisingOffice() As String - Get - Return Me.supervisingOfficeField - End Get - Set - Me.supervisingOfficeField = Value - End Set - End Property - - Public Property typeIdentificationOfTransportArrival() As String - Get - Return Me.typeIdentificationOfTransportArrivalField - End Get - Set - Me.typeIdentificationOfTransportArrivalField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHead object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TShipmentHeadShipmentType - - ''' - E - - ''' - B - - ''' - U - - ''' - X - - ''' - I - End Enum - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageData - - Private signoField As String - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private packageTypeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property signo() As String - Get - Return Me.signoField - End Get - Set - Me.signoField = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageData object - ''' - '''string workflow markup to deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackageData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackageData object - ''' - '''string xml file to load and deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - 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 TPackageData) 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 TPackageData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackagesData - - Private packageDataField As List(Of TPackageData) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageDataField = New List(Of TPackageData)() - End Sub - - Public Property PackageData() As List(Of TPackageData) - Get - Return Me.packageDataField - End Get - Set - Me.packageDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackagesData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackagesData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackagesData object - ''' - '''string workflow markup to deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackagesData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackagesData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackagesData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackagesData object - ''' - '''string xml file to load and deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - 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 TPackagesData) 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 TPackagesData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRefPrevProcedure - - Private referenceTypeField As String - - Private referenceNumberField As String - - Private authorisationNumberField As String - - Private registrationNumberField As String - - Private positionNumberField As Long - - Private positionNumberFieldSpecified As Boolean - - Private partNumberField As String - - Private tariffNumberField As String - - Private tradeQuantityField As Decimal - - Private tradeQuantityFieldSpecified As Boolean - - Private tradeUnitOfMeasurementField As String - - Private tradeQualifierField As String - - Private deductionQuantityField As Decimal - - Private deductionQuantityFieldSpecified As Boolean - - Private deductionUnitOfMeasurementField As String - - Private deductionQualifierField As String - - Private additionalInformationField As String - - Private normalTreatmentFlagField As Boolean - - Private normalTreatmentFlagFieldSpecified As Boolean - - Private atlasFlagField As Boolean - - Private atlasFlagFieldSpecified As Boolean - - Private customsNumberField As String - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private simpleIprApplicationField As Boolean - - Private simpleIprApplicationFieldSpecified As Boolean - - Private supervisingOfficeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property authorisationNumber() As String - Get - Return Me.authorisationNumberField - End Get - Set - Me.authorisationNumberField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property positionNumber() As Long - Get - Return Me.positionNumberField - End Get - Set - Me.positionNumberField = Value - End Set - End Property - - - Public Property positionNumberSpecified() As Boolean - Get - Return Me.positionNumberFieldSpecified - End Get - Set - Me.positionNumberFieldSpecified = Value - End Set - End Property - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property tariffNumber() As String - Get - Return Me.tariffNumberField - End Get - Set - Me.tariffNumberField = Value - End Set - End Property - - Public Property tradeQuantity() As Decimal - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - - Public Property tradeQuantitySpecified() As Boolean - Get - Return Me.tradeQuantityFieldSpecified - End Get - Set - Me.tradeQuantityFieldSpecified = Value - End Set - End Property - - Public Property tradeUnitOfMeasurement() As String - Get - Return Me.tradeUnitOfMeasurementField - End Get - Set - Me.tradeUnitOfMeasurementField = Value - End Set - End Property - - Public Property tradeQualifier() As String - Get - Return Me.tradeQualifierField - End Get - Set - Me.tradeQualifierField = Value - End Set - End Property - - Public Property deductionQuantity() As Decimal - Get - Return Me.deductionQuantityField - End Get - Set - Me.deductionQuantityField = Value - End Set - End Property - - - Public Property deductionQuantitySpecified() As Boolean - Get - Return Me.deductionQuantityFieldSpecified - End Get - Set - Me.deductionQuantityFieldSpecified = Value - End Set - End Property - - Public Property deductionUnitOfMeasurement() As String - Get - Return Me.deductionUnitOfMeasurementField - End Get - Set - Me.deductionUnitOfMeasurementField = Value - End Set - End Property - - Public Property deductionQualifier() As String - Get - Return Me.deductionQualifierField - End Get - Set - Me.deductionQualifierField = Value - End Set - End Property - - Public Property additionalInformation() As String - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property normalTreatmentFlag() As Boolean - Get - Return Me.normalTreatmentFlagField - End Get - Set - Me.normalTreatmentFlagField = Value - End Set - End Property - - - Public Property normalTreatmentFlagSpecified() As Boolean - Get - Return Me.normalTreatmentFlagFieldSpecified - End Get - Set - Me.normalTreatmentFlagFieldSpecified = Value - End Set - End Property - - Public Property atlasFlag() As Boolean - Get - Return Me.atlasFlagField - End Get - Set - Me.atlasFlagField = Value - End Set - End Property - - - Public Property atlasFlagSpecified() As Boolean - Get - Return Me.atlasFlagFieldSpecified - End Get - Set - Me.atlasFlagFieldSpecified = Value - End Set - End Property - - Public Property customsNumber() As String - Get - Return Me.customsNumberField - End Get - Set - Me.customsNumberField = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property simpleIprApplication() As Boolean - Get - Return Me.simpleIprApplicationField - End Get - Set - Me.simpleIprApplicationField = Value - End Set - End Property - - - Public Property simpleIprApplicationSpecified() As Boolean - Get - Return Me.simpleIprApplicationFieldSpecified - End Get - Set - Me.simpleIprApplicationFieldSpecified = Value - End Set - End Property - - Public Property supervisingOffice() As String - Get - Return Me.supervisingOfficeField - End Get - Set - Me.supervisingOfficeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRefPrevProcedure)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRefPrevProcedure object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRefPrevProcedure object - ''' - '''string workflow markup to deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRefPrevProcedure - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRefPrevProcedure) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRefPrevProcedure 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRefPrevProcedure object - ''' - '''string xml file to load and deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - 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 TRefPrevProcedure) 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 TRefPrevProcedure - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreSupplier - - Private infDutyValueField As Decimal - - Private infDutyValueFieldSpecified As Boolean - - Private infDutyRateField As Decimal - - Private infDutyRateFieldSpecified As Boolean - - Private infDutyField As Decimal - - Private infDutyFieldSpecified As Boolean - - Private infDutyCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property infDutyValue() As Decimal - Get - Return Me.infDutyValueField - End Get - Set - Me.infDutyValueField = Value - End Set - End Property - - - Public Property infDutyValueSpecified() As Boolean - Get - Return Me.infDutyValueFieldSpecified - End Get - Set - Me.infDutyValueFieldSpecified = Value - End Set - End Property - - Public Property infDutyRate() As Decimal - Get - Return Me.infDutyRateField - End Get - Set - Me.infDutyRateField = Value - End Set - End Property - - - Public Property infDutyRateSpecified() As Boolean - Get - Return Me.infDutyRateFieldSpecified - End Get - Set - Me.infDutyRateFieldSpecified = Value - End Set - End Property - - Public Property infDuty() As Decimal - Get - Return Me.infDutyField - End Get - Set - Me.infDutyField = Value - End Set - End Property - - - Public Property infDutySpecified() As Boolean - Get - Return Me.infDutyFieldSpecified - End Get - Set - Me.infDutyFieldSpecified = Value - End Set - End Property - - Public Property infDutyCurrency() As String - Get - Return Me.infDutyCurrencyField - End Get - Set - Me.infDutyCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreSupplier)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreSupplier object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreSupplier object - ''' - '''string workflow markup to deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreSupplier - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreSupplier) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPreSupplier 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPreSupplier object - ''' - '''string xml file to load and deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - 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 TPreSupplier) 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 TPreSupplier - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntraLine - - Private statusField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private periodField As Long - - Private periodFieldSpecified As Boolean - - Private regionField As String - - Private statisticalProcedureField As String - - Private statisticalValueField As Decimal - - Private statisticalValueFieldSpecified As Boolean - - Private additionalCostsCurrency1Field As String - - Private additionalCostsType1Field As String - - Private additionalCostsCurrency2Field As String - - Private additionalCostsType2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As String - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property period() As Long - Get - Return Me.periodField - End Get - Set - Me.periodField = Value - End Set - End Property - - - Public Property periodSpecified() As Boolean - Get - Return Me.periodFieldSpecified - End Get - Set - Me.periodFieldSpecified = Value - End Set - End Property - - Public Property region() As String - Get - Return Me.regionField - End Get - Set - Me.regionField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property statisticalValue() As Decimal - Get - Return Me.statisticalValueField - End Get - Set - Me.statisticalValueField = Value - End Set - End Property - - - Public Property statisticalValueSpecified() As Boolean - Get - Return Me.statisticalValueFieldSpecified - End Get - Set - Me.statisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsCurrency1() As String - Get - Return Me.additionalCostsCurrency1Field - End Get - Set - Me.additionalCostsCurrency1Field = Value - End Set - End Property - - Public Property additionalCostsType1() As String - Get - Return Me.additionalCostsType1Field - End Get - Set - Me.additionalCostsType1Field = Value - End Set - End Property - - Public Property additionalCostsCurrency2() As String - Get - Return Me.additionalCostsCurrency2Field - End Get - Set - Me.additionalCostsCurrency2Field = Value - End Set - End Property - - Public Property additionalCostsType2() As String - Get - Return Me.additionalCostsType2Field - End Get - Set - Me.additionalCostsType2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntraLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntraLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntraLine object - ''' - '''string workflow markup to deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntraLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntraLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntraLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntraLine object - ''' - '''string xml file to load and deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - 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 TCustIntraLine) 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 TCustIntraLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOprInfo - - Private dutyGroup1Field As String - - Private reductionAmount1Field As Decimal - - Private reductionAmount1FieldSpecified As Boolean - - Private dutyGroup2Field As String - - Private reductionAmount2Field As Decimal - - Private reductionAmount2FieldSpecified As Boolean - - Private dutyGroup3Field As String - - Private reductionAmount3Field As Decimal - - Private reductionAmount3FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property dutyGroup1() As String - Get - Return Me.dutyGroup1Field - End Get - Set - Me.dutyGroup1Field = Value - End Set - End Property - - Public Property reductionAmount1() As Decimal - Get - Return Me.reductionAmount1Field - End Get - Set - Me.reductionAmount1Field = Value - End Set - End Property - - - Public Property reductionAmount1Specified() As Boolean - Get - Return Me.reductionAmount1FieldSpecified - End Get - Set - Me.reductionAmount1FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup2() As String - Get - Return Me.dutyGroup2Field - End Get - Set - Me.dutyGroup2Field = Value - End Set - End Property - - Public Property reductionAmount2() As Decimal - Get - Return Me.reductionAmount2Field - End Get - Set - Me.reductionAmount2Field = Value - End Set - End Property - - - Public Property reductionAmount2Specified() As Boolean - Get - Return Me.reductionAmount2FieldSpecified - End Get - Set - Me.reductionAmount2FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup3() As String - Get - Return Me.dutyGroup3Field - End Get - Set - Me.dutyGroup3Field = Value - End Set - End Property - - Public Property reductionAmount3() As Decimal - Get - Return Me.reductionAmount3Field - End Get - Set - Me.reductionAmount3Field = Value - End Set - End Property - - - Public Property reductionAmount3Specified() As Boolean - Get - Return Me.reductionAmount3FieldSpecified - End Get - Set - Me.reductionAmount3FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOprInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOprInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOprInfo object - ''' - '''string workflow markup to deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOprInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOprInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TOprInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TOprInfo object - ''' - '''string xml file to load and deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - 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 TOprInfo) 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 TOprInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutySaving - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private measuresTypeField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private additionField As Decimal - - Private additionFieldSpecified As Boolean - - Private preferentialFlagField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property addition() As Decimal - Get - Return Me.additionField - End Get - Set - Me.additionField = Value - End Set - End Property - - - Public Property additionSpecified() As Boolean - Get - Return Me.additionFieldSpecified - End Get - Set - Me.additionFieldSpecified = Value - End Set - End Property - - Public Property preferentialFlag() As String - Get - Return Me.preferentialFlagField - End Get - Set - Me.preferentialFlagField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutySaving)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutySaving object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutySaving object - ''' - '''string workflow markup to deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutySaving - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutySaving) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutySaving 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutySaving object - ''' - '''string xml file to load and deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - 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 TDutySaving) 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 TDutySaving - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutyTax - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private areaCodeField As String - - Private measuresTypeField As String - - Private dutyCodeCustomsOfficeField As String - - Private indentureNumberField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private stornoFlagField As String - - Private dutyAmountIncreaseOrDecreaseField As Decimal - - Private dutyAmountIncreaseOrDecreaseFieldSpecified As Boolean - - Private typeOfAdditionalCodeField As String - - Private noOfAdditionalCodeField As String - - Private calculatedDutyRateField As Decimal - - Private calculatedDutyRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property areaCode() As String - Get - Return Me.areaCodeField - End Get - Set - Me.areaCodeField = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyCodeCustomsOffice() As String - Get - Return Me.dutyCodeCustomsOfficeField - End Get - Set - Me.dutyCodeCustomsOfficeField = Value - End Set - End Property - - Public Property indentureNumber() As String - Get - Return Me.indentureNumberField - End Get - Set - Me.indentureNumberField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property stornoFlag() As String - Get - Return Me.stornoFlagField - End Get - Set - Me.stornoFlagField = Value - End Set - End Property - - Public Property dutyAmountIncreaseOrDecrease() As Decimal - Get - Return Me.dutyAmountIncreaseOrDecreaseField - End Get - Set - Me.dutyAmountIncreaseOrDecreaseField = Value - End Set - End Property - - - Public Property dutyAmountIncreaseOrDecreaseSpecified() As Boolean - Get - Return Me.dutyAmountIncreaseOrDecreaseFieldSpecified - End Get - Set - Me.dutyAmountIncreaseOrDecreaseFieldSpecified = Value - End Set - End Property - - Public Property typeOfAdditionalCode() As String - Get - Return Me.typeOfAdditionalCodeField - End Get - Set - Me.typeOfAdditionalCodeField = Value - End Set - End Property - - Public Property noOfAdditionalCode() As String - Get - Return Me.noOfAdditionalCodeField - End Get - Set - Me.noOfAdditionalCodeField = Value - End Set - End Property - - Public Property calculatedDutyRate() As Decimal - Get - Return Me.calculatedDutyRateField - End Get - Set - Me.calculatedDutyRateField = Value - End Set - End Property - - - Public Property calculatedDutyRateSpecified() As Boolean - Get - Return Me.calculatedDutyRateFieldSpecified - End Get - Set - Me.calculatedDutyRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutyTax)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutyTax object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutyTax object - ''' - '''string workflow markup to deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutyTax - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutyTax) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutyTax 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutyTax object - ''' - '''string xml file to load and deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - 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 TDutyTax) 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 TDutyTax - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDuty - - Private typeField As String - - Private calcDutyBaseField As Decimal - - Private calcDutyBaseFieldSpecified As Boolean - - Private currencyField As String - - Private codeField As String - - Private rateField As Decimal - - Private rateFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private addDeductField As Decimal - - Private addDeductFieldSpecified As Boolean - - Private calcDutyField As Decimal - - Private calcDutyFieldSpecified As Boolean - - Private dutyField As Decimal - - Private dutyFieldSpecified As Boolean - - Private dutyBaseField As Decimal - - Private dutyBaseFieldSpecified As Boolean - - Private measureCodeField As String - - Private measureField As String - - Private authorityDutyCodeField As String - - Private territoryField As String - - Private typeAddCodeField As String - - Private numberAddCodeField As String - - Private tariffRateQuotaField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property calcDutyBase() As Decimal - Get - Return Me.calcDutyBaseField - End Get - Set - Me.calcDutyBaseField = Value - End Set - End Property - - - Public Property calcDutyBaseSpecified() As Boolean - Get - Return Me.calcDutyBaseFieldSpecified - End Get - Set - Me.calcDutyBaseFieldSpecified = Value - End Set - End Property - - Public Property currency() As String - Get - Return Me.currencyField - End Get - Set - Me.currencyField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property rate() As Decimal - Get - Return Me.rateField - End Get - Set - Me.rateField = Value - End Set - End Property - - - Public Property rateSpecified() As Boolean - Get - Return Me.rateFieldSpecified - End Get - Set - Me.rateFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property addDeduct() As Decimal - Get - Return Me.addDeductField - End Get - Set - Me.addDeductField = Value - End Set - End Property - - - Public Property addDeductSpecified() As Boolean - Get - Return Me.addDeductFieldSpecified - End Get - Set - Me.addDeductFieldSpecified = Value - End Set - End Property - - Public Property calcDuty() As Decimal - Get - Return Me.calcDutyField - End Get - Set - Me.calcDutyField = Value - End Set - End Property - - - Public Property calcDutySpecified() As Boolean - Get - Return Me.calcDutyFieldSpecified - End Get - Set - Me.calcDutyFieldSpecified = Value - End Set - End Property - - Public Property duty() As Decimal - Get - Return Me.dutyField - End Get - Set - Me.dutyField = Value - End Set - End Property - - - Public Property dutySpecified() As Boolean - Get - Return Me.dutyFieldSpecified - End Get - Set - Me.dutyFieldSpecified = Value - End Set - End Property - - Public Property dutyBase() As Decimal - Get - Return Me.dutyBaseField - End Get - Set - Me.dutyBaseField = Value - End Set - End Property - - - Public Property dutyBaseSpecified() As Boolean - Get - Return Me.dutyBaseFieldSpecified - End Get - Set - Me.dutyBaseFieldSpecified = Value - End Set - End Property - - Public Property measureCode() As String - Get - Return Me.measureCodeField - End Get - Set - Me.measureCodeField = Value - End Set - End Property - - Public Property measure() As String - Get - Return Me.measureField - End Get - Set - Me.measureField = Value - End Set - End Property - - Public Property authorityDutyCode() As String - Get - Return Me.authorityDutyCodeField - End Get - Set - Me.authorityDutyCodeField = Value - End Set - End Property - - Public Property territory() As String - Get - Return Me.territoryField - End Get - Set - Me.territoryField = Value - End Set - End Property - - Public Property typeAddCode() As String - Get - Return Me.typeAddCodeField - End Get - Set - Me.typeAddCodeField = Value - End Set - End Property - - Public Property numberAddCode() As String - Get - Return Me.numberAddCodeField - End Get - Set - Me.numberAddCodeField = Value - End Set - End Property - - Public Property tariffRateQuota() As String - Get - Return Me.tariffRateQuotaField - End Get - Set - Me.tariffRateQuotaField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDuty)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDuty object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDuty object - ''' - '''string workflow markup to deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDuty - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDuty) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDuty 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDuty object - ''' - '''string xml file to load and deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - 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 TDuty) 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 TDuty - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValuesCust - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private additionalStatisticalValueField As Decimal - - Private additionalStatisticalValueFieldSpecified As Boolean - - Private additionalCostsVatField As Decimal - - Private additionalCostsVatFieldSpecified As Boolean - - Private addStatisticValueField As Decimal - - Private addStatisticValueFieldSpecified As Boolean - - Private oprIngredientsValueField As Decimal - - Private oprIngredientsValueFieldSpecified As Boolean - - Private additionalCosts1Field As Decimal - - Private additionalCosts1FieldSpecified As Boolean - - Private additionalCosts2Field As Decimal - - Private additionalCosts2FieldSpecified As Boolean - - Private additionalCosts3Field As Decimal - - Private additionalCosts3FieldSpecified As Boolean - - Private additionalCosts4Field As Decimal - - Private additionalCosts4FieldSpecified As Boolean - - Private additionalCosts5Field As Decimal - - Private additionalCosts5FieldSpecified As Boolean - - Private additionalCosts6Field As Decimal - - Private additionalCosts6FieldSpecified As Boolean - - Private additionalCosts7Field As Decimal - - Private additionalCosts7FieldSpecified As Boolean - - Private additionalCosts8Field As Decimal - - Private additionalCosts8FieldSpecified As Boolean - - Private additionalCosts9Field As Decimal - - Private additionalCosts9FieldSpecified As Boolean - - Private additionalCosts10Field As Decimal - - Private additionalCosts10FieldSpecified As Boolean - - Private additionalCosts11Field As Decimal - - Private additionalCosts11FieldSpecified As Boolean - - Private additionalCosts12Field As Decimal - - Private additionalCosts12FieldSpecified As Boolean - - Private additionalCosts13Field As Decimal - - Private additionalCosts13FieldSpecified As Boolean - - Private additionalCosts14Field As Decimal - - Private additionalCosts14FieldSpecified As Boolean - - Private additionalCosts15Field As Decimal - - Private additionalCosts15FieldSpecified As Boolean - - Private additionalCosts16Field As Decimal - - Private additionalCosts16FieldSpecified As Boolean - - Private additionalCosts17Field As Decimal - - Private additionalCosts17FieldSpecified As Boolean - - Private additionalCosts18Field As Decimal - - Private additionalCosts18FieldSpecified As Boolean - - Private additionalCosts19Field As Decimal - - Private additionalCosts19FieldSpecified As Boolean - - Private additionalCosts20Field As Decimal - - Private additionalCosts20FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property additionalStatisticalValue() As Decimal - Get - Return Me.additionalStatisticalValueField - End Get - Set - Me.additionalStatisticalValueField = Value - End Set - End Property - - - Public Property additionalStatisticalValueSpecified() As Boolean - Get - Return Me.additionalStatisticalValueFieldSpecified - End Get - Set - Me.additionalStatisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsVat() As Decimal - Get - Return Me.additionalCostsVatField - End Get - Set - Me.additionalCostsVatField = Value - End Set - End Property - - - Public Property additionalCostsVatSpecified() As Boolean - Get - Return Me.additionalCostsVatFieldSpecified - End Get - Set - Me.additionalCostsVatFieldSpecified = Value - End Set - End Property - - Public Property addStatisticValue() As Decimal - Get - Return Me.addStatisticValueField - End Get - Set - Me.addStatisticValueField = Value - End Set - End Property - - - Public Property addStatisticValueSpecified() As Boolean - Get - Return Me.addStatisticValueFieldSpecified - End Get - Set - Me.addStatisticValueFieldSpecified = Value - End Set - End Property - - Public Property oprIngredientsValue() As Decimal - Get - Return Me.oprIngredientsValueField - End Get - Set - Me.oprIngredientsValueField = Value - End Set - End Property - - - Public Property oprIngredientsValueSpecified() As Boolean - Get - Return Me.oprIngredientsValueFieldSpecified - End Get - Set - Me.oprIngredientsValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCosts1() As Decimal - Get - Return Me.additionalCosts1Field - End Get - Set - Me.additionalCosts1Field = Value - End Set - End Property - - - Public Property additionalCosts1Specified() As Boolean - Get - Return Me.additionalCosts1FieldSpecified - End Get - Set - Me.additionalCosts1FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts2() As Decimal - Get - Return Me.additionalCosts2Field - End Get - Set - Me.additionalCosts2Field = Value - End Set - End Property - - - Public Property additionalCosts2Specified() As Boolean - Get - Return Me.additionalCosts2FieldSpecified - End Get - Set - Me.additionalCosts2FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts3() As Decimal - Get - Return Me.additionalCosts3Field - End Get - Set - Me.additionalCosts3Field = Value - End Set - End Property - - - Public Property additionalCosts3Specified() As Boolean - Get - Return Me.additionalCosts3FieldSpecified - End Get - Set - Me.additionalCosts3FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts4() As Decimal - Get - Return Me.additionalCosts4Field - End Get - Set - Me.additionalCosts4Field = Value - End Set - End Property - - - Public Property additionalCosts4Specified() As Boolean - Get - Return Me.additionalCosts4FieldSpecified - End Get - Set - Me.additionalCosts4FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts5() As Decimal - Get - Return Me.additionalCosts5Field - End Get - Set - Me.additionalCosts5Field = Value - End Set - End Property - - - Public Property additionalCosts5Specified() As Boolean - Get - Return Me.additionalCosts5FieldSpecified - End Get - Set - Me.additionalCosts5FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts6() As Decimal - Get - Return Me.additionalCosts6Field - End Get - Set - Me.additionalCosts6Field = Value - End Set - End Property - - - Public Property additionalCosts6Specified() As Boolean - Get - Return Me.additionalCosts6FieldSpecified - End Get - Set - Me.additionalCosts6FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts7() As Decimal - Get - Return Me.additionalCosts7Field - End Get - Set - Me.additionalCosts7Field = Value - End Set - End Property - - - Public Property additionalCosts7Specified() As Boolean - Get - Return Me.additionalCosts7FieldSpecified - End Get - Set - Me.additionalCosts7FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts8() As Decimal - Get - Return Me.additionalCosts8Field - End Get - Set - Me.additionalCosts8Field = Value - End Set - End Property - - - Public Property additionalCosts8Specified() As Boolean - Get - Return Me.additionalCosts8FieldSpecified - End Get - Set - Me.additionalCosts8FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts9() As Decimal - Get - Return Me.additionalCosts9Field - End Get - Set - Me.additionalCosts9Field = Value - End Set - End Property - - - Public Property additionalCosts9Specified() As Boolean - Get - Return Me.additionalCosts9FieldSpecified - End Get - Set - Me.additionalCosts9FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts10() As Decimal - Get - Return Me.additionalCosts10Field - End Get - Set - Me.additionalCosts10Field = Value - End Set - End Property - - - Public Property additionalCosts10Specified() As Boolean - Get - Return Me.additionalCosts10FieldSpecified - End Get - Set - Me.additionalCosts10FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts11() As Decimal - Get - Return Me.additionalCosts11Field - End Get - Set - Me.additionalCosts11Field = Value - End Set - End Property - - - Public Property additionalCosts11Specified() As Boolean - Get - Return Me.additionalCosts11FieldSpecified - End Get - Set - Me.additionalCosts11FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts12() As Decimal - Get - Return Me.additionalCosts12Field - End Get - Set - Me.additionalCosts12Field = Value - End Set - End Property - - - Public Property additionalCosts12Specified() As Boolean - Get - Return Me.additionalCosts12FieldSpecified - End Get - Set - Me.additionalCosts12FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts13() As Decimal - Get - Return Me.additionalCosts13Field - End Get - Set - Me.additionalCosts13Field = Value - End Set - End Property - - - Public Property additionalCosts13Specified() As Boolean - Get - Return Me.additionalCosts13FieldSpecified - End Get - Set - Me.additionalCosts13FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts14() As Decimal - Get - Return Me.additionalCosts14Field - End Get - Set - Me.additionalCosts14Field = Value - End Set - End Property - - - Public Property additionalCosts14Specified() As Boolean - Get - Return Me.additionalCosts14FieldSpecified - End Get - Set - Me.additionalCosts14FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts15() As Decimal - Get - Return Me.additionalCosts15Field - End Get - Set - Me.additionalCosts15Field = Value - End Set - End Property - - - Public Property additionalCosts15Specified() As Boolean - Get - Return Me.additionalCosts15FieldSpecified - End Get - Set - Me.additionalCosts15FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts16() As Decimal - Get - Return Me.additionalCosts16Field - End Get - Set - Me.additionalCosts16Field = Value - End Set - End Property - - - Public Property additionalCosts16Specified() As Boolean - Get - Return Me.additionalCosts16FieldSpecified - End Get - Set - Me.additionalCosts16FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts17() As Decimal - Get - Return Me.additionalCosts17Field - End Get - Set - Me.additionalCosts17Field = Value - End Set - End Property - - - Public Property additionalCosts17Specified() As Boolean - Get - Return Me.additionalCosts17FieldSpecified - End Get - Set - Me.additionalCosts17FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts18() As Decimal - Get - Return Me.additionalCosts18Field - End Get - Set - Me.additionalCosts18Field = Value - End Set - End Property - - - Public Property additionalCosts18Specified() As Boolean - Get - Return Me.additionalCosts18FieldSpecified - End Get - Set - Me.additionalCosts18FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts19() As Decimal - Get - Return Me.additionalCosts19Field - End Get - Set - Me.additionalCosts19Field = Value - End Set - End Property - - - Public Property additionalCosts19Specified() As Boolean - Get - Return Me.additionalCosts19FieldSpecified - End Get - Set - Me.additionalCosts19FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts20() As Decimal - Get - Return Me.additionalCosts20Field - End Get - Set - Me.additionalCosts20Field = Value - End Set - End Property - - - Public Property additionalCosts20Specified() As Boolean - Get - Return Me.additionalCosts20FieldSpecified - End Get - Set - Me.additionalCosts20FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValuesCust)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValuesCust object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValuesCust object - ''' - '''string workflow markup to deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValuesCust - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValuesCust) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValuesCust 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValuesCust object - ''' - '''string xml file to load and deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - 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 TCalcValuesCust) 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 TCalcValuesCust - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValues - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private statValueField As Decimal - - Private statValueFieldSpecified As Boolean - - Private freightStatValField As Decimal - - Private freightStatValFieldSpecified As Boolean - - Private freightInternationalField As Decimal - - Private freightInternationalFieldSpecified As Boolean - - Private freightEUField As Decimal - - Private freightEUFieldSpecified As Boolean - - Private freightNationalField As Decimal - - Private freightNationalFieldSpecified As Boolean - - Private insuranceField As Decimal - - Private insuranceFieldSpecified As Boolean - - Private shipAddCostsField As List(Of Decimal) - - Private invAddCostsField As List(Of Decimal) - - Private lineAddCostsField As List(Of Decimal) - - Private custValueField As Decimal - - Private custValueFieldSpecified As Boolean - - Private assistValueField As Decimal - - Private assistValueFieldSpecified As Boolean - - Private vatAddCostsField As Decimal - - Private vatAddCostsFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.lineAddCostsField = New List(Of Decimal)() - Me.invAddCostsField = New List(Of Decimal)() - Me.shipAddCostsField = New List(Of Decimal)() - End Sub - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property statValue() As Decimal - Get - Return Me.statValueField - End Get - Set - Me.statValueField = Value - End Set - End Property - - - Public Property statValueSpecified() As Boolean - Get - Return Me.statValueFieldSpecified - End Get - Set - Me.statValueFieldSpecified = Value - End Set - End Property - - Public Property freightStatVal() As Decimal - Get - Return Me.freightStatValField - End Get - Set - Me.freightStatValField = Value - End Set - End Property - - - Public Property freightStatValSpecified() As Boolean - Get - Return Me.freightStatValFieldSpecified - End Get - Set - Me.freightStatValFieldSpecified = Value - End Set - End Property - - Public Property freightInternational() As Decimal - Get - Return Me.freightInternationalField - End Get - Set - Me.freightInternationalField = Value - End Set - End Property - - - Public Property freightInternationalSpecified() As Boolean - Get - Return Me.freightInternationalFieldSpecified - End Get - Set - Me.freightInternationalFieldSpecified = Value - End Set - End Property - - Public Property freightEU() As Decimal - Get - Return Me.freightEUField - End Get - Set - Me.freightEUField = Value - End Set - End Property - - - Public Property freightEUSpecified() As Boolean - Get - Return Me.freightEUFieldSpecified - End Get - Set - Me.freightEUFieldSpecified = Value - End Set - End Property - - Public Property freightNational() As Decimal - Get - Return Me.freightNationalField - End Get - Set - Me.freightNationalField = Value - End Set - End Property - - - Public Property freightNationalSpecified() As Boolean - Get - Return Me.freightNationalFieldSpecified - End Get - Set - Me.freightNationalFieldSpecified = Value - End Set - End Property - - Public Property insurance() As Decimal - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - - Public Property insuranceSpecified() As Boolean - Get - Return Me.insuranceFieldSpecified - End Get - Set - Me.insuranceFieldSpecified = Value - End Set - End Property - - Public Property shipAddCosts() As List(Of Decimal) - Get - Return Me.shipAddCostsField - End Get - Set - Me.shipAddCostsField = Value - End Set - End Property - - Public Property invAddCosts() As List(Of Decimal) - Get - Return Me.invAddCostsField - End Get - Set - Me.invAddCostsField = Value - End Set - End Property - - Public Property lineAddCosts() As List(Of Decimal) - Get - Return Me.lineAddCostsField - End Get - Set - Me.lineAddCostsField = Value - End Set - End Property - - Public Property custValue() As Decimal - Get - Return Me.custValueField - End Get - Set - Me.custValueField = Value - End Set - End Property - - - Public Property custValueSpecified() As Boolean - Get - Return Me.custValueFieldSpecified - End Get - Set - Me.custValueFieldSpecified = Value - End Set - End Property - - Public Property assistValue() As Decimal - Get - Return Me.assistValueField - End Get - Set - Me.assistValueField = Value - End Set - End Property - - - Public Property assistValueSpecified() As Boolean - Get - Return Me.assistValueFieldSpecified - End Get - Set - Me.assistValueFieldSpecified = Value - End Set - End Property - - Public Property vatAddCosts() As Decimal - Get - Return Me.vatAddCostsField - End Get - Set - Me.vatAddCostsField = Value - End Set - End Property - - - Public Property vatAddCostsSpecified() As Boolean - Get - Return Me.vatAddCostsFieldSpecified - End Get - Set - Me.vatAddCostsFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValues)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValues object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValues object - ''' - '''string workflow markup to deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValues - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValues) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValues 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValues object - ''' - '''string xml file to load and deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - 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 TCalcValues) 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 TCalcValues - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportRegistrationNo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private registrationNumber4Field As String - - Private messageRefNumber1Field As String - - Private messageRefNumber2Field As String - - Private messageRefNumber3Field As String - - Private positionNumber1Field As Decimal - - Private positionNumber1FieldSpecified As Boolean - - Private positionNumber2Field As Decimal - - Private positionNumber2FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property registrationNumber4() As String - Get - Return Me.registrationNumber4Field - End Get - Set - Me.registrationNumber4Field = Value - End Set - End Property - - Public Property messageRefNumber1() As String - Get - Return Me.messageRefNumber1Field - End Get - Set - Me.messageRefNumber1Field = Value - End Set - End Property - - Public Property messageRefNumber2() As String - Get - Return Me.messageRefNumber2Field - End Get - Set - Me.messageRefNumber2Field = Value - End Set - End Property - - Public Property messageRefNumber3() As String - Get - Return Me.messageRefNumber3Field - End Get - Set - Me.messageRefNumber3Field = Value - End Set - End Property - - Public Property positionNumber1() As Decimal - Get - Return Me.positionNumber1Field - End Get - Set - Me.positionNumber1Field = Value - End Set - End Property - - - Public Property positionNumber1Specified() As Boolean - Get - Return Me.positionNumber1FieldSpecified - End Get - Set - Me.positionNumber1FieldSpecified = Value - End Set - End Property - - Public Property positionNumber2() As Decimal - Get - Return Me.positionNumber2Field - End Get - Set - Me.positionNumber2Field = Value - End Set - End Property - - - Public Property positionNumber2Specified() As Boolean - Get - Return Me.positionNumber2FieldSpecified - End Get - Set - Me.positionNumber2FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportRegistrationNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportRegistrationNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportRegistrationNo object - ''' - '''string workflow markup to deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportRegistrationNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportRegistrationNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportRegistrationNo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportRegistrationNo object - ''' - '''string xml file to load and deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - 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 TImportRegistrationNo) 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 TImportRegistrationNo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReceipt - - Private receiptNumberField As String - - Private receiptDateField As Date - - Private receiptDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property receiptNumber() As String - Get - Return Me.receiptNumberField - End Get - Set - Me.receiptNumberField = Value - End Set - End Property - - Public Property receiptDate() As Date - Get - Return Me.receiptDateField - End Get - Set - Me.receiptDateField = Value - End Set - End Property - - - Public Property receiptDateSpecified() As Boolean - Get - Return Me.receiptDateFieldSpecified - End Get - Set - Me.receiptDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReceipt)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReceipt object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReceipt object - ''' - '''string workflow markup to deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReceipt - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReceipt) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TReceipt 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TReceipt object - ''' - '''string xml file to load and deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - 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 TReceipt) 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 TReceipt - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private packageDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property packageDescription() As String - Get - Return Me.packageDescriptionField - End Get - Set - Me.packageDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBom - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBom)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBom object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBom object - ''' - '''string workflow markup to deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBom - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBom) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TBom 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TBom object - ''' - '''string xml file to load and deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - 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 TBom) 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 TBom - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCostsVAT - - Private addAmountVATField As Decimal - - Private addAmountVATFieldSpecified As Boolean - - Private addCurrencyVATField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addAmountVAT() As Decimal - Get - Return Me.addAmountVATField - End Get - Set - Me.addAmountVATField = Value - End Set - End Property - - - Public Property addAmountVATSpecified() As Boolean - Get - Return Me.addAmountVATFieldSpecified - End Get - Set - Me.addAmountVATFieldSpecified = Value - End Set - End Property - - Public Property addCurrencyVAT() As String - Get - Return Me.addCurrencyVATField - End Get - Set - Me.addCurrencyVATField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCostsVAT)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCostsVAT object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCostsVAT object - ''' - '''string workflow markup to deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCostsVAT - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCostsVAT) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAddCostsVAT 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAddCostsVAT object - ''' - '''string xml file to load and deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - 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 TAddCostsVAT) 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 TAddCostsVAT - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebateLine - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebateLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebateLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebateLine object - ''' - '''string workflow markup to deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebateLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebateLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebateLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebateLine object - ''' - '''string xml file to load and deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - 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 TRebateLine) 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 TRebateLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsLine - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - 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 TInsuranceCostsLine) 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 TInsuranceCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsLine - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtFlagPercentOrValueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.frtFlagPercentOrValueField = "P" - End Sub - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - - Public Property frtFlagPercentOrValue() As String - Get - Return Me.frtFlagPercentOrValueField - End Get - Set - Me.frtFlagPercentOrValueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - 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 TFreightCostsLine) 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 TFreightCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPricing - - Private prcTypeField As String - - Private prcReferenceField As String - - Private prcDateField As Date - - Private prcDateFieldSpecified As Boolean - - Private prcSystemField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property prcType() As String - Get - Return Me.prcTypeField - End Get - Set - Me.prcTypeField = Value - End Set - End Property - - Public Property prcReference() As String - Get - Return Me.prcReferenceField - End Get - Set - Me.prcReferenceField = Value - End Set - End Property - - Public Property prcDate() As Date - Get - Return Me.prcDateField - End Get - Set - Me.prcDateField = Value - End Set - End Property - - - Public Property prcDateSpecified() As Boolean - Get - Return Me.prcDateFieldSpecified - End Get - Set - Me.prcDateFieldSpecified = Value - End Set - End Property - - Public Property prcSystem() As String - Get - Return Me.prcSystemField - End Get - Set - Me.prcSystemField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPricing)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPricing object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPricing object - ''' - '''string workflow markup to deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPricing - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPricing) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPricing 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPricing object - ''' - '''string xml file to load and deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - 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 TPricing) 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 TPricing - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportLineLicense - - Private typeField As String - - Private codeField As String - - Private numberField As String - - Private dateField As Date - - Private dateFieldSpecified As Boolean - - Private notRequiredField As Boolean - - Private notRequiredFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property number() As String - Get - Return Me.numberField - End Get - Set - Me.numberField = Value - End Set - End Property - - Public Property [date]() As Date - Get - Return Me.dateField - End Get - Set - Me.dateField = Value - End Set - End Property - - - Public Property dateSpecified() As Boolean - Get - Return Me.dateFieldSpecified - End Get - Set - Me.dateFieldSpecified = Value - End Set - End Property - - Public Property notRequired() As Boolean - Get - Return Me.notRequiredField - End Get - Set - Me.notRequiredField = Value - End Set - End Property - - - Public Property notRequiredSpecified() As Boolean - Get - Return Me.notRequiredFieldSpecified - End Get - Set - Me.notRequiredFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportLineLicense)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportLineLicense object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportLineLicense object - ''' - '''string workflow markup to deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportLineLicense - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportLineLicense) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportLineLicense 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportLineLicense object - ''' - '''string xml file to load and deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - 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 TImportLineLicense) 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 TImportLineLicense - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TTariffCode - - Private hsCodeField As String - - Private vatCodeField As String - - Private exciseTaxCodeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property hsCode() As String - Get - Return Me.hsCodeField - End Get - Set - Me.hsCodeField = Value - End Set - End Property - - Public Property vatCode() As String - Get - Return Me.vatCodeField - End Get - Set - Me.vatCodeField = Value - End Set - End Property - - Public Property exciseTaxCode() As String - Get - Return Me.exciseTaxCodeField - End Get - Set - Me.exciseTaxCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TTariffCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TTariffCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TTariffCode object - ''' - '''string workflow markup to deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TTariffCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TTariffCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TTariffCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TTariffCode object - ''' - '''string xml file to load and deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - 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 TTariffCode) 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 TTariffCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private partNumberField As String - - Private partDescriptionField As String - - Private serialNumberField As String - - Private productGroupField As String - - Private modelField As String - - Private brandField As String - - Private manufacturerNumberField As String - - Private ctoNumberField As String - - Private confidenceLevelField As Long - - Private confidenceLevelFieldSpecified As Boolean - - Private productCategoryField As String - - Private tariffCodeField As TTariffCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tariffCodeField = New TTariffCode() - End Sub - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Public Property serialNumber() As String - Get - Return Me.serialNumberField - End Get - Set - Me.serialNumberField = Value - End Set - End Property - - Public Property productGroup() As String - Get - Return Me.productGroupField - End Get - Set - Me.productGroupField = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property manufacturerNumber() As String - Get - Return Me.manufacturerNumberField - End Get - Set - Me.manufacturerNumberField = Value - End Set - End Property - - Public Property ctoNumber() As String - Get - Return Me.ctoNumberField - End Get - Set - Me.ctoNumberField = Value - End Set - End Property - - Public Property confidenceLevel() As Long - Get - Return Me.confidenceLevelField - End Get - Set - Me.confidenceLevelField = Value - End Set - End Property - - - Public Property confidenceLevelSpecified() As Boolean - Get - Return Me.confidenceLevelFieldSpecified - End Get - Set - Me.confidenceLevelFieldSpecified = Value - End Set - End Property - - Public Property productCategory() As String - Get - Return Me.productCategoryField - End Get - Set - Me.productCategoryField = Value - End Set - End Property - - Public Property TariffCode() As TTariffCode - Get - Return Me.tariffCodeField - End Get - Set - Me.tariffCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNumberField As Decimal - - Private itemField As TItem - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private quantityUomField As String - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private reportingQuantityField As Decimal - - Private reportingQuantityFieldSpecified As Boolean - - Private reportingQuantityUomField As String - - Private priceField As Decimal - - Private priceFieldSpecified As Boolean - - Private lineValueField As Decimal - - Private lineValueFieldSpecified As Boolean - - Private licenseField As TImportLineLicense - - Private pricingField As TPricing - - Private freightCostsField As TFreightCostsLine - - Private insuranceCostsField As TInsuranceCostsLine - - Private additionalCostField As List(Of TAddCosts) - - Private rebateField As TRebateLine - - Private additionalCostsVATField As TAddCostsVAT - - Private countryOfOriginField As String - - Private prefCountryOfOriginField As String - - Private locationOfGoodsField As String - - Private importQuotaField As String - - Private importQuotaKeyField As String - - Private importQuotaQuantityField As Decimal - - Private importQuotaQuantityFieldSpecified As Boolean - - Private importQuotaUnitOfMeasurementField As String - - Private importQuotaQualifierField As String - - Private customsProcedureField As String - - Private statisticalCodeField As String - - Private endUseIndicatorField As String - - Private transactionTypeField As String - - Private addCodeField As List(Of String) - - Private prefRequestCodeField As String - - Private documentsField As List(Of TDocument) - - Private previousDocumentField As List(Of TPrevDoc) - - Private bOMField As TBom - - Private stockTypeField As String - - Private stockType2Field As String - - Private stockExpiryDateField As Date - - Private stockExpiryDateFieldSpecified As Boolean - - Private packageField As TPackage - - Private accountNumberField As String - - Private deliveryNoteField As String - - Private orderNumberField As String - - Private receiptField As TReceipt - - Private asnNumberField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private referenceCurrencyField As String - - Private textField As String - - Private text2Field As String - - Private registrationNumbersField As TImportRegistrationNo - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containerInfoField As List(Of TDetailContainerInfo) - - Private partnersField As List(Of TPartner) - - Private calculatedValuesField As TCalcValues - - Private calculatedValuesCustField As TCalcValuesCust - - Private dutiesField As List(Of TDuty) - - Private dutyTaxesField As List(Of TDutyTax) - - Private dutySavingsField As List(Of TDutySaving) - - Private oprDetailsField As TOprInfo - - Private uniqueIdField As Decimal - - Private uniqueIdFieldSpecified As Boolean - - Private externalProcessingField As String - - Private additionalInformationField As List(Of TAttribute) - - Private intraField As TCustIntraLine - - Private preSupplierField As TPreSupplier - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private valuationIndicatorField As String - - Private referencePreviousProceduresField As List(Of TRefPrevProcedure) - - Private packagesDataField As TPackagesData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packagesDataField = New TPackagesData() - Me.referencePreviousProceduresField = New List(Of TRefPrevProcedure)() - Me.preSupplierField = New TPreSupplier() - Me.intraField = New TCustIntraLine() - Me.additionalInformationField = New List(Of TAttribute)() - Me.oprDetailsField = New TOprInfo() - Me.dutySavingsField = New List(Of TDutySaving)() - Me.dutyTaxesField = New List(Of TDutyTax)() - Me.dutiesField = New List(Of TDuty)() - Me.calculatedValuesCustField = New TCalcValuesCust() - Me.calculatedValuesField = New TCalcValues() - Me.partnersField = New List(Of TPartner)() - Me.containerInfoField = New List(Of TDetailContainerInfo)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.registrationNumbersField = New TImportRegistrationNo() - Me.receiptField = New TReceipt() - Me.packageField = New TPackage() - Me.bOMField = New TBom() - Me.previousDocumentField = New List(Of TPrevDoc)() - Me.documentsField = New List(Of TDocument)() - Me.addCodeField = New List(Of String)() - Me.additionalCostsVATField = New TAddCostsVAT() - Me.rebateField = New TRebateLine() - Me.additionalCostField = New List(Of TAddCosts)() - Me.insuranceCostsField = New TInsuranceCostsLine() - Me.freightCostsField = New TFreightCostsLine() - Me.pricingField = New TPricing() - Me.licenseField = New TImportLineLicense() - Me.itemField = New TItem() - End Sub - - Public Property lineNumber() As Decimal - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - Public Property Item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property quantityUom() As String - Get - Return Me.quantityUomField - End Get - Set - Me.quantityUomField = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantity() As Decimal - Get - Return Me.reportingQuantityField - End Get - Set - Me.reportingQuantityField = Value - End Set - End Property - - - Public Property reportingQuantitySpecified() As Boolean - Get - Return Me.reportingQuantityFieldSpecified - End Get - Set - Me.reportingQuantityFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantityUom() As String - Get - Return Me.reportingQuantityUomField - End Get - Set - Me.reportingQuantityUomField = Value - End Set - End Property - - Public Property price() As Decimal - Get - Return Me.priceField - End Get - Set - Me.priceField = Value - End Set - End Property - - - Public Property priceSpecified() As Boolean - Get - Return Me.priceFieldSpecified - End Get - Set - Me.priceFieldSpecified = Value - End Set - End Property - - Public Property lineValue() As Decimal - Get - Return Me.lineValueField - End Get - Set - Me.lineValueField = Value - End Set - End Property - - - Public Property lineValueSpecified() As Boolean - Get - Return Me.lineValueFieldSpecified - End Get - Set - Me.lineValueFieldSpecified = Value - End Set - End Property - - Public Property License() As TImportLineLicense - Get - Return Me.licenseField - End Get - Set - Me.licenseField = Value - End Set - End Property - - Public Property Pricing() As TPricing - Get - Return Me.pricingField - End Get - Set - Me.pricingField = Value - End Set - End Property - - Public Property FreightCosts() As TFreightCostsLine - Get - Return Me.freightCostsField - End Get - Set - Me.freightCostsField = Value - End Set - End Property - - Public Property InsuranceCosts() As TInsuranceCostsLine - Get - Return Me.insuranceCostsField - End Get - Set - Me.insuranceCostsField = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property Rebate() As TRebateLine - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property AdditionalCostsVAT() As TAddCostsVAT - Get - Return Me.additionalCostsVATField - End Get - Set - Me.additionalCostsVATField = Value - End Set - End Property - - Public Property countryOfOrigin() As String - Get - Return Me.countryOfOriginField - End Get - Set - Me.countryOfOriginField = Value - End Set - End Property - - Public Property prefCountryOfOrigin() As String - Get - Return Me.prefCountryOfOriginField - End Get - Set - Me.prefCountryOfOriginField = Value - End Set - End Property - - Public Property locationOfGoods() As String - Get - Return Me.locationOfGoodsField - End Get - Set - Me.locationOfGoodsField = Value - End Set - End Property - - Public Property importQuota() As String - Get - Return Me.importQuotaField - End Get - Set - Me.importQuotaField = Value - End Set - End Property - - Public Property importQuotaKey() As String - Get - Return Me.importQuotaKeyField - End Get - Set - Me.importQuotaKeyField = Value - End Set - End Property - - Public Property importQuotaQuantity() As Decimal - Get - Return Me.importQuotaQuantityField - End Get - Set - Me.importQuotaQuantityField = Value - End Set - End Property - - - Public Property importQuotaQuantitySpecified() As Boolean - Get - Return Me.importQuotaQuantityFieldSpecified - End Get - Set - Me.importQuotaQuantityFieldSpecified = Value - End Set - End Property - - Public Property importQuotaUnitOfMeasurement() As String - Get - Return Me.importQuotaUnitOfMeasurementField - End Get - Set - Me.importQuotaUnitOfMeasurementField = Value - End Set - End Property - - Public Property importQuotaQualifier() As String - Get - Return Me.importQuotaQualifierField - End Get - Set - Me.importQuotaQualifierField = Value - End Set - End Property - - Public Property customsProcedure() As String - Get - Return Me.customsProcedureField - End Get - Set - Me.customsProcedureField = Value - End Set - End Property - - Public Property statisticalCode() As String - Get - Return Me.statisticalCodeField - End Get - Set - Me.statisticalCodeField = Value - End Set - End Property - - Public Property endUseIndicator() As String - Get - Return Me.endUseIndicatorField - End Get - Set - Me.endUseIndicatorField = Value - End Set - End Property - - Public Property transactionType() As String - Get - Return Me.transactionTypeField - End Get - Set - Me.transactionTypeField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property prefRequestCode() As String - Get - Return Me.prefRequestCodeField - End Get - Set - Me.prefRequestCodeField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property PreviousDocument() As List(Of TPrevDoc) - Get - Return Me.previousDocumentField - End Get - Set - Me.previousDocumentField = Value - End Set - End Property - - Public Property BOM() As TBom - Get - Return Me.bOMField - End Get - Set - Me.bOMField = Value - End Set - End Property - - Public Property stockType() As String - Get - Return Me.stockTypeField - End Get - Set - Me.stockTypeField = Value - End Set - End Property - - Public Property stockType2() As String - Get - Return Me.stockType2Field - End Get - Set - Me.stockType2Field = Value - End Set - End Property - - Public Property stockExpiryDate() As Date - Get - Return Me.stockExpiryDateField - End Get - Set - Me.stockExpiryDateField = Value - End Set - End Property - - - Public Property stockExpiryDateSpecified() As Boolean - Get - Return Me.stockExpiryDateFieldSpecified - End Get - Set - Me.stockExpiryDateFieldSpecified = Value - End Set - End Property - - Public Property Package() As TPackage - Get - Return Me.packageField - End Get - Set - Me.packageField = Value - End Set - End Property - - Public Property accountNumber() As String - Get - Return Me.accountNumberField - End Get - Set - Me.accountNumberField = Value - End Set - End Property - - Public Property deliveryNote() As String - Get - Return Me.deliveryNoteField - End Get - Set - Me.deliveryNoteField = Value - End Set - End Property - - Public Property orderNumber() As String - Get - Return Me.orderNumberField - End Get - Set - Me.orderNumberField = Value - End Set - End Property - - Public Property Receipt() As TReceipt - Get - Return Me.receiptField - End Get - Set - Me.receiptField = Value - End Set - End Property - - Public Property asnNumber() As String - Get - Return Me.asnNumberField - End Get - Set - Me.asnNumberField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property referenceCurrency() As String - Get - Return Me.referenceCurrencyField - End Get - Set - Me.referenceCurrencyField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property RegistrationNumbers() As TImportRegistrationNo - Get - Return Me.registrationNumbersField - End Get - Set - Me.registrationNumbersField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property ContainerInfo() As List(Of TDetailContainerInfo) - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - Public Property CalculatedValues() As TCalcValues - Get - Return Me.calculatedValuesField - End Get - Set - Me.calculatedValuesField = Value - End Set - End Property - - Public Property CalculatedValuesCust() As TCalcValuesCust - Get - Return Me.calculatedValuesCustField - End Get - Set - Me.calculatedValuesCustField = Value - End Set - End Property - - - Public Property Duties() As List(Of TDuty) - Get - Return Me.dutiesField - End Get - Set - Me.dutiesField = Value - End Set - End Property - - - Public Property DutyTaxes() As List(Of TDutyTax) - Get - Return Me.dutyTaxesField - End Get - Set - Me.dutyTaxesField = Value - End Set - End Property - - - Public Property DutySavings() As List(Of TDutySaving) - Get - Return Me.dutySavingsField - End Get - Set - Me.dutySavingsField = Value - End Set - End Property - - Public Property OprDetails() As TOprInfo - Get - Return Me.oprDetailsField - End Get - Set - Me.oprDetailsField = Value - End Set - End Property - - Public Property uniqueId() As Decimal - Get - Return Me.uniqueIdField - End Get - Set - Me.uniqueIdField = Value - End Set - End Property - - - Public Property uniqueIdSpecified() As Boolean - Get - Return Me.uniqueIdFieldSpecified - End Get - Set - Me.uniqueIdFieldSpecified = Value - End Set - End Property - - Public Property externalProcessing() As String - Get - Return Me.externalProcessingField - End Get - Set - Me.externalProcessingField = Value - End Set - End Property - - - Public Property AdditionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property Intra() As TCustIntraLine - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - Public Property PreSupplier() As TPreSupplier - Get - Return Me.preSupplierField - End Get - Set - Me.preSupplierField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property valuationIndicator() As String - Get - Return Me.valuationIndicatorField - End Get - Set - Me.valuationIndicatorField = Value - End Set - End Property - - - Public Property ReferencePreviousProcedures() As List(Of TRefPrevProcedure) - Get - Return Me.referencePreviousProceduresField - End Get - Set - Me.referencePreviousProceduresField = Value - End Set - End Property - - Public Property PackagesData() As TPackagesData - Get - Return Me.packagesDataField - End Get - Set - Me.packagesDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private addTypeField As String - - Private addAmountField As Decimal - - Private addAmountFieldSpecified As Boolean - - Private addCurrencyField As String - - Private addProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addType() As String - Get - Return Me.addTypeField - End Get - Set - Me.addTypeField = Value - End Set - End Property - - Public Property addAmount() As Decimal - Get - Return Me.addAmountField - End Get - Set - Me.addAmountField = Value - End Set - End Property - - - Public Property addAmountSpecified() As Boolean - Get - Return Me.addAmountFieldSpecified - End Get - Set - Me.addAmountFieldSpecified = Value - End Set - End Property - - Public Property addCurrency() As String - Get - Return Me.addCurrencyField - End Get - Set - Me.addCurrencyField = Value - End Set - End Property - - Public Property addProRating() As String - Get - Return Me.addProRatingField - End Get - Set - Me.addProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocument - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docCategoryField As String - - Private docWriteOffQuantityField As Decimal - - Private docWriteOffQuantityFieldSpecified As Boolean - - Private docIssuerCountryField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Public Property docWriteOffQuantity() As Decimal - Get - Return Me.docWriteOffQuantityField - End Get - Set - Me.docWriteOffQuantityField = Value - End Set - End Property - - - Public Property docWriteOffQuantitySpecified() As Boolean - Get - Return Me.docWriteOffQuantityFieldSpecified - End Get - Set - Me.docWriteOffQuantityFieldSpecified = Value - End Set - End Property - - Public Property docIssuerCountry() As String - Get - Return Me.docIssuerCountryField - End Get - Set - Me.docIssuerCountryField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocument object - ''' - '''string workflow markup to deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDocument 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDocument object - ''' - '''string xml file to load and deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - 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 TDocument) 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 TDocument - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrevDoc - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private previousDocDateField As Date - - Private previousDocDateFieldSpecified As Boolean - - Private departureCustomsOfficeField As String - - Private destinationCustomsOfficeField As String - - Private typeField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property previousDocDate() As Date - Get - Return Me.previousDocDateField - End Get - Set - Me.previousDocDateField = Value - End Set - End Property - - - Public Property previousDocDateSpecified() As Boolean - Get - Return Me.previousDocDateFieldSpecified - End Get - Set - Me.previousDocDateFieldSpecified = Value - End Set - End Property - - Public Property departureCustomsOffice() As String - Get - Return Me.departureCustomsOfficeField - End Get - Set - Me.departureCustomsOfficeField = Value - End Set - End Property - - Public Property destinationCustomsOffice() As String - Get - Return Me.destinationCustomsOfficeField - End Get - Set - Me.destinationCustomsOfficeField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrevDoc)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrevDoc object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrevDoc object - ''' - '''string workflow markup to deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrevDoc - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrevDoc) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrevDoc 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrevDoc object - ''' - '''string xml file to load and deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - 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 TPrevDoc) 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 TPrevDoc - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property Texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property Dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property Flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property Numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attrTypeField As String - - Private attrTextField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attrType() As String - Get - Return Me.attrTypeField - End Get - Set - Me.attrTypeField = Value - End Set - End Property - - Public Property attrText() As String - Get - Return Me.attrTextField - End Get - Set - Me.attrTextField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDetailContainerInfo - - Private containerNumberField As String - - Private containerSealNumberField As String - - Private containerPackagesField As Decimal - - Private containerPackagesFieldSpecified As Boolean - - Private containerGrossWeightField As Decimal - - Private containerGrossWeightFieldSpecified As Boolean - - Private containerNetWeightField As Decimal - - Private containerNetWeightFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerSealNumber() As String - Get - Return Me.containerSealNumberField - End Get - Set - Me.containerSealNumberField = Value - End Set - End Property - - Public Property containerPackages() As Decimal - Get - Return Me.containerPackagesField - End Get - Set - Me.containerPackagesField = Value - End Set - End Property - - - Public Property containerPackagesSpecified() As Boolean - Get - Return Me.containerPackagesFieldSpecified - End Get - Set - Me.containerPackagesFieldSpecified = Value - End Set - End Property - - Public Property containerGrossWeight() As Decimal - Get - Return Me.containerGrossWeightField - End Get - Set - Me.containerGrossWeightField = Value - End Set - End Property - - - Public Property containerGrossWeightSpecified() As Boolean - Get - Return Me.containerGrossWeightFieldSpecified - End Get - Set - Me.containerGrossWeightFieldSpecified = Value - End Set - End Property - - Public Property containerNetWeight() As Decimal - Get - Return Me.containerNetWeightField - End Get - Set - Me.containerNetWeightField = Value - End Set - End Property - - - Public Property containerNetWeightSpecified() As Boolean - Get - Return Me.containerNetWeightFieldSpecified - End Get - Set - Me.containerNetWeightFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDetailContainerInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDetailContainerInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDetailContainerInfo object - ''' - '''string workflow markup to deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDetailContainerInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDetailContainerInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDetailContainerInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDetailContainerInfo object - ''' - '''string xml file to load and deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - 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 TDetailContainerInfo) 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 TDetailContainerInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypeField As String - - Private partnerAddressField As TAddress - - Private partnerRelationField As String - - Private partnerInfoField As String - - Private partnerTelephoneField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TAddress() - End Sub - - Public Property partnerType() As String - Get - Return Me.partnerTypeField - End Get - Set - Me.partnerTypeField = Value - End Set - End Property - - Public Property PartnerAddress() As TAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property partnerInfo() As String - Get - Return Me.partnerInfoField - End Get - Set - Me.partnerInfoField = Value - End Set - End Property - - Public Property partnerTelephone() As String - Get - Return Me.partnerTelephoneField - End Get - Set - Me.partnerTelephoneField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private partnerRelationField As String - - Private addrDistrictField As String - - Private addrBranchNoField As String - - Private emailField As String - - Private addrVatNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property addrDistrict() As String - Get - Return Me.addrDistrictField - End Get - Set - Me.addrDistrictField = Value - End Set - End Property - - Public Property addrBranchNo() As String - Get - Return Me.addrBranchNoField - End Get - Set - Me.addrBranchNoField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property addrVatNumber() As String - Get - Return Me.addrVatNumberField - End Get - Set - Me.addrVatNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntra - - Private vendorVatIdField As String - - Private statisticalProcedureField As String - - Private internalReferenceField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property vendorVatId() As String - Get - Return Me.vendorVatIdField - End Get - Set - Me.vendorVatIdField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property internalReference() As String - Get - Return Me.internalReferenceField - End Get - Set - Me.internalReferenceField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntra)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntra object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntra object - ''' - '''string workflow markup to deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntra - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntra) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntra 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntra object - ''' - '''string xml file to load and deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - 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 TCustIntra) 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 TCustIntra - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportPaymentInfo - - Private paymentTypeField As String - - Private paymentDateField As Date - - Private paymentDateFieldSpecified As Boolean - - Private paymentBankCodeField As String - - Private paymentBankBranchCodeField As String - - Private paymentCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property paymentType() As String - Get - Return Me.paymentTypeField - End Get - Set - Me.paymentTypeField = Value - End Set - End Property - - Public Property paymentDate() As Date - Get - Return Me.paymentDateField - End Get - Set - Me.paymentDateField = Value - End Set - End Property - - - Public Property paymentDateSpecified() As Boolean - Get - Return Me.paymentDateFieldSpecified - End Get - Set - Me.paymentDateFieldSpecified = Value - End Set - End Property - - Public Property paymentBankCode() As String - Get - Return Me.paymentBankCodeField - End Get - Set - Me.paymentBankCodeField = Value - End Set - End Property - - Public Property paymentBankBranchCode() As String - Get - Return Me.paymentBankBranchCodeField - End Get - Set - Me.paymentBankBranchCodeField = Value - End Set - End Property - - Public Property paymentCurrency() As String - Get - Return Me.paymentCurrencyField - End Get - Set - Me.paymentCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportPaymentInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportPaymentInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportPaymentInfo object - ''' - '''string workflow markup to deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportPaymentInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportPaymentInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportPaymentInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportPaymentInfo object - ''' - '''string xml file to load and deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - 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 TImportPaymentInfo) 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 TImportPaymentInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsInv - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - 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 TInsuranceCostsInv) 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 TInsuranceCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsInv - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - 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 TFreightCostsInv) 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 TFreightCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebate - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private rebProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Public Property rebProRating() As String - Get - Return Me.rebProRatingField - End Get - Set - Me.rebProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebate object - ''' - '''string workflow markup to deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebate 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebate object - ''' - '''string xml file to load and deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - 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 TRebate) 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 TRebate - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private calculationOfFreightCostsField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property calculationOfFreightCosts() As String - Get - Return Me.calculationOfFreightCostsField - End Get - Set - Me.calculationOfFreightCostsField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHead - - Private invoiceTypeField As String - - Private contractDateField As Date - - Private contractDateFieldSpecified As Boolean - - Private countryOfTradeField As String - - Private supplierField As TAddress - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private invoiceValueField As Decimal - - Private invoiceValueFieldSpecified As Boolean - - Private invoiceCurrencyField As String - - Private deliveryTermsField As TDelTerm - - Private rebateField As TRebate - - Private discountField As Decimal - - Private discountFieldSpecified As Boolean - - Private additionalCostField As List(Of TAddCosts) - - Private textField As String - - Private text2Field As String - - Private freightField As TFreightCostsInv - - Private insuranceField As TInsuranceCostsInv - - Private referenceNumberField As String - - Private transportNumberField As String - - Private transportTypeField As String - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private disposalDateField As Date - - Private disposalDateFieldSpecified As Boolean - - Private timeLimitField As Date - - Private timeLimitFieldSpecified As Boolean - - Private registrationNumberField As String - - Private sealNumberField As String - - Private billOfLadingField As String - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private buyerField As String - - Private consigneeField As String - - Private paymentInformationField As TImportPaymentInfo - - Private customerFieldsField As TCustomerFields - - Private sellerField As TAddress - - Private exchangeRateField As Decimal - - Private exchangeRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private containerInfoField As TContainer - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.containerInfoField = New TContainer() - Me.sellerField = New TAddress() - Me.customerFieldsField = New TCustomerFields() - Me.paymentInformationField = New TImportPaymentInfo() - Me.insuranceField = New TInsuranceCostsInv() - Me.freightField = New TFreightCostsInv() - Me.additionalCostField = New List(Of TAddCosts)() - Me.rebateField = New TRebate() - Me.deliveryTermsField = New TDelTerm() - Me.supplierField = New TAddress() - End Sub - - Public Property invoiceType() As String - Get - Return Me.invoiceTypeField - End Get - Set - Me.invoiceTypeField = Value - End Set - End Property - - Public Property contractDate() As Date - Get - Return Me.contractDateField - End Get - Set - Me.contractDateField = Value - End Set - End Property - - - Public Property contractDateSpecified() As Boolean - Get - Return Me.contractDateFieldSpecified - End Get - Set - Me.contractDateFieldSpecified = Value - End Set - End Property - - Public Property countryOfTrade() As String - Get - Return Me.countryOfTradeField - End Get - Set - Me.countryOfTradeField = Value - End Set - End Property - - Public Property Supplier() As TAddress - Get - Return Me.supplierField - End Get - Set - Me.supplierField = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property invoiceValue() As Decimal - Get - Return Me.invoiceValueField - End Get - Set - Me.invoiceValueField = Value - End Set - End Property - - - Public Property invoiceValueSpecified() As Boolean - Get - Return Me.invoiceValueFieldSpecified - End Get - Set - Me.invoiceValueFieldSpecified = Value - End Set - End Property - - Public Property invoiceCurrency() As String - Get - Return Me.invoiceCurrencyField - End Get - Set - Me.invoiceCurrencyField = Value - End Set - End Property - - Public Property deliveryTerms() As TDelTerm - Get - Return Me.deliveryTermsField - End Get - Set - Me.deliveryTermsField = Value - End Set - End Property - - Public Property Rebate() As TRebate - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property discount() As Decimal - Get - Return Me.discountField - End Get - Set - Me.discountField = Value - End Set - End Property - - - Public Property discountSpecified() As Boolean - Get - Return Me.discountFieldSpecified - End Get - Set - Me.discountFieldSpecified = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property Freight() As TFreightCostsInv - Get - Return Me.freightField - End Get - Set - Me.freightField = Value - End Set - End Property - - Public Property Insurance() As TInsuranceCostsInv - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property transportNumber() As String - Get - Return Me.transportNumberField - End Get - Set - Me.transportNumberField = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property disposalDate() As Date - Get - Return Me.disposalDateField - End Get - Set - Me.disposalDateField = Value - End Set - End Property - - - Public Property disposalDateSpecified() As Boolean - Get - Return Me.disposalDateFieldSpecified - End Get - Set - Me.disposalDateFieldSpecified = Value - End Set - End Property - - Public Property timeLimit() As Date - Get - Return Me.timeLimitField - End Get - Set - Me.timeLimitField = Value - End Set - End Property - - - Public Property timeLimitSpecified() As Boolean - Get - Return Me.timeLimitFieldSpecified - End Get - Set - Me.timeLimitFieldSpecified = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Public Property billOfLading() As String - Get - Return Me.billOfLadingField - End Get - Set - Me.billOfLadingField = Value - End Set - End Property - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property buyer() As String - Get - Return Me.buyerField - End Get - Set - Me.buyerField = Value - End Set - End Property - - Public Property consignee() As String - Get - Return Me.consigneeField - End Get - Set - Me.consigneeField = Value - End Set - End Property - - Public Property PaymentInformation() As TImportPaymentInfo - Get - Return Me.paymentInformationField - End Get - Set - Me.paymentInformationField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property seller() As TAddress - Get - Return Me.sellerField - End Get - Set - Me.sellerField = Value - End Set - End Property - - Public Property exchangeRate() As Decimal - Get - Return Me.exchangeRateField - End Get - Set - Me.exchangeRateField = Value - End Set - End Property - - - Public Property exchangeRateSpecified() As Boolean - Get - Return Me.exchangeRateFieldSpecified - End Get - Set - Me.exchangeRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property ContainerInfo() As TContainer - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private containerIndicatorField As String - - Private containerNumberField As String - - Private containerTypeField As String - - Private containerLCLIndicatorField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerIndicator() As String - Get - Return Me.containerIndicatorField - End Get - Set - Me.containerIndicatorField = Value - End Set - End Property - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerType() As String - Get - Return Me.containerTypeField - End Get - Set - Me.containerTypeField = Value - End Set - End Property - - Public Property containerLCLIndicator() As String - Get - Return Me.containerLCLIndicatorField - End Get - Set - Me.containerLCLIndicatorField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoice - - Private invoiceNumberField As String - - Private invoiceVersionField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private invoiceHeadField As TInvoiceHead - - Private attributesField As List(Of TAttribute) - - Private documentsField As List(Of TDocument) - - Private partnersField As List(Of TPartner) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private intraField As TCustIntra - - Private invoiceLinesField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLinesField = New List(Of TInvoiceLine)() - Me.intraField = New TCustIntra() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.partnersField = New List(Of TPartner)() - Me.documentsField = New List(Of TDocument)() - Me.attributesField = New List(Of TAttribute)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property invoiceNumber() As String - Get - Return Me.invoiceNumberField - End Get - Set - Me.invoiceNumberField = Value - End Set - End Property - - Public Property invoiceVersion() As String - Get - Return Me.invoiceVersionField - End Get - Set - Me.invoiceVersionField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - Public Property Intra() As TCustIntra - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - - Public Property InvoiceLines() As List(Of TInvoiceLine) - Get - Return Me.invoiceLinesField - End Get - Set - Me.invoiceLinesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAtlasCompSumDEntry - - Private idTypeField As String - - Private quantityField As Long - - Private quantityFieldSpecified As Boolean - - Private packageTypeField As String - - Private registrationNumberField As String - - Private lineNumberField As Long - - Private lineNumberFieldSpecified As Boolean - - Private depositorField As String - - Private spoTypeField As String - - Private spoField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property idType() As String - Get - Return Me.idTypeField - End Get - Set - Me.idTypeField = Value - End Set - End Property - - Public Property quantity() As Long - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property lineNumber() As Long - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - - Public Property lineNumberSpecified() As Boolean - Get - Return Me.lineNumberFieldSpecified - End Get - Set - Me.lineNumberFieldSpecified = Value - End Set - End Property - - Public Property depositor() As String - Get - Return Me.depositorField - End Get - Set - Me.depositorField = Value - End Set - End Property - - Public Property spoType() As String - Get - Return Me.spoTypeField - End Get - Set - Me.spoTypeField = Value - End Set - End Property - - Public Property spo() As String - Get - Return Me.spoField - End Get - Set - Me.spoField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAtlasCompSumDEntry)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAtlasCompSumDEntry object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAtlasCompSumDEntry object - ''' - '''string workflow markup to deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAtlasCompSumDEntry - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAtlasCompSumDEntry) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAtlasCompSumDEntry 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAtlasCompSumDEntry object - ''' - '''string xml file to load and deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - 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 TAtlasCompSumDEntry) 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 TAtlasCompSumDEntry - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TGuarantee - - Private guaranteeNumberField As Long - - Private guaranteeNumberFieldSpecified As Boolean - - Private guaranteeCodeField As String - - Private guaranteeTypeField As String - - Private guaranteeAmountField As Decimal - - Private guaranteeAmountFieldSpecified As Boolean - - Private guaranteeCurrencyField As String - - Private guaranteeReferenceField As String - - Private guaranteeCustomsOfficeField As String - - Private localBaseField As Decimal - - Private localBaseFieldSpecified As Boolean - - Private factoringBaseField As String - - Private customsRateField As Decimal - - Private customsRateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property guaranteeNumber() As Long - Get - Return Me.guaranteeNumberField - End Get - Set - Me.guaranteeNumberField = Value - End Set - End Property - - - Public Property guaranteeNumberSpecified() As Boolean - Get - Return Me.guaranteeNumberFieldSpecified - End Get - Set - Me.guaranteeNumberFieldSpecified = Value - End Set - End Property - - Public Property guaranteeCode() As String - Get - Return Me.guaranteeCodeField - End Get - Set - Me.guaranteeCodeField = Value - End Set - End Property - - Public Property guaranteeType() As String - Get - Return Me.guaranteeTypeField - End Get - Set - Me.guaranteeTypeField = Value - End Set - End Property - - Public Property guaranteeAmount() As Decimal - Get - Return Me.guaranteeAmountField - End Get - Set - Me.guaranteeAmountField = Value - End Set - End Property - - - Public Property guaranteeAmountSpecified() As Boolean - Get - Return Me.guaranteeAmountFieldSpecified - End Get - Set - Me.guaranteeAmountFieldSpecified = Value - End Set - End Property - - Public Property guaranteeCurrency() As String - Get - Return Me.guaranteeCurrencyField - End Get - Set - Me.guaranteeCurrencyField = Value - End Set - End Property - - Public Property guaranteeReference() As String - Get - Return Me.guaranteeReferenceField - End Get - Set - Me.guaranteeReferenceField = Value - End Set - End Property - - Public Property guaranteeCustomsOffice() As String - Get - Return Me.guaranteeCustomsOfficeField - End Get - Set - Me.guaranteeCustomsOfficeField = Value - End Set - End Property - - Public Property localBase() As Decimal - Get - Return Me.localBaseField - End Get - Set - Me.localBaseField = Value - End Set - End Property - - - Public Property localBaseSpecified() As Boolean - Get - Return Me.localBaseFieldSpecified - End Get - Set - Me.localBaseFieldSpecified = Value - End Set - End Property - - Public Property factoringBase() As String - Get - Return Me.factoringBaseField - End Get - Set - Me.factoringBaseField = Value - End Set - End Property - - Public Property customsRate() As Decimal - Get - Return Me.customsRateField - End Get - Set - Me.customsRateField = Value - End Set - End Property - - - Public Property customsRateSpecified() As Boolean - Get - Return Me.customsRateFieldSpecified - End Get - Set - Me.customsRateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TGuarantee)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TGuarantee object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TGuarantee object - ''' - '''string workflow markup to deserialize - '''Output TGuarantee object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantee, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantee) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantee) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TGuarantee - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TGuarantee) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TGuarantee 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TGuarantee object - ''' - '''string xml file to load and deserialize - '''Output TGuarantee object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TGuarantee, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantee) - 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 TGuarantee) 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 TGuarantee - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TGuarantees - - Private guaranteeField As List(Of TGuarantee) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.guaranteeField = New List(Of TGuarantee)() - End Sub - - Public Property Guarantee() As List(Of TGuarantee) - Get - Return Me.guaranteeField - End Get - Set - Me.guaranteeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TGuarantees)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TGuarantees object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TGuarantees object - ''' - '''string workflow markup to deserialize - '''Output TGuarantees object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantees, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantees) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantees) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TGuarantees - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TGuarantees) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TGuarantees 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TGuarantees object - ''' - '''string xml file to load and deserialize - '''Output TGuarantees object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TGuarantees, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantees) - 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 TGuarantees) 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 TGuarantees - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeferAcc - - Private accountNumber1Field As String - - Private accountNumber2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property accountNumber1() As String - Get - Return Me.accountNumber1Field - End Get - Set - Me.accountNumber1Field = Value - End Set - End Property - - Public Property accountNumber2() As String - Get - Return Me.accountNumber2Field - End Get - Set - Me.accountNumber2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeferAcc)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeferAcc object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeferAcc object - ''' - '''string workflow markup to deserialize - '''Output TDeferAcc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAcc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAcc) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAcc) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeferAcc - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeferAcc) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDeferAcc 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDeferAcc object - ''' - '''string xml file to load and deserialize - '''Output TDeferAcc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeferAcc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAcc) - 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 TDeferAcc) 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 TDeferAcc - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeferAccs - - Private defermentAccountField As TDeferAcc - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.defermentAccountField = New TDeferAcc() - End Sub - - Public Property DefermentAccount() As TDeferAcc - Get - Return Me.defermentAccountField - End Get - Set - Me.defermentAccountField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeferAccs)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeferAccs object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeferAccs object - ''' - '''string workflow markup to deserialize - '''Output TDeferAccs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAccs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAccs) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAccs) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeferAccs - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeferAccs) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDeferAccs 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDeferAccs object - ''' - '''string xml file to load and deserialize - '''Output TDeferAccs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeferAccs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAccs) - 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 TDeferAccs) 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 TDeferAccs - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAuthHolder - - Private typeCodeField As String - - Private identifierField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property typeCode() As String - Get - Return Me.typeCodeField - End Get - Set - Me.typeCodeField = Value - End Set - End Property - - Public Property identifier() As String - Get - Return Me.identifierField - End Get - Set - Me.identifierField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAuthHolder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAuthHolder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAuthHolder object - ''' - '''string workflow markup to deserialize - '''Output TAuthHolder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAuthHolder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAuthHolder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAuthHolder 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAuthHolder object - ''' - '''string xml file to load and deserialize - '''Output TAuthHolder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAuthHolder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolder) - 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 TAuthHolder) 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 TAuthHolder - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAuthHolders - - Private authorisationHolderField As List(Of TAuthHolder) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.authorisationHolderField = New List(Of TAuthHolder)() - End Sub - - Public Property AuthorisationHolder() As List(Of TAuthHolder) - Get - Return Me.authorisationHolderField - End Get - Set - Me.authorisationHolderField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAuthHolders)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAuthHolders object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAuthHolders object - ''' - '''string workflow markup to deserialize - '''Output TAuthHolders object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolders, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolders) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolders) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAuthHolders - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAuthHolders) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAuthHolders 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAuthHolders object - ''' - '''string xml file to load and deserialize - '''Output TAuthHolders object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAuthHolders, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolders) - 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 TAuthHolders) 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 TAuthHolders - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCosts - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCosts object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCosts object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - 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 TInsuranceCosts) 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 TInsuranceCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCosts - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private frtInternationalAbsField As Decimal - - Private frtInternationalAbsFieldSpecified As Boolean - - Private frtIntCurrencyField As String - - Private frtCommunityAbsField As Decimal - - Private frtCommunityAbsFieldSpecified As Boolean - - Private frtCommunityCurrencyField As String - - Private frtNatAbsField As Decimal - - Private frtNatAbsFieldSpecified As Boolean - - Private frtNatCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Public Property frtInternationalAbs() As Decimal - Get - Return Me.frtInternationalAbsField - End Get - Set - Me.frtInternationalAbsField = Value - End Set - End Property - - - Public Property frtInternationalAbsSpecified() As Boolean - Get - Return Me.frtInternationalAbsFieldSpecified - End Get - Set - Me.frtInternationalAbsFieldSpecified = Value - End Set - End Property - - Public Property frtIntCurrency() As String - Get - Return Me.frtIntCurrencyField - End Get - Set - Me.frtIntCurrencyField = Value - End Set - End Property - - Public Property frtCommunityAbs() As Decimal - Get - Return Me.frtCommunityAbsField - End Get - Set - Me.frtCommunityAbsField = Value - End Set - End Property - - - Public Property frtCommunityAbsSpecified() As Boolean - Get - Return Me.frtCommunityAbsFieldSpecified - End Get - Set - Me.frtCommunityAbsFieldSpecified = Value - End Set - End Property - - Public Property frtCommunityCurrency() As String - Get - Return Me.frtCommunityCurrencyField - End Get - Set - Me.frtCommunityCurrencyField = Value - End Set - End Property - - Public Property frtNatAbs() As Decimal - Get - Return Me.frtNatAbsField - End Get - Set - Me.frtNatAbsField = Value - End Set - End Property - - - Public Property frtNatAbsSpecified() As Boolean - Get - Return Me.frtNatAbsFieldSpecified - End Get - Set - Me.frtNatAbsFieldSpecified = Value - End Set - End Property - - Public Property frtNatCurrency() As String - Get - Return Me.frtNatCurrencyField - End Get - Set - Me.frtNatCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCosts object - ''' - '''string workflow markup to deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCosts object - ''' - '''string xml file to load and deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - 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 TFreightCosts) 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 TFreightCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motModeField As String - - Private meansOfTransportField As String - - Private motCountryField As String - - Private motVehicleField As String - - Private meansOfTransportDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property motMode() As String - Get - Return Me.motModeField - End Get - Set - Me.motModeField = Value - End Set - End Property - - Public Property meansOfTransport() As String - Get - Return Me.meansOfTransportField - End Get - Set - Me.meansOfTransportField = Value - End Set - End Property - - Public Property motCountry() As String - Get - Return Me.motCountryField - End Get - Set - Me.motCountryField = Value - End Set - End Property - - Public Property motVehicle() As String - Get - Return Me.motVehicleField - End Get - Set - Me.motVehicleField = Value - End Set - End Property - - Public Property meansOfTransportDescription() As String - Get - Return Me.meansOfTransportDescriptionField - End Get - Set - Me.meansOfTransportDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.Designer.vb deleted file mode 100644 index d7c67086..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.Designer.vb +++ /dev/null @@ -1,1199 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicErrorWarningMessageListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicErrorWarningMessage - - Partial Public Class ErrorMessages - - Private errorMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.errorMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property ErrorMessage() As List(Of TErrorMessageType) - Get - Return Me.errorMessageField - End Get - Set - Me.errorMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ErrorMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ErrorMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ErrorMessages object - ''' - '''string workflow markup to deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ErrorMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ErrorMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ErrorMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorMessageType - - Private moduleField As String - - Private processField As String - - Private errorCodeField As String - - Private errorDescField As String - - Private referenceField As TReference - - Private detailsField As TErrorDetail - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.detailsField = New TErrorDetail() - Me.referenceField = New TReference() - End Sub - - Public Property [module]() As String - Get - Return Me.moduleField - End Get - Set - Me.moduleField = Value - End Set - End Property - - Public Property process() As String - Get - Return Me.processField - End Get - Set - Me.processField = Value - End Set - End Property - - Public Property errorCode() As String - Get - Return Me.errorCodeField - End Get - Set - Me.errorCodeField = Value - End Set - End Property - - Public Property errorDesc() As String - Get - Return Me.errorDescField - End Get - Set - Me.errorDescField = Value - End Set - End Property - - Public Property Reference() As TReference - Get - Return Me.referenceField - End Get - Set - Me.referenceField = Value - End Set - End Property - - Public Property Details() As TErrorDetail - Get - Return Me.detailsField - End Get - Set - Me.detailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorMessageType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorMessageType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorMessageType object - ''' - '''string workflow markup to deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorMessageType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorMessageType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorMessageType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReference - - Private companyField As String - - Private plantField As String - - Private correlationIdField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private userField As String - - Private partnerIdField As String - - Private routeIdField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Public Property user() As String - Get - Return Me.userField - End Get - Set - Me.userField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property routeId() As String - Get - Return Me.routeIdField - End Get - Set - Me.routeIdField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReference object - ''' - '''string workflow markup to deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetail - - Private timestampField As Date - - Private stackTraceField As String - - Private additionalDetailsField As List(Of TErrorDetailAdditionalDetails) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.additionalDetailsField = New List(Of TErrorDetailAdditionalDetails)() - End Sub - - Public Property timestamp() As Date - Get - Return Me.timestampField - End Get - Set - Me.timestampField = Value - End Set - End Property - - Public Property stackTrace() As String - Get - Return Me.stackTraceField - End Get - Set - Me.stackTraceField = Value - End Set - End Property - - Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails) - Get - Return Me.additionalDetailsField - End Get - Set - Me.additionalDetailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetail object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetailAdditionalDetails - - Private typeField As String - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetailAdditionalDetails)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetailAdditionalDetails object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetailAdditionalDetails object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetailAdditionalDetails) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetailAdditionalDetails - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class WarningMessages - - Private warningMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.warningMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property WarningMessage() As List(Of TErrorMessageType) - Get - Return Me.warningMessageField - End Get - Set - Me.warningMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(WarningMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current WarningMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an WarningMessages object - ''' - '''string workflow markup to deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, WarningMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As WarningMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), WarningMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.xsd deleted file mode 100644 index 6388a3d7..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicErrorWarningMessage.xsd +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - 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/MicMetaCustExportShipment.designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.designer.vb deleted file mode 100644 index 1ce99a56..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.designer.vb +++ /dev/null @@ -1,15841 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MIC_EXPORTListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MIC_EXPORT - - Partial Public Class ExportShipment - - Private shipmentHeadField As TShipmentHead - - Private invoicesField As List(Of TInvoice) - - Private packagesField As List(Of TPackage) - - Private schemaVersionField As Decimal - - Private schemaVersionFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packagesField = New List(Of TPackage)() - Me.invoicesField = New List(Of TInvoice)() - Me.shipmentHeadField = New TShipmentHead() - End Sub - - Public Property ShipmentHead() As TShipmentHead - Get - Return Me.shipmentHeadField - End Get - Set - Me.shipmentHeadField = Value - End Set - End Property - - Public Property Invoices() As List(Of TInvoice) - Get - Return Me.invoicesField - End Get - Set - Me.invoicesField = Value - End Set - End Property - - Public Property Packages() As List(Of TPackage) - Get - Return Me.packagesField - End Get - Set - Me.packagesField = Value - End Set - End Property - - Public Property schemaVersion() As Decimal - Get - Return Me.schemaVersionField - End Get - Set - Me.schemaVersionField = Value - End Set - End Property - - - Public Property schemaVersionSpecified() As Boolean - Get - Return Me.schemaVersionFieldSpecified - End Get - Set - Me.schemaVersionFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ExportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ExportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ExportShipment object - ''' - '''string workflow markup to deserialize - '''Output ExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ExportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ExportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ExportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ExportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ExportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHead - - Private companyField As String - - Private plantField As String - - Private shipmentIdField As String - - Private shipmentIdPartField As String - - Private shipmentTypeField As String - - Private mrnField As String - - Private deliveryDateField As Date - - Private deliveryDateFieldSpecified As Boolean - - Private codField As String - - Private exportCountryField As String - - Private contCodeField As ContainerCode - - Private contCodeFieldSpecified As Boolean - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private dateStartPackField As Date - - Private dateStartPackFieldSpecified As Boolean - - Private dateEndPackField As Date - - Private dateEndPackFieldSpecified As Boolean - - Private partyConstField As String - - Private consigneeEndUserFlagField As String - - Private endUserInEamField As TShipmentHeadEndUserInEam - - Private endUserInEamFieldSpecified As Boolean - - Private estimatedArrivalDateField As Date - - Private estimatedArrivalDateFieldSpecified As Boolean - - Private nctsIndicatorField As Boolean - - Private nctsIndicatorFieldSpecified As Boolean - - Private motInlField As TMotInl - - Private textField As List(Of String) - - Private partnersField As List(Of TPartner) - - Private locGoodsField As TLocationOfGoods - - Private officeDepartField As TCustomsOffice - - Private officeBorderField As TCustomsOffice - - Private motBorderField As TMot - - Private sealsField As List(Of TSeal) - - Private declTypeField As TDeclType - - Private placeDestField As String - - Private authLocationField As String - - Private declPlaceField As String - - Private agreedLocationOfGoodsCdField As String - - Private agreedLocationOfGoodsField As String - - Private custSubPlaceField As String - - Private codFirstField As String - - Private officeDestField As TCustomsOffice - - Private carrierField As String - - Private containersField As List(Of TContainer) - - Private freightCostField As TFreight - - Private addCostsField As List(Of TAddCosts) - - Private assurCostField As TAssurance - - Private groupIDField As String - - Private documentsField As List(Of TDocuments) - - Private regNoExtField As String - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private coeField As String - - Private specCircumField As String - - Private carriageCostsField As String - - Private shipmentIdentificationField As String - - Private conveyRefNrField As String - - Private unloadingPlaceField As String - - Private routeField As List(Of TRoute) - - Private expressField As String - - Private routeNameField As String - - Private authorisationNoField As String - - Private authorisationField As TShipmentHeadAuthorisation - - Private postExportDeclarationField As TShipmentHeadPostExportDeclaration - - Private oprDataField As TShipmentHeadOprData - - Private additionalInformationField As List(Of TAttribute) - - Private stateOfAffairsField As List(Of String) - - Private erpDataField As TErpShipmentData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.erpDataField = New TErpShipmentData() - Me.stateOfAffairsField = New List(Of String)() - Me.additionalInformationField = New List(Of TAttribute)() - Me.oprDataField = New TShipmentHeadOprData() - Me.postExportDeclarationField = New TShipmentHeadPostExportDeclaration() - Me.authorisationField = New TShipmentHeadAuthorisation() - Me.routeField = New List(Of TRoute)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.documentsField = New List(Of TDocuments)() - Me.assurCostField = New TAssurance() - Me.addCostsField = New List(Of TAddCosts)() - Me.freightCostField = New TFreight() - Me.containersField = New List(Of TContainer)() - Me.officeDestField = New TCustomsOffice() - Me.declTypeField = New TDeclType() - Me.sealsField = New List(Of TSeal)() - Me.motBorderField = New TMot() - Me.officeBorderField = New TCustomsOffice() - Me.officeDepartField = New TCustomsOffice() - Me.locGoodsField = New TLocationOfGoods() - Me.partnersField = New List(Of TPartner)() - Me.textField = New List(Of String)() - Me.motInlField = New TMotInl() - End Sub - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property shipmentId() As String - Get - Return Me.shipmentIdField - End Get - Set - Me.shipmentIdField = Value - End Set - End Property - - Public Property shipmentIdPart() As String - Get - Return Me.shipmentIdPartField - End Get - Set - Me.shipmentIdPartField = Value - End Set - End Property - - Public Property shipmentType() As String - Get - Return Me.shipmentTypeField - End Get - Set - Me.shipmentTypeField = Value - End Set - End Property - - Public Property mrn() As String - Get - Return Me.mrnField - End Get - Set - Me.mrnField = Value - End Set - End Property - - Public Property deliveryDate() As Date - Get - Return Me.deliveryDateField - End Get - Set - Me.deliveryDateField = Value - End Set - End Property - - - Public Property deliveryDateSpecified() As Boolean - Get - Return Me.deliveryDateFieldSpecified - End Get - Set - Me.deliveryDateFieldSpecified = Value - End Set - End Property - - Public Property cod() As String - Get - Return Me.codField - End Get - Set - Me.codField = Value - End Set - End Property - - Public Property exportCountry() As String - Get - Return Me.exportCountryField - End Get - Set - Me.exportCountryField = Value - End Set - End Property - - Public Property contCode() As ContainerCode - Get - Return Me.contCodeField - End Get - Set - Me.contCodeField = Value - End Set - End Property - - - Public Property contCodeSpecified() As Boolean - Get - Return Me.contCodeFieldSpecified - End Get - Set - Me.contCodeFieldSpecified = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property dateStartPack() As Date - Get - Return Me.dateStartPackField - End Get - Set - Me.dateStartPackField = Value - End Set - End Property - - - Public Property dateStartPackSpecified() As Boolean - Get - Return Me.dateStartPackFieldSpecified - End Get - Set - Me.dateStartPackFieldSpecified = Value - End Set - End Property - - Public Property dateEndPack() As Date - Get - Return Me.dateEndPackField - End Get - Set - Me.dateEndPackField = Value - End Set - End Property - - - Public Property dateEndPackSpecified() As Boolean - Get - Return Me.dateEndPackFieldSpecified - End Get - Set - Me.dateEndPackFieldSpecified = Value - End Set - End Property - - Public Property partyConst() As String - Get - Return Me.partyConstField - End Get - Set - Me.partyConstField = Value - End Set - End Property - - Public Property consigneeEndUserFlag() As String - Get - Return Me.consigneeEndUserFlagField - End Get - Set - Me.consigneeEndUserFlagField = Value - End Set - End Property - - Public Property endUserInEam() As TShipmentHeadEndUserInEam - Get - Return Me.endUserInEamField - End Get - Set - Me.endUserInEamField = Value - End Set - End Property - - - Public Property endUserInEamSpecified() As Boolean - Get - Return Me.endUserInEamFieldSpecified - End Get - Set - Me.endUserInEamFieldSpecified = Value - End Set - End Property - - Public Property estimatedArrivalDate() As Date - Get - Return Me.estimatedArrivalDateField - End Get - Set - Me.estimatedArrivalDateField = Value - End Set - End Property - - - Public Property estimatedArrivalDateSpecified() As Boolean - Get - Return Me.estimatedArrivalDateFieldSpecified - End Get - Set - Me.estimatedArrivalDateFieldSpecified = Value - End Set - End Property - - Public Property nctsIndicator() As Boolean - Get - Return Me.nctsIndicatorField - End Get - Set - Me.nctsIndicatorField = Value - End Set - End Property - - - Public Property nctsIndicatorSpecified() As Boolean - Get - Return Me.nctsIndicatorFieldSpecified - End Get - Set - Me.nctsIndicatorFieldSpecified = Value - End Set - End Property - - Public Property motInl() As TMotInl - Get - Return Me.motInlField - End Get - Set - Me.motInlField = Value - End Set - End Property - - Public Property text() As List(Of String) - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - Public Property locGoods() As TLocationOfGoods - Get - Return Me.locGoodsField - End Get - Set - Me.locGoodsField = Value - End Set - End Property - - Public Property officeDepart() As TCustomsOffice - Get - Return Me.officeDepartField - End Get - Set - Me.officeDepartField = Value - End Set - End Property - - Public Property officeBorder() As TCustomsOffice - Get - Return Me.officeBorderField - End Get - Set - Me.officeBorderField = Value - End Set - End Property - - Public Property motBorder() As TMot - Get - Return Me.motBorderField - End Get - Set - Me.motBorderField = Value - End Set - End Property - - Public Property seals() As List(Of TSeal) - Get - Return Me.sealsField - End Get - Set - Me.sealsField = Value - End Set - End Property - - Public Property declType() As TDeclType - Get - Return Me.declTypeField - End Get - Set - Me.declTypeField = Value - End Set - End Property - - Public Property placeDest() As String - Get - Return Me.placeDestField - End Get - Set - Me.placeDestField = Value - End Set - End Property - - Public Property authLocation() As String - Get - Return Me.authLocationField - End Get - Set - Me.authLocationField = Value - End Set - End Property - - Public Property declPlace() As String - Get - Return Me.declPlaceField - End Get - Set - Me.declPlaceField = Value - End Set - End Property - - Public Property agreedLocationOfGoodsCd() As String - Get - Return Me.agreedLocationOfGoodsCdField - End Get - Set - Me.agreedLocationOfGoodsCdField = Value - End Set - End Property - - Public Property agreedLocationOfGoods() As String - Get - Return Me.agreedLocationOfGoodsField - End Get - Set - Me.agreedLocationOfGoodsField = Value - End Set - End Property - - Public Property custSubPlace() As String - Get - Return Me.custSubPlaceField - End Get - Set - Me.custSubPlaceField = Value - End Set - End Property - - Public Property codFirst() As String - Get - Return Me.codFirstField - End Get - Set - Me.codFirstField = Value - End Set - End Property - - Public Property officeDest() As TCustomsOffice - Get - Return Me.officeDestField - End Get - Set - Me.officeDestField = Value - End Set - End Property - - Public Property carrier() As String - Get - Return Me.carrierField - End Get - Set - Me.carrierField = Value - End Set - End Property - - Public Property containers() As List(Of TContainer) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - Public Property freightCost() As TFreight - Get - Return Me.freightCostField - End Get - Set - Me.freightCostField = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property assurCost() As TAssurance - Get - Return Me.assurCostField - End Get - Set - Me.assurCostField = Value - End Set - End Property - - Public Property groupID() As String - Get - Return Me.groupIDField - End Get - Set - Me.groupIDField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property regNoExt() As String - Get - Return Me.regNoExtField - End Get - Set - Me.regNoExtField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - Public Property coe() As String - Get - Return Me.coeField - End Get - Set - Me.coeField = Value - End Set - End Property - - Public Property specCircum() As String - Get - Return Me.specCircumField - End Get - Set - Me.specCircumField = Value - End Set - End Property - - Public Property carriageCosts() As String - Get - Return Me.carriageCostsField - End Get - Set - Me.carriageCostsField = Value - End Set - End Property - - Public Property shipmentIdentification() As String - Get - Return Me.shipmentIdentificationField - End Get - Set - Me.shipmentIdentificationField = Value - End Set - End Property - - Public Property conveyRefNr() As String - Get - Return Me.conveyRefNrField - End Get - Set - Me.conveyRefNrField = Value - End Set - End Property - - Public Property unloadingPlace() As String - Get - Return Me.unloadingPlaceField - End Get - Set - Me.unloadingPlaceField = Value - End Set - End Property - - Public Property route() As List(Of TRoute) - Get - Return Me.routeField - End Get - Set - Me.routeField = Value - End Set - End Property - - Public Property express() As String - Get - Return Me.expressField - End Get - Set - Me.expressField = Value - End Set - End Property - - Public Property routeName() As String - Get - Return Me.routeNameField - End Get - Set - Me.routeNameField = Value - End Set - End Property - - Public Property authorisationNo() As String - Get - Return Me.authorisationNoField - End Get - Set - Me.authorisationNoField = Value - End Set - End Property - - Public Property authorisation() As TShipmentHeadAuthorisation - Get - Return Me.authorisationField - End Get - Set - Me.authorisationField = Value - End Set - End Property - - Public Property postExportDeclaration() As TShipmentHeadPostExportDeclaration - Get - Return Me.postExportDeclarationField - End Get - Set - Me.postExportDeclarationField = Value - End Set - End Property - - Public Property oprData() As TShipmentHeadOprData - Get - Return Me.oprDataField - End Get - Set - Me.oprDataField = Value - End Set - End Property - - Public Property additionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - - Public Property stateOfAffairs() As List(Of String) - Get - Return Me.stateOfAffairsField - End Get - Set - Me.stateOfAffairsField = Value - End Set - End Property - - Public Property erpData() As TErpShipmentData - Get - Return Me.erpDataField - End Get - Set - Me.erpDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHead object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum ContainerCode - - ''' - - Item1 - - ''' - - Item0 - End Enum - - Public Enum TShipmentHeadEndUserInEam - - ''' - - Item - - ''' - - Item0 - - ''' - - Item1 - End Enum - - Partial Public Class TMotInl - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMotInl)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMotInl object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMotInl object - ''' - '''string workflow markup to deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMotInl) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMotInl) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMotInl - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMotInl) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMotInl object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageLine - - Private invNoField As String - - Private invPosField As String - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private itemQuantityField As Long - - Private itemQuantityFieldSpecified As Boolean - - Private itemUnitField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property invNo() As String - Get - Return Me.invNoField - End Get - Set - Me.invNoField = Value - End Set - End Property - - Public Property invPos() As String - Get - Return Me.invPosField - End Get - Set - Me.invPosField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property itemQuantity() As Long - Get - Return Me.itemQuantityField - End Get - Set - Me.itemQuantityField = Value - End Set - End Property - - - Public Property itemQuantitySpecified() As Boolean - Get - Return Me.itemQuantityFieldSpecified - End Get - Set - Me.itemQuantityFieldSpecified = Value - End Set - End Property - - Public Property itemUnit() As String - Get - Return Me.itemUnitField - End Get - Set - Me.itemUnitField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageLine object - ''' - '''string workflow markup to deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageHead - - Private packageNoField As String - - Private pTypeField As String - - Private unitField As String - - Private packageNoExtField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private taraField As Decimal - - Private taraFieldSpecified As Boolean - - Private unitWeightField As String - - Private volumeField As Decimal - - Private volumeFieldSpecified As Boolean - - Private grossVolumeField As Decimal - - Private grossVolumeFieldSpecified As Boolean - - Private netVolumeField As Decimal - - Private netVolumeFieldSpecified As Boolean - - Private unitVolumeField As String - - Private lengthField As Decimal - - Private lengthFieldSpecified As Boolean - - Private widthField As Decimal - - Private widthFieldSpecified As Boolean - - Private heightField As Decimal - - Private heightFieldSpecified As Boolean - - Private unitlwhField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageNo() As String - Get - Return Me.packageNoField - End Get - Set - Me.packageNoField = Value - End Set - End Property - - Public Property pType() As String - Get - Return Me.pTypeField - End Get - Set - Me.pTypeField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property packageNoExt() As String - Get - Return Me.packageNoExtField - End Get - Set - Me.packageNoExtField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property tara() As Decimal - Get - Return Me.taraField - End Get - Set - Me.taraField = Value - End Set - End Property - - - Public Property taraSpecified() As Boolean - Get - Return Me.taraFieldSpecified - End Get - Set - Me.taraFieldSpecified = Value - End Set - End Property - - Public Property unitWeight() As String - Get - Return Me.unitWeightField - End Get - Set - Me.unitWeightField = Value - End Set - End Property - - Public Property volume() As Decimal - Get - Return Me.volumeField - End Get - Set - Me.volumeField = Value - End Set - End Property - - - Public Property volumeSpecified() As Boolean - Get - Return Me.volumeFieldSpecified - End Get - Set - Me.volumeFieldSpecified = Value - End Set - End Property - - Public Property grossVolume() As Decimal - Get - Return Me.grossVolumeField - End Get - Set - Me.grossVolumeField = Value - End Set - End Property - - - Public Property grossVolumeSpecified() As Boolean - Get - Return Me.grossVolumeFieldSpecified - End Get - Set - Me.grossVolumeFieldSpecified = Value - End Set - End Property - - Public Property netVolume() As Decimal - Get - Return Me.netVolumeField - End Get - Set - Me.netVolumeField = Value - End Set - End Property - - - Public Property netVolumeSpecified() As Boolean - Get - Return Me.netVolumeFieldSpecified - End Get - Set - Me.netVolumeFieldSpecified = Value - End Set - End Property - - Public Property unitVolume() As String - Get - Return Me.unitVolumeField - End Get - Set - Me.unitVolumeField = Value - End Set - End Property - - Public Property length() As Decimal - Get - Return Me.lengthField - End Get - Set - Me.lengthField = Value - End Set - End Property - - - Public Property lengthSpecified() As Boolean - Get - Return Me.lengthFieldSpecified - End Get - Set - Me.lengthFieldSpecified = Value - End Set - End Property - - Public Property width() As Decimal - Get - Return Me.widthField - End Get - Set - Me.widthField = Value - End Set - End Property - - - Public Property widthSpecified() As Boolean - Get - Return Me.widthFieldSpecified - End Get - Set - Me.widthFieldSpecified = Value - End Set - End Property - - Public Property height() As Decimal - Get - Return Me.heightField - End Get - Set - Me.heightField = Value - End Set - End Property - - - Public Property heightSpecified() As Boolean - Get - Return Me.heightFieldSpecified - End Get - Set - Me.heightFieldSpecified = Value - End Set - End Property - - Public Property unitlwh() As String - Get - Return Me.unitlwhField - End Get - Set - Me.unitlwhField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageHead object - ''' - '''string workflow markup to deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackageHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageHeadField As TPackageHead - - Private packageLineField As List(Of TPackageLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageLineField = New List(Of TPackageLine)() - Me.packageHeadField = New TPackageHead() - End Sub - - Public Property packageHead() As TPackageHead - Get - Return Me.packageHeadField - End Get - Set - Me.packageHeadField = Value - End Set - End Property - - Public Property packageLine() As List(Of TPackageLine) - Get - Return Me.packageLineField - End Get - Set - Me.packageLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpLineData - - Private legalRegulationField As String - - Private exportControlClassField As String - - Private embargoField As String - - Private licenseTypeField As String - - Private licenseNumberField As String - - Private profitCenterField As String - - Private vZTAField As String - - Private erpInvoicelinenumberField As String - - Private erpPartnumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property legalRegulation() As String - Get - Return Me.legalRegulationField - End Get - Set - Me.legalRegulationField = Value - End Set - End Property - - Public Property exportControlClass() As String - Get - Return Me.exportControlClassField - End Get - Set - Me.exportControlClassField = Value - End Set - End Property - - Public Property embargo() As String - Get - Return Me.embargoField - End Get - Set - Me.embargoField = Value - End Set - End Property - - Public Property licenseType() As String - Get - Return Me.licenseTypeField - End Get - Set - Me.licenseTypeField = Value - End Set - End Property - - Public Property licenseNumber() As String - Get - Return Me.licenseNumberField - End Get - Set - Me.licenseNumberField = Value - End Set - End Property - - Public Property profitCenter() As String - Get - Return Me.profitCenterField - End Get - Set - Me.profitCenterField = Value - End Set - End Property - - Public Property vZTA() As String - Get - Return Me.vZTAField - End Get - Set - Me.vZTAField = Value - End Set - End Property - - Public Property erpInvoicelinenumber() As String - Get - Return Me.erpInvoicelinenumberField - End Get - Set - Me.erpInvoicelinenumberField = Value - End Set - End Property - - Public Property erpPartnumber() As String - Get - Return Me.erpPartnumberField - End Get - Set - Me.erpPartnumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpLineData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpLineData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpLineData object - ''' - '''string workflow markup to deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpLineData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpLineData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpLineData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpLineData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpLineData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRegInfo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private referenceNumber1Field As String - - Private referenceNumber2Field As String - - Private referenceNumber3Field As String - - Private registrationDateField As Date - - Private registrationDateFieldSpecified As Boolean - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private releaseDateField As Date - - Private releaseDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property referenceNumber1() As String - Get - Return Me.referenceNumber1Field - End Get - Set - Me.referenceNumber1Field = Value - End Set - End Property - - Public Property referenceNumber2() As String - Get - Return Me.referenceNumber2Field - End Get - Set - Me.referenceNumber2Field = Value - End Set - End Property - - Public Property referenceNumber3() As String - Get - Return Me.referenceNumber3Field - End Get - Set - Me.referenceNumber3Field = Value - End Set - End Property - - Public Property registrationDate() As Date - Get - Return Me.registrationDateField - End Get - Set - Me.registrationDateField = Value - End Set - End Property - - - Public Property registrationDateSpecified() As Boolean - Get - Return Me.registrationDateFieldSpecified - End Get - Set - Me.registrationDateFieldSpecified = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property releaseDate() As Date - Get - Return Me.releaseDateField - End Get - Set - Me.releaseDateField = Value - End Set - End Property - - - Public Property releaseDateSpecified() As Boolean - Get - Return Me.releaseDateFieldSpecified - End Get - Set - Me.releaseDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRegInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRegInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRegInfo object - ''' - '''string workflow markup to deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRegInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRegInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRegInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRegInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRegInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportQuantity - - Private qualifierField As String - - Private unitField As String - - Private valueField As Decimal - - Private valueFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property qualifier() As String - Get - Return Me.qualifierField - End Get - Set - Me.qualifierField = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - - Public Property valueSpecified() As Boolean - Get - Return Me.valueFieldSpecified - End Get - Set - Me.valueFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportQuantity)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportQuantity object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportQuantity object - ''' - '''string workflow markup to deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportQuantity) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportQuantity) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportQuantity - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportQuantity) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportQuantity object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportReference - - Private typeField As String - - Private authNrField As String - - Private impShpNrField As String - - Private lineNoField As String - - Private authRegistryNoField As String - - Private commCodeField As String - - Private usualTreatmentField As String - - Private importAtlasField As String - - Private addInfoField As String - - Private quantityField As TImportQuantity - - Private tradeQuantityField As TImportQuantity - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tradeQuantityField = New TImportQuantity() - Me.quantityField = New TImportQuantity() - End Sub - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property authNr() As String - Get - Return Me.authNrField - End Get - Set - Me.authNrField = Value - End Set - End Property - - Public Property impShpNr() As String - Get - Return Me.impShpNrField - End Get - Set - Me.impShpNrField = Value - End Set - End Property - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property authRegistryNo() As String - Get - Return Me.authRegistryNoField - End Get - Set - Me.authRegistryNoField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property usualTreatment() As String - Get - Return Me.usualTreatmentField - End Get - Set - Me.usualTreatmentField = Value - End Set - End Property - - Public Property importAtlas() As String - Get - Return Me.importAtlasField - End Get - Set - Me.importAtlasField = Value - End Set - End Property - - Public Property addInfo() As String - Get - Return Me.addInfoField - End Get - Set - Me.addInfoField = Value - End Set - End Property - - Public Property quantity() As TImportQuantity - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property tradeQuantity() As TImportQuantity - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportReference object - ''' - '''string workflow markup to deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TImportReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBomNo - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBomNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBomNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBomNo object - ''' - '''string workflow markup to deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBomNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBomNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBomNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBomNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TBomNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOrder - - Private ordNoField As String - - Private ordDateField As Date - - Private ordDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ordNo() As String - Get - Return Me.ordNoField - End Get - Set - Me.ordNoField = Value - End Set - End Property - - Public Property ordDate() As Date - Get - Return Me.ordDateField - End Get - Set - Me.ordDateField = Value - End Set - End Property - - - Public Property ordDateSpecified() As Boolean - Get - Return Me.ordDateFieldSpecified - End Get - Set - Me.ordDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOrder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOrder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOrder object - ''' - '''string workflow markup to deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOrder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOrder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOrder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOrder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TOrder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelNote - - Private delNoField As String - - Private positionField As Long - - Private positionFieldSpecified As Boolean - - Private delDateField As Date - - Private delDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property delNo() As String - Get - Return Me.delNoField - End Get - Set - Me.delNoField = Value - End Set - End Property - - Public Property position() As Long - Get - Return Me.positionField - End Get - Set - Me.positionField = Value - End Set - End Property - - - Public Property positionSpecified() As Boolean - Get - Return Me.positionFieldSpecified - End Get - Set - Me.positionFieldSpecified = Value - End Set - End Property - - Public Property delDate() As Date - Get - Return Me.delDateField - End Get - Set - Me.delDateField = Value - End Set - End Property - - - Public Property delDateSpecified() As Boolean - Get - Return Me.delDateFieldSpecified - End Get - Set - Me.delDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelNote)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelNote object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelNote object - ''' - '''string workflow markup to deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelNote) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelNote) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelNote - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelNote) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelNote object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private itemNoField As String - - Private itemDescField As String - - Private commCodeField As String - - Private prodGrField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property itemNo() As String - Get - Return Me.itemNoField - End Get - Set - Me.itemNoField = Value - End Set - End Property - - Public Property itemDesc() As String - Get - Return Me.itemDescField - End Get - Set - Me.itemDescField = Value - End Set - End Property - - Public Property commCode() As String - Get - Return Me.commCodeField - End Get - Set - Me.commCodeField = Value - End Set - End Property - - Public Property prodGr() As String - Get - Return Me.prodGrField - End Get - Set - Me.prodGrField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreviousDocument - - Private docTypeField As String - - Private docNoField As String - - Private docAddTextField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreviousDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreviousDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreviousDocument object - ''' - '''string workflow markup to deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreviousDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreviousDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreviousDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreviousDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPreviousDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNoField As String - - Private unitPriceField As Decimal - - Private unitPriceFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private statQuantField As Decimal - - Private statQuantFieldSpecified As Boolean - - Private statUnitField As String - - Private statValField As Decimal - - Private statValFieldSpecified As Boolean - - Private custProcField As String - - Private eUCodeField As String - - Private statCodeField As String - - Private transTypeField As String - - Private cooField As String - - Private cooStateField As String - - Private addTextField As List(Of String) - - Private prevDocField As List(Of TPreviousDocument) - - Private itemField As TItem - - Private documentsField As List(Of TDocuments) - - Private delTermField As TInvoiceLineDelTerm - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private unitField As String - - Private delnoteField As TDelNote - - Private orderField As TOrder - - Private itemRefField As String - - Private addCostsField As List(Of TAddCosts) - - Private addCodeField As List(Of String) - - Private natCodeField As List(Of String) - - Private stockTypeAddField As String - - Private stockTypeDedField As String - - Private bomField As TBomNo - - Private accountNoField As String - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containersField As List(Of TContainer) - - Private shipmentIdentificationField As String - - Private uNDGField As String - - Private consigneeEndUserFlagField As String - - Private endUserInEamField As TInvoiceLineEndUserInEam - - Private endUserInEamFieldSpecified As Boolean - - Private carriageCostsField As String - - Private shipToField As TInvoiceLineShipTo - - Private endUserField As TInvoiceLineEndUser - - Private importReferenceField As List(Of TImportReference) - - Private registrationInfoField As TRegInfo - - Private serialNoField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private modelField As String - - Private brandField As String - - Private addedValueField As Decimal - - Private addedValueFieldSpecified As Boolean - - Private ctoIdField As String - - Private infoText2Field As String - - Private branchNoField As String - - Private additionalInformationField As List(Of TAttribute) - - Private trackingNumberField As String - - Private erpDataField As TErpLineData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.erpDataField = New TErpLineData() - Me.additionalInformationField = New List(Of TAttribute)() - Me.registrationInfoField = New TRegInfo() - Me.importReferenceField = New List(Of TImportReference)() - Me.endUserField = New TInvoiceLineEndUser() - Me.shipToField = New TInvoiceLineShipTo() - Me.containersField = New List(Of TContainer)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.bomField = New TBomNo() - Me.natCodeField = New List(Of String)() - Me.addCodeField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.orderField = New TOrder() - Me.delnoteField = New TDelNote() - Me.delTermField = New TInvoiceLineDelTerm() - Me.documentsField = New List(Of TDocuments)() - Me.itemField = New TItem() - Me.prevDocField = New List(Of TPreviousDocument)() - Me.addTextField = New List(Of String)() - End Sub - - Public Property lineNo() As String - Get - Return Me.lineNoField - End Get - Set - Me.lineNoField = Value - End Set - End Property - - Public Property unitPrice() As Decimal - Get - Return Me.unitPriceField - End Get - Set - Me.unitPriceField = Value - End Set - End Property - - - Public Property unitPriceSpecified() As Boolean - Get - Return Me.unitPriceFieldSpecified - End Get - Set - Me.unitPriceFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property statQuant() As Decimal - Get - Return Me.statQuantField - End Get - Set - Me.statQuantField = Value - End Set - End Property - - - Public Property statQuantSpecified() As Boolean - Get - Return Me.statQuantFieldSpecified - End Get - Set - Me.statQuantFieldSpecified = Value - End Set - End Property - - Public Property statUnit() As String - Get - Return Me.statUnitField - End Get - Set - Me.statUnitField = Value - End Set - End Property - - Public Property statVal() As Decimal - Get - Return Me.statValField - End Get - Set - Me.statValField = Value - End Set - End Property - - - Public Property statValSpecified() As Boolean - Get - Return Me.statValFieldSpecified - End Get - Set - Me.statValFieldSpecified = Value - End Set - End Property - - Public Property custProc() As String - Get - Return Me.custProcField - End Get - Set - Me.custProcField = Value - End Set - End Property - - Public Property EUCode() As String - Get - Return Me.eUCodeField - End Get - Set - Me.eUCodeField = Value - End Set - End Property - - Public Property statCode() As String - Get - Return Me.statCodeField - End Get - Set - Me.statCodeField = Value - End Set - End Property - - Public Property transType() As String - Get - Return Me.transTypeField - End Get - Set - Me.transTypeField = Value - End Set - End Property - - Public Property coo() As String - Get - Return Me.cooField - End Get - Set - Me.cooField = Value - End Set - End Property - - Public Property cooState() As String - Get - Return Me.cooStateField - End Get - Set - Me.cooStateField = Value - End Set - End Property - - Public Property addText() As List(Of String) - Get - Return Me.addTextField - End Get - Set - Me.addTextField = Value - End Set - End Property - - Public Property prevDoc() As List(Of TPreviousDocument) - Get - Return Me.prevDocField - End Get - Set - Me.prevDocField = Value - End Set - End Property - - Public Property item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property delTerm() As TInvoiceLineDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property unit() As String - Get - Return Me.unitField - End Get - Set - Me.unitField = Value - End Set - End Property - - Public Property delnote() As TDelNote - Get - Return Me.delnoteField - End Get - Set - Me.delnoteField = Value - End Set - End Property - - Public Property order() As TOrder - Get - Return Me.orderField - End Get - Set - Me.orderField = Value - End Set - End Property - - Public Property itemRef() As String - Get - Return Me.itemRefField - End Get - Set - Me.itemRefField = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property natCode() As List(Of String) - Get - Return Me.natCodeField - End Get - Set - Me.natCodeField = Value - End Set - End Property - - Public Property stockTypeAdd() As String - Get - Return Me.stockTypeAddField - End Get - Set - Me.stockTypeAddField = Value - End Set - End Property - - Public Property stockTypeDed() As String - Get - Return Me.stockTypeDedField - End Get - Set - Me.stockTypeDedField = Value - End Set - End Property - - Public Property bom() As TBomNo - Get - Return Me.bomField - End Get - Set - Me.bomField = Value - End Set - End Property - - Public Property accountNo() As String - Get - Return Me.accountNoField - End Get - Set - Me.accountNoField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - Public Property containers() As List(Of TContainer) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - Public Property shipmentIdentification() As String - Get - Return Me.shipmentIdentificationField - End Get - Set - Me.shipmentIdentificationField = Value - End Set - End Property - - Public Property UNDG() As String - Get - Return Me.uNDGField - End Get - Set - Me.uNDGField = Value - End Set - End Property - - Public Property consigneeEndUserFlag() As String - Get - Return Me.consigneeEndUserFlagField - End Get - Set - Me.consigneeEndUserFlagField = Value - End Set - End Property - - Public Property endUserInEam() As TInvoiceLineEndUserInEam - Get - Return Me.endUserInEamField - End Get - Set - Me.endUserInEamField = Value - End Set - End Property - - - Public Property endUserInEamSpecified() As Boolean - Get - Return Me.endUserInEamFieldSpecified - End Get - Set - Me.endUserInEamFieldSpecified = Value - End Set - End Property - - Public Property carriageCosts() As String - Get - Return Me.carriageCostsField - End Get - Set - Me.carriageCostsField = Value - End Set - End Property - - Public Property shipTo() As TInvoiceLineShipTo - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceLineEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property importReference() As List(Of TImportReference) - Get - Return Me.importReferenceField - End Get - Set - Me.importReferenceField = Value - End Set - End Property - - Public Property registrationInfo() As TRegInfo - Get - Return Me.registrationInfoField - End Get - Set - Me.registrationInfoField = Value - End Set - End Property - - Public Property serialNo() As String - Get - Return Me.serialNoField - End Get - Set - Me.serialNoField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property addedValue() As Decimal - Get - Return Me.addedValueField - End Get - Set - Me.addedValueField = Value - End Set - End Property - - - Public Property addedValueSpecified() As Boolean - Get - Return Me.addedValueFieldSpecified - End Get - Set - Me.addedValueFieldSpecified = Value - End Set - End Property - - Public Property ctoId() As String - Get - Return Me.ctoIdField - End Get - Set - Me.ctoIdField = Value - End Set - End Property - - Public Property infoText2() As String - Get - Return Me.infoText2Field - End Get - Set - Me.infoText2Field = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property additionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property trackingNumber() As String - Get - Return Me.trackingNumberField - End Get - Set - Me.trackingNumberField = Value - End Set - End Property - - Public Property erpData() As TErpLineData - Get - Return Me.erpDataField - End Get - Set - Me.erpDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocuments - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docDetailField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docStatUnitField As String - - Private docDepreciateQuantityField As Decimal - - Private docDepreciateQuantityFieldSpecified As Boolean - - Private docSupplierField As String - - Private docCategoryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docDetail() As String - Get - Return Me.docDetailField - End Get - Set - Me.docDetailField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docStatUnit() As String - Get - Return Me.docStatUnitField - End Get - Set - Me.docStatUnitField = Value - End Set - End Property - - Public Property docDepreciateQuantity() As Decimal - Get - Return Me.docDepreciateQuantityField - End Get - Set - Me.docDepreciateQuantityField = Value - End Set - End Property - - - Public Property docDepreciateQuantitySpecified() As Boolean - Get - Return Me.docDepreciateQuantityFieldSpecified - End Get - Set - Me.docDepreciateQuantityFieldSpecified = Value - End Set - End Property - - Public Property docSupplier() As String - Get - Return Me.docSupplierField - End Get - Set - Me.docSupplierField = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocuments)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocuments object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocuments object - ''' - '''string workflow markup to deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocuments) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocuments) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocuments - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocuments) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDocuments object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineDelTerm - - Private codeField As String - - Private descField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private typeField As String - - Private flagField As TAddCostsFlag - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property flag() As TAddCostsFlag - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TAddCostsFlag - - ''' - P - - ''' - V - End Enum - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attribTypeField As String - - Private attribTextField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attribType() As String - Get - Return Me.attribTypeField - End Get - Set - Me.attribTypeField = Value - End Set - End Property - - Public Property attribText() As String - Get - Return Me.attribTextField - End Get - Set - Me.attribTextField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private contNoField As String - - Private contTypeField As String - - Private sealNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property contNo() As String - Get - Return Me.contNoField - End Get - Set - Me.contNoField = Value - End Set - End Property - - Public Property contType() As String - Get - Return Me.contTypeField - End Get - Set - Me.contTypeField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TInvoiceLineEndUserInEam - - ''' - - Item - - ''' - - Item0 - - ''' - - Item1 - End Enum - - Partial Public Class TInvoiceLineShipTo - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineShipTo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineShipTo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineShipTo object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineShipTo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineShipTo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineShipTo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineShipTo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineShipTo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContactPerson - - Private jobField As String - - Private nameField As String - - Private emailField As String - - Private phoneField As String - - Private faxField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property job() As String - Get - Return Me.jobField - End Get - Set - Me.jobField = Value - End Set - End Property - - Public Property name() As String - Get - Return Me.nameField - End Get - Set - Me.nameField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property phone() As String - Get - Return Me.phoneField - End Get - Set - Me.phoneField = Value - End Set - End Property - - Public Property fax() As String - Get - Return Me.faxField - End Get - Set - Me.faxField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContactPerson)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContactPerson object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContactPerson object - ''' - '''string workflow markup to deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContactPerson) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContactPerson) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContactPerson - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContactPerson) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContactPerson object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLineEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLineEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLineEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLineEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLineEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLineEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLineEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLineEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLineEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrVatIdField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrVatId() As String - Get - Return Me.addrVatIdField - End Get - Set - Me.addrVatIdField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHead - - Private invoiceNoField As String - - Private invoiceDateField As Date - - Private invTypeField As String - - Private totAmountField As Decimal - - Private totAmountFieldSpecified As Boolean - - Private currField As String - - Private shipToField As TAddress - - Private endUserField As TInvoiceHeadEndUser - - Private delTermField As TDelTerm - - Private billToField As TAddress - - Private refField As String - - Private tradeCtryField As String - - Private gWeightField As Decimal - - Private gWeightFieldSpecified As Boolean - - Private nWeightField As Decimal - - Private nWeightFieldSpecified As Boolean - - Private addCostsField As List(Of TAddCosts) - - Private bolField As String - - Private transpNrField As String - - Private addtextField As List(Of String) - - Private documentsField As List(Of TDocuments) - - Private mrnExtField As String - - Private numberOfPackagesField As Decimal - - Private numberOfPackagesFieldSpecified As Boolean - - Private transportTypeField As String - - Private customerFieldsField As TCustomerFields - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.customerFieldsField = New TCustomerFields() - Me.documentsField = New List(Of TDocuments)() - Me.addtextField = New List(Of String)() - Me.addCostsField = New List(Of TAddCosts)() - Me.billToField = New TAddress() - Me.delTermField = New TDelTerm() - Me.endUserField = New TInvoiceHeadEndUser() - Me.shipToField = New TAddress() - End Sub - - Public Property invoiceNo() As String - Get - Return Me.invoiceNoField - End Get - Set - Me.invoiceNoField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - Public Property invType() As String - Get - Return Me.invTypeField - End Get - Set - Me.invTypeField = Value - End Set - End Property - - Public Property totAmount() As Decimal - Get - Return Me.totAmountField - End Get - Set - Me.totAmountField = Value - End Set - End Property - - - Public Property totAmountSpecified() As Boolean - Get - Return Me.totAmountFieldSpecified - End Get - Set - Me.totAmountFieldSpecified = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property shipTo() As TAddress - Get - Return Me.shipToField - End Get - Set - Me.shipToField = Value - End Set - End Property - - Public Property endUser() As TInvoiceHeadEndUser - Get - Return Me.endUserField - End Get - Set - Me.endUserField = Value - End Set - End Property - - Public Property delTerm() As TDelTerm - Get - Return Me.delTermField - End Get - Set - Me.delTermField = Value - End Set - End Property - - Public Property billTo() As TAddress - Get - Return Me.billToField - End Get - Set - Me.billToField = Value - End Set - End Property - - Public Property ref() As String - Get - Return Me.refField - End Get - Set - Me.refField = Value - End Set - End Property - - Public Property tradeCtry() As String - Get - Return Me.tradeCtryField - End Get - Set - Me.tradeCtryField = Value - End Set - End Property - - Public Property gWeight() As Decimal - Get - Return Me.gWeightField - End Get - Set - Me.gWeightField = Value - End Set - End Property - - - Public Property gWeightSpecified() As Boolean - Get - Return Me.gWeightFieldSpecified - End Get - Set - Me.gWeightFieldSpecified = Value - End Set - End Property - - Public Property nWeight() As Decimal - Get - Return Me.nWeightField - End Get - Set - Me.nWeightField = Value - End Set - End Property - - - Public Property nWeightSpecified() As Boolean - Get - Return Me.nWeightFieldSpecified - End Get - Set - Me.nWeightFieldSpecified = Value - End Set - End Property - - Public Property addCosts() As List(Of TAddCosts) - Get - Return Me.addCostsField - End Get - Set - Me.addCostsField = Value - End Set - End Property - - Public Property bol() As String - Get - Return Me.bolField - End Get - Set - Me.bolField = Value - End Set - End Property - - Public Property transpNr() As String - Get - Return Me.transpNrField - End Get - Set - Me.transpNrField = Value - End Set - End Property - - Public Property addtext() As List(Of String) - Get - Return Me.addtextField - End Get - Set - Me.addtextField = Value - End Set - End Property - - Public Property documents() As List(Of TDocuments) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - Public Property mrnExt() As String - Get - Return Me.mrnExtField - End Get - Set - Me.mrnExtField = Value - End Set - End Property - - Public Property numberOfPackages() As Decimal - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property customerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHeadEndUser - - Private addrNoField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHeadEndUser)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHeadEndUser object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHeadEndUser object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHeadEndUser) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHeadEndUser) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHeadEndUser - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHeadEndUser) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHeadEndUser object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoice - - Private invoiceHeadField As TInvoiceHead - - Private invoiceLineField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLineField = New List(Of TInvoiceLine)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - Public Property InvoiceLine() As List(Of TInvoiceLine) - Get - Return Me.invoiceLineField - End Get - Set - Me.invoiceLineField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErpShipmentData - - Private erpSystemIdField As String - - Private clientField As String - - Private companyCodeField As String - - Private customerIdField As String - - Private consolidationCompanyIdField As String - - Private accountGroupField As String - - Private shippingPointField As String - - Private loadingPointField As String - - Private offshoreField As Boolean - - Private offshoreFieldSpecified As Boolean - - Private routeField As String - - Private salesOrganizationField As String - - Private distributionChannelField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property erpSystemId() As String - Get - Return Me.erpSystemIdField - End Get - Set - Me.erpSystemIdField = Value - End Set - End Property - - Public Property client() As String - Get - Return Me.clientField - End Get - Set - Me.clientField = Value - End Set - End Property - - Public Property companyCode() As String - Get - Return Me.companyCodeField - End Get - Set - Me.companyCodeField = Value - End Set - End Property - - Public Property customerId() As String - Get - Return Me.customerIdField - End Get - Set - Me.customerIdField = Value - End Set - End Property - - Public Property consolidationCompanyId() As String - Get - Return Me.consolidationCompanyIdField - End Get - Set - Me.consolidationCompanyIdField = Value - End Set - End Property - - Public Property accountGroup() As String - Get - Return Me.accountGroupField - End Get - Set - Me.accountGroupField = Value - End Set - End Property - - Public Property shippingPoint() As String - Get - Return Me.shippingPointField - End Get - Set - Me.shippingPointField = Value - End Set - End Property - - Public Property loadingPoint() As String - Get - Return Me.loadingPointField - End Get - Set - Me.loadingPointField = Value - End Set - End Property - - Public Property offshore() As Boolean - Get - Return Me.offshoreField - End Get - Set - Me.offshoreField = Value - End Set - End Property - - - Public Property offshoreSpecified() As Boolean - Get - Return Me.offshoreFieldSpecified - End Get - Set - Me.offshoreFieldSpecified = Value - End Set - End Property - - Public Property route() As String - Get - Return Me.routeField - End Get - Set - Me.routeField = Value - End Set - End Property - - Public Property salesOrganization() As String - Get - Return Me.salesOrganizationField - End Get - Set - Me.salesOrganizationField = Value - End Set - End Property - - Public Property distributionChannel() As String - Get - Return Me.distributionChannelField - End Get - Set - Me.distributionChannelField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErpShipmentData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErpShipmentData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErpShipmentData object - ''' - '''string workflow markup to deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErpShipmentData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErpShipmentData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErpShipmentData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErpShipmentData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErpShipmentData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRoute - - Private countryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property country() As String - Get - Return Me.countryField - End Get - Set - Me.countryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRoute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRoute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRoute object - ''' - '''string workflow markup to deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRoute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRoute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRoute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRoute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TRoute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAssurance - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAssurance)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAssurance object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAssurance object - ''' - '''string workflow markup to deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAssurance) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAssurance) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAssurance - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAssurance) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAssurance object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreight - - Private flagField As String - - Private amountField As Decimal - - Private currField As String - - Private noneuField As Decimal - - Private noneuFieldSpecified As Boolean - - Private eunatField As Decimal - - Private eunatFieldSpecified As Boolean - - Private natField As Decimal - - Private natFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property flag() As String - Get - Return Me.flagField - End Get - Set - Me.flagField = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - Public Property curr() As String - Get - Return Me.currField - End Get - Set - Me.currField = Value - End Set - End Property - - Public Property noneu() As Decimal - Get - Return Me.noneuField - End Get - Set - Me.noneuField = Value - End Set - End Property - - - Public Property noneuSpecified() As Boolean - Get - Return Me.noneuFieldSpecified - End Get - Set - Me.noneuFieldSpecified = Value - End Set - End Property - - Public Property eunat() As Decimal - Get - Return Me.eunatField - End Get - Set - Me.eunatField = Value - End Set - End Property - - - Public Property eunatSpecified() As Boolean - Get - Return Me.eunatFieldSpecified - End Get - Set - Me.eunatFieldSpecified = Value - End Set - End Property - - Public Property nat() As Decimal - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - - Public Property natSpecified() As Boolean - Get - Return Me.natFieldSpecified - End Get - Set - Me.natFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreight)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreight object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreight object - ''' - '''string workflow markup to deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreight) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreight) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreight - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreight) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TFreight object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private type3Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Public Property type3() As String - Get - Return Me.type3Field - End Get - Set - Me.type3Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TSeal - - Private typeField As String - - Private quantityField As UInteger - - Private signField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property quantity() As UInteger - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - Public Property sign() As String - Get - Return Me.signField - End Get - Set - Me.signField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TSeal)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TSeal object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TSeal object - ''' - '''string workflow markup to deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TSeal) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TSeal) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TSeal - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TSeal) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TSeal object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motField As String - - Private natField As String - - Private typeField As String - - Private licNoField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property mot() As String - Get - Return Me.motField - End Get - Set - Me.motField = Value - End Set - End Property - - Public Property nat() As String - Get - Return Me.natField - End Get - Set - Me.natField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property licNo() As String - Get - Return Me.licNoField - End Get - Set - Me.licNoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomsOffice - - Private codeOffField As String - - Private offCtryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property codeOff() As String - Get - Return Me.codeOffField - End Get - Set - Me.codeOffField = Value - End Set - End Property - - Public Property offCtry() As String - Get - Return Me.offCtryField - End Get - Set - Me.offCtryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomsOffice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomsOffice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomsOffice object - ''' - '''string workflow markup to deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomsOffice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomsOffice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomsOffice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomsOffice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomsOffice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TLocationOfGoods - - Private codeField As String - - Private streetField As String - - Private zipField As String - - Private locField As String - - Private additField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property street() As String - Get - Return Me.streetField - End Get - Set - Me.streetField = Value - End Set - End Property - - Public Property zip() As String - Get - Return Me.zipField - End Get - Set - Me.zipField = Value - End Set - End Property - - Public Property loc() As String - Get - Return Me.locField - End Get - Set - Me.locField = Value - End Set - End Property - - Public Property addit() As String - Get - Return Me.additField - End Get - Set - Me.additField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TLocationOfGoods)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TLocationOfGoods object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TLocationOfGoods object - ''' - '''string workflow markup to deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TLocationOfGoods) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TLocationOfGoods) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TLocationOfGoods - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TLocationOfGoods) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TLocationOfGoods object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypField As String - - Private partnerAddressField As TPartnerPartnerAddress - - Private partnerRelationField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TPartnerPartnerAddress() - End Sub - - Public Property partnerTyp() As String - Get - Return Me.partnerTypField - End Get - Set - Me.partnerTypField = Value - End Set - End Property - - Public Property partnerAddress() As TPartnerPartnerAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartnerPartnerAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrStreet2Field As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private addrNatTField As String - - Private branchNoField As String - - Private addrKvbField As String - - Private addrInfoField As String - - Private contactPersonField As TContactPerson - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.contactPersonField = New TContactPerson() - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrStreet2() As String - Get - Return Me.addrStreet2Field - End Get - Set - Me.addrStreet2Field = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property addrNatT() As String - Get - Return Me.addrNatTField - End Get - Set - Me.addrNatTField = Value - End Set - End Property - - Public Property branchNo() As String - Get - Return Me.branchNoField - End Get - Set - Me.branchNoField = Value - End Set - End Property - - Public Property addrKvb() As String - Get - Return Me.addrKvbField - End Get - Set - Me.addrKvbField = Value - End Set - End Property - - Public Property addrInfo() As String - Get - Return Me.addrInfoField - End Get - Set - Me.addrInfoField = Value - End Set - End Property - - Public Property contactPerson() As TContactPerson - Get - Return Me.contactPersonField - End Get - Set - Me.contactPersonField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartnerPartnerAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartnerPartnerAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartnerPartnerAddress object - ''' - '''string workflow markup to deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartnerPartnerAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartnerPartnerAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartnerPartnerAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartnerPartnerAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartnerPartnerAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadAuthorisation - - Private oprEntryInTheRecordsField As String - - Private oprField As String - - Private trustworthyExporterField As String - - Private authorisedExporterField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property oprEntryInTheRecords() As String - Get - Return Me.oprEntryInTheRecordsField - End Get - Set - Me.oprEntryInTheRecordsField = Value - End Set - End Property - - Public Property opr() As String - Get - Return Me.oprField - End Get - Set - Me.oprField = Value - End Set - End Property - - Public Property trustworthyExporter() As String - Get - Return Me.trustworthyExporterField - End Get - Set - Me.trustworthyExporterField = Value - End Set - End Property - - Public Property authorisedExporter() As String - Get - Return Me.authorisedExporterField - End Get - Set - Me.authorisedExporterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadAuthorisation)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadAuthorisation object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadAuthorisation object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadAuthorisation object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadAuthorisation, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadAuthorisation) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadAuthorisation) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadAuthorisation - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadAuthorisation) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadAuthorisation object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadPostExportDeclaration - - Private dateOfExitField As Date - - Private dateOfExitFieldSpecified As Boolean - - Private dateOfExportField As Date - - Private dateOfExportFieldSpecified As Boolean - - Private statisticDeclField As String - - Private officeExitField As TCustomsOffice - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.officeExitField = New TCustomsOffice() - End Sub - - Public Property dateOfExit() As Date - Get - Return Me.dateOfExitField - End Get - Set - Me.dateOfExitField = Value - End Set - End Property - - - Public Property dateOfExitSpecified() As Boolean - Get - Return Me.dateOfExitFieldSpecified - End Get - Set - Me.dateOfExitFieldSpecified = Value - End Set - End Property - - Public Property dateOfExport() As Date - Get - Return Me.dateOfExportField - End Get - Set - Me.dateOfExportField = Value - End Set - End Property - - - Public Property dateOfExportSpecified() As Boolean - Get - Return Me.dateOfExportFieldSpecified - End Get - Set - Me.dateOfExportFieldSpecified = Value - End Set - End Property - - Public Property statisticDecl() As String - Get - Return Me.statisticDeclField - End Get - Set - Me.statisticDeclField = Value - End Set - End Property - - Public Property officeExit() As TCustomsOffice - Get - Return Me.officeExitField - End Get - Set - Me.officeExitField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadPostExportDeclaration)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadPostExportDeclaration object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadPostExportDeclaration object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadPostExportDeclaration object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadPostExportDeclaration, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadPostExportDeclaration) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadPostExportDeclaration) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadPostExportDeclaration - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadPostExportDeclaration) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadPostExportDeclaration object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprData - - Private reimportDeadlineField As Date - - Private reimportDeadlineFieldSpecified As Boolean - - Private standardExchangeField As String - - Private reImportField As List(Of TShipmentHeadOprDataReImport) - - Private meansOfIdentificationField As List(Of TShipmentHeadOprDataMeansOfIdentification) - - Private productField As List(Of TShipmentHeadOprDataProduct) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.productField = New List(Of TShipmentHeadOprDataProduct)() - Me.meansOfIdentificationField = New List(Of TShipmentHeadOprDataMeansOfIdentification)() - Me.reImportField = New List(Of TShipmentHeadOprDataReImport)() - End Sub - - Public Property reimportDeadline() As Date - Get - Return Me.reimportDeadlineField - End Get - Set - Me.reimportDeadlineField = Value - End Set - End Property - - - Public Property reimportDeadlineSpecified() As Boolean - Get - Return Me.reimportDeadlineFieldSpecified - End Get - Set - Me.reimportDeadlineFieldSpecified = Value - End Set - End Property - - Public Property standardExchange() As String - Get - Return Me.standardExchangeField - End Get - Set - Me.standardExchangeField = Value - End Set - End Property - - Public Property reImport() As List(Of TShipmentHeadOprDataReImport) - Get - Return Me.reImportField - End Get - Set - Me.reImportField = Value - End Set - End Property - - Public Property meansOfIdentification() As List(Of TShipmentHeadOprDataMeansOfIdentification) - Get - Return Me.meansOfIdentificationField - End Get - Set - Me.meansOfIdentificationField = Value - End Set - End Property - - Public Property product() As List(Of TShipmentHeadOprDataProduct) - Get - Return Me.productField - End Get - Set - Me.productField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprData object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataReImport - - Private ctryField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property ctry() As String - Get - Return Me.ctryField - End Get - Set - Me.ctryField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataReImport)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataReImport object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataReImport object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataReImport object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataReImport, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataReImport) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataReImport) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataReImport - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataReImport) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataReImport object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataMeansOfIdentification - - Private typeField As String - - Private descriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property description() As String - Get - Return Me.descriptionField - End Get - Set - Me.descriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataMeansOfIdentification)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataMeansOfIdentification object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataMeansOfIdentification object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataMeansOfIdentification object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataMeansOfIdentification, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataMeansOfIdentification) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataMeansOfIdentification) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataMeansOfIdentification - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataMeansOfIdentification) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataMeansOfIdentification object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHeadOprDataProduct - - Private commodityCodeField As String - - Private partDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property commodityCode() As String - Get - Return Me.commodityCodeField - End Get - Set - Me.commodityCodeField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHeadOprDataProduct)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHeadOprDataProduct object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHeadOprDataProduct object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHeadOprDataProduct object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataProduct, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHeadOprDataProduct) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHeadOprDataProduct) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHeadOprDataProduct - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHeadOprDataProduct) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHeadOprDataProduct object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class InsertExportShipment - - Private exportShipmentMessageField As TExportShipMsg - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.exportShipmentMessageField = New TExportShipMsg() - End Sub - - Public Property ExportShipmentMessage() As TExportShipMsg - Get - Return Me.exportShipmentMessageField - End Get - Set - Me.exportShipmentMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(InsertExportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current InsertExportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an InsertExportShipment object - ''' - '''string workflow markup to deserialize - '''Output InsertExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As InsertExportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, InsertExportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As InsertExportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As InsertExportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), InsertExportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current InsertExportShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an InsertExportShipment object - ''' - '''string xml file to load and deserialize - '''Output InsertExportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As InsertExportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, InsertExportShipment) - 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 InsertExportShipment) 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 InsertExportShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TExportShipMsg - - Private metadataField As TMicMetadata - - Private messageDetailField As TMessageDetail - - Private exportShipmentField As ExportShipment - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.exportShipmentField = New ExportShipment() - Me.messageDetailField = New TMessageDetail() - Me.metadataField = New TMicMetadata() - End Sub - - Public Property Metadata() As TMicMetadata - Get - Return Me.metadataField - End Get - Set - Me.metadataField = Value - End Set - End Property - - Public Property MessageDetail() As TMessageDetail - Get - Return Me.messageDetailField - End Get - Set - Me.messageDetailField = Value - End Set - End Property - - Public Property ExportShipment() As ExportShipment - Get - Return Me.exportShipmentField - End Get - Set - Me.exportShipmentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TExportShipMsg)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TExportShipMsg object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TExportShipMsg object - ''' - '''string workflow markup to deserialize - '''Output TExportShipMsg object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TExportShipMsg, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TExportShipMsg) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TExportShipMsg) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TExportShipMsg - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TExportShipMsg) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TExportShipMsg 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TExportShipMsg object - ''' - '''string xml file to load and deserialize - '''Output TExportShipMsg object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TExportShipMsg, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TExportShipMsg) - 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 TExportShipMsg) 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 TExportShipMsg - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMicMetadata - - Private connectionIdField As String - - Private partnerIdField As String - - Private dateTimeField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property connectionId() As String - Get - Return Me.connectionIdField - End Get - Set - Me.connectionIdField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property dateTime() As Date - Get - Return Me.dateTimeField - End Get - Set - Me.dateTimeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMicMetadata)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMicMetadata object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMicMetadata object - ''' - '''string workflow markup to deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMicMetadata) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMicMetadata - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMicMetadata) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMessageDetail - - Private messageIdField As String - - Private partyIdField As String - - Private transactionIdField As String - - Private sequenceNumField As String - - Private actionCodeField As TActionCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.actionCodeField = New TActionCode() - End Sub - - Public Property messageId() As String - Get - Return Me.messageIdField - End Get - Set - Me.messageIdField = Value - End Set - End Property - - Public Property partyId() As String - Get - Return Me.partyIdField - End Get - Set - Me.partyIdField = Value - End Set - End Property - - Public Property transactionId() As String - Get - Return Me.transactionIdField - End Get - Set - Me.transactionIdField = Value - End Set - End Property - - Public Property sequenceNum() As String - Get - Return Me.sequenceNumField - End Get - Set - Me.sequenceNumField = Value - End Set - End Property - - Public Property ActionCode() As TActionCode - Get - Return Me.actionCodeField - End Get - Set - Me.actionCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMessageDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMessageDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMessageDetail object - ''' - '''string workflow markup to deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMessageDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMessageDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMessageDetail 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMessageDetail object - ''' - '''string xml file to load and deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - 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 TMessageDetail) 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 TMessageDetail - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCode - - Private codeField As String - - Private parameterField As List(Of TActionCodeParameter) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.parameterField = New List(Of TActionCodeParameter)() - End Sub - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property parameter() As List(Of TActionCodeParameter) - Get - Return Me.parameterField - End Get - Set - Me.parameterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCode object - ''' - '''string workflow markup to deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCode object - ''' - '''string xml file to load and deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - 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 TActionCode) 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 TActionCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCodeParameter - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCodeParameter)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCodeParameter object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCodeParameter object - ''' - '''string workflow markup to deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCodeParameter - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCodeParameter) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCodeParameter 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCodeParameter object - ''' - '''string xml file to load and deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - 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 TActionCodeParameter) 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 TActionCodeParameter - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatusResponse - - Private statusField As TStatus - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.statusField = New TStatus() - End Sub - - Public Property Status() As TStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatusResponse)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatusResponse object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatusResponse object - ''' - '''string workflow markup to deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatusResponse - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatusResponse) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatusResponse 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatusResponse object - ''' - '''string xml file to load and deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - 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 TStatusResponse) 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 TStatusResponse - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatus - - Private statusField As TStatusStatus - - Private itemField As Object - - Private itemElementNameField As ItemChoiceType - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As TStatusStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - - Public Property Item() As Object - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - - Public Property ItemElementName() As ItemChoiceType - Get - Return Me.itemElementNameField - End Get - Set - Me.itemElementNameField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatus)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatus object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatus object - ''' - '''string workflow markup to deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatus - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatus) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatus 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatus object - ''' - '''string xml file to load and deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - 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 TStatus) 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 TStatus - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TStatusStatus - - ''' - OK - - ''' - [ERROR] - - ''' - WARNING - End Enum - - Partial Public Class ErrorMessages - - Private errorMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.errorMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property ErrorMessage() As List(Of TErrorMessageType) - Get - Return Me.errorMessageField - End Get - Set - Me.errorMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ErrorMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ErrorMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ErrorMessages object - ''' - '''string workflow markup to deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ErrorMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ErrorMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ErrorMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorMessageType - - Private moduleField As String - - Private processField As String - - Private errorCodeField As String - - Private errorDescField As String - - Private referenceField As TReference - - Private detailsField As TErrorDetail - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.detailsField = New TErrorDetail() - Me.referenceField = New TReference() - End Sub - - Public Property [module]() As String - Get - Return Me.moduleField - End Get - Set - Me.moduleField = Value - End Set - End Property - - Public Property process() As String - Get - Return Me.processField - End Get - Set - Me.processField = Value - End Set - End Property - - Public Property errorCode() As String - Get - Return Me.errorCodeField - End Get - Set - Me.errorCodeField = Value - End Set - End Property - - Public Property errorDesc() As String - Get - Return Me.errorDescField - End Get - Set - Me.errorDescField = Value - End Set - End Property - - Public Property Reference() As TReference - Get - Return Me.referenceField - End Get - Set - Me.referenceField = Value - End Set - End Property - - Public Property Details() As TErrorDetail - Get - Return Me.detailsField - End Get - Set - Me.detailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorMessageType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorMessageType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorMessageType object - ''' - '''string workflow markup to deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorMessageType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorMessageType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorMessageType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReference - - Private companyField As String - - Private plantField As String - - Private correlationIdField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private userField As String - - Private partnerIdField As String - - Private routeIdField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Public Property user() As String - Get - Return Me.userField - End Get - Set - Me.userField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property routeId() As String - Get - Return Me.routeIdField - End Get - Set - Me.routeIdField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReference object - ''' - '''string workflow markup to deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetail - - Private timestampField As Date - - Private stackTraceField As String - - Private additionalDetailsField As List(Of TErrorDetailAdditionalDetails) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.additionalDetailsField = New List(Of TErrorDetailAdditionalDetails)() - End Sub - - Public Property timestamp() As Date - Get - Return Me.timestampField - End Get - Set - Me.timestampField = Value - End Set - End Property - - Public Property stackTrace() As String - Get - Return Me.stackTraceField - End Get - Set - Me.stackTraceField = Value - End Set - End Property - - Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails) - Get - Return Me.additionalDetailsField - End Get - Set - Me.additionalDetailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetail object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetailAdditionalDetails - - Private typeField As String - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetailAdditionalDetails)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetailAdditionalDetails object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetailAdditionalDetails object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetailAdditionalDetails) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetailAdditionalDetails - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class WarningMessages - - Private warningMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.warningMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property WarningMessage() As List(Of TErrorMessageType) - Get - Return Me.warningMessageField - End Get - Set - Me.warningMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(WarningMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current WarningMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an WarningMessages object - ''' - '''string workflow markup to deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, WarningMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As WarningMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), WarningMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMetaReference - - Private correlationIdField As String - - Private companyField As String - - Private plantField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMetaReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMetaReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMetaReference object - ''' - '''string workflow markup to deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMetaReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMetaReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMetaReference 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMetaReference object - ''' - '''string xml file to load and deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - 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 TMetaReference) 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 TMetaReference - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum ItemChoiceType - - ''' - - ErrorMessages - - ''' - - WarningMessages - - ''' - Reference - End Enum -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.xsd deleted file mode 100644 index b89d8e49..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustExportShipment.xsd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - Message for inserting MIC CUST ExportShipment - - - - - - - - - - - - - - MIC request message - - - - - - - - diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.designer.vb deleted file mode 100644 index eb198b02..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.designer.vb +++ /dev/null @@ -1,20141 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MIC_IMPORTListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MIC_IMPORT - - Partial Public Class ImportShipment - - Private shipmentField As TShipment - - Private invoiceField As List(Of TInvoice) - - Private schemaVersionField As Decimal - - Private schemaVersionFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceField = New List(Of TInvoice)() - Me.shipmentField = New TShipment() - End Sub - - Public Property Shipment() As TShipment - Get - Return Me.shipmentField - End Get - Set - Me.shipmentField = Value - End Set - End Property - - Public Property Invoice() As List(Of TInvoice) - Get - Return Me.invoiceField - End Get - Set - Me.invoiceField = Value - End Set - End Property - - Public Property schemaVersion() As Decimal - Get - Return Me.schemaVersionField - End Get - Set - Me.schemaVersionField = Value - End Set - End Property - - - Public Property schemaVersionSpecified() As Boolean - Get - Return Me.schemaVersionFieldSpecified - End Get - Set - Me.schemaVersionFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ImportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ImportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ImportShipment object - ''' - '''string workflow markup to deserialize - '''Output ImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ImportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ImportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ImportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ImportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current ImportShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an ImportShipment object - ''' - '''string xml file to load and deserialize - '''Output ImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ImportShipment) - 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 ImportShipment) 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 ImportShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipment - - Private companyField As String - - Private plantField As String - - Private shipmentIdField As String - - Private shipmentPartialField As String - - Private shipmentVersionField As String - - Private documentNumberField As Decimal - - Private shipmentHeadField As TShipmentHead - - Private containersField As List(Of TDetailContainerInfo) - - Private documentsField As List(Of TDocument) - - Private attributesField As List(Of TAttribute) - - Private partnersField As List(Of TPartner) - - Private previousDocumentsField As List(Of TPrevDoc) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private additionalInformationField As List(Of TAttribute) - - Private authorisationHoldersField As TAuthHolders - - Private defermentAccountsField As TDeferAccs - - Private guaranteesField As TGuarantees - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.guaranteesField = New TGuarantees() - Me.defermentAccountsField = New TDeferAccs() - Me.authorisationHoldersField = New TAuthHolders() - Me.additionalInformationField = New List(Of TAttribute)() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.previousDocumentsField = New List(Of TPrevDoc)() - Me.partnersField = New List(Of TPartner)() - Me.attributesField = New List(Of TAttribute)() - Me.documentsField = New List(Of TDocument)() - Me.containersField = New List(Of TDetailContainerInfo)() - Me.shipmentHeadField = New TShipmentHead() - Me.shipmentVersionField = "1" - Me.documentNumberField = CType(1D, Decimal) - End Sub - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property shipmentId() As String - Get - Return Me.shipmentIdField - End Get - Set - Me.shipmentIdField = Value - End Set - End Property - - Public Property shipmentPartial() As String - Get - Return Me.shipmentPartialField - End Get - Set - Me.shipmentPartialField = Value - End Set - End Property - - - Public Property shipmentVersion() As String - Get - Return Me.shipmentVersionField - End Get - Set - Me.shipmentVersionField = Value - End Set - End Property - - - Public Property documentNumber() As Decimal - Get - Return Me.documentNumberField - End Get - Set - Me.documentNumberField = Value - End Set - End Property - - Public Property ShipmentHead() As TShipmentHead - Get - Return Me.shipmentHeadField - End Get - Set - Me.shipmentHeadField = Value - End Set - End Property - - - Public Property Containers() As List(Of TDetailContainerInfo) - Get - Return Me.containersField - End Get - Set - Me.containersField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property PreviousDocuments() As List(Of TPrevDoc) - Get - Return Me.previousDocumentsField - End Get - Set - Me.previousDocumentsField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - - Public Property AdditionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property AuthorisationHolders() As TAuthHolders - Get - Return Me.authorisationHoldersField - End Get - Set - Me.authorisationHoldersField = Value - End Set - End Property - - Public Property DefermentAccounts() As TDeferAccs - Get - Return Me.defermentAccountsField - End Get - Set - Me.defermentAccountsField = Value - End Set - End Property - - Public Property Guarantees() As TGuarantees - Get - Return Me.guaranteesField - End Get - Set - Me.guaranteesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipment object - ''' - '''string workflow markup to deserialize - '''Output TShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TShipment object - ''' - '''string xml file to load and deserialize - '''Output TShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipment) - 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 TShipment) 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 TShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TShipmentHead - - Private shipmentTypeField As TShipmentHeadShipmentType - - Private customsDateField As Date - - Private customsDateFieldSpecified As Boolean - - Private declTypeField As TDeclType - - Private mrnField As String - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private departurePlaceField As String - - Private dispatchCountryField As String - - Private lastDispatchCountryField As String - - Private destinationPlaceField As String - - Private destinationRegionField As String - - Private officeEntryField As String - - Private importStateField As String - - Private substituteFlagField As String - - Private typeOfImportField As String - - Private authorizationNumberField As String - - Private placeOfDispatchDescriptionField As String - - Private typeOfAirTransportationField As String - - Private motBorderField As TMot - - Private motBorderCrossingField As TMot - - Private motInlandField As TMot - - Private containerIndicatorField As String - - Private containerField As TContainer - - Private freightField As TFreightCosts - - Private insuranceField As TInsuranceCosts - - Private additionalCostsField As List(Of TAddCosts) - - Private additionalCostVATField As Decimal - - Private additionalCostVATFieldSpecified As Boolean - - Private textField As String - - Private exportDateField As Date - - Private exportDateFieldSpecified As Boolean - - Private importDateField As Date - - Private importDateFieldSpecified As Boolean - - Private estArrivalDateField As Date - - Private estArrivalDateFieldSpecified As Boolean - - Private partyConstField As String - - Private periodField As String - - Private customerFieldsField As TCustomerFields - - Private countryDestinationField As String - - Private clearenceTypeField As String - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private customsOfficeOfDestinationField As String - - Private carrierNumberField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private supervisingOfficeField As String - - Private typeIdentificationOfTransportArrivalField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.customerFieldsField = New TCustomerFields() - Me.additionalCostsField = New List(Of TAddCosts)() - Me.insuranceField = New TInsuranceCosts() - Me.freightField = New TFreightCosts() - Me.containerField = New TContainer() - Me.motInlandField = New TMot() - Me.motBorderCrossingField = New TMot() - Me.motBorderField = New TMot() - Me.declTypeField = New TDeclType() - Me.shipmentTypeField = TShipmentHeadShipmentType.E - Me.containerIndicatorField = "0" - End Sub - - - Public Property shipmentType() As TShipmentHeadShipmentType - Get - Return Me.shipmentTypeField - End Get - Set - Me.shipmentTypeField = Value - End Set - End Property - - Public Property customsDate() As Date - Get - Return Me.customsDateField - End Get - Set - Me.customsDateField = Value - End Set - End Property - - - Public Property customsDateSpecified() As Boolean - Get - Return Me.customsDateFieldSpecified - End Get - Set - Me.customsDateFieldSpecified = Value - End Set - End Property - - Public Property declType() As TDeclType - Get - Return Me.declTypeField - End Get - Set - Me.declTypeField = Value - End Set - End Property - - Public Property mrn() As String - Get - Return Me.mrnField - End Get - Set - Me.mrnField = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property departurePlace() As String - Get - Return Me.departurePlaceField - End Get - Set - Me.departurePlaceField = Value - End Set - End Property - - Public Property dispatchCountry() As String - Get - Return Me.dispatchCountryField - End Get - Set - Me.dispatchCountryField = Value - End Set - End Property - - Public Property lastDispatchCountry() As String - Get - Return Me.lastDispatchCountryField - End Get - Set - Me.lastDispatchCountryField = Value - End Set - End Property - - Public Property destinationPlace() As String - Get - Return Me.destinationPlaceField - End Get - Set - Me.destinationPlaceField = Value - End Set - End Property - - Public Property destinationRegion() As String - Get - Return Me.destinationRegionField - End Get - Set - Me.destinationRegionField = Value - End Set - End Property - - Public Property officeEntry() As String - Get - Return Me.officeEntryField - End Get - Set - Me.officeEntryField = Value - End Set - End Property - - Public Property importState() As String - Get - Return Me.importStateField - End Get - Set - Me.importStateField = Value - End Set - End Property - - Public Property substituteFlag() As String - Get - Return Me.substituteFlagField - End Get - Set - Me.substituteFlagField = Value - End Set - End Property - - Public Property typeOfImport() As String - Get - Return Me.typeOfImportField - End Get - Set - Me.typeOfImportField = Value - End Set - End Property - - Public Property authorizationNumber() As String - Get - Return Me.authorizationNumberField - End Get - Set - Me.authorizationNumberField = Value - End Set - End Property - - Public Property placeOfDispatchDescription() As String - Get - Return Me.placeOfDispatchDescriptionField - End Get - Set - Me.placeOfDispatchDescriptionField = Value - End Set - End Property - - Public Property typeOfAirTransportation() As String - Get - Return Me.typeOfAirTransportationField - End Get - Set - Me.typeOfAirTransportationField = Value - End Set - End Property - - Public Property MotBorder() As TMot - Get - Return Me.motBorderField - End Get - Set - Me.motBorderField = Value - End Set - End Property - - Public Property MotBorderCrossing() As TMot - Get - Return Me.motBorderCrossingField - End Get - Set - Me.motBorderCrossingField = Value - End Set - End Property - - Public Property MotInland() As TMot - Get - Return Me.motInlandField - End Get - Set - Me.motInlandField = Value - End Set - End Property - - - Public Property containerIndicator() As String - Get - Return Me.containerIndicatorField - End Get - Set - Me.containerIndicatorField = Value - End Set - End Property - - Public Property Container() As TContainer - Get - Return Me.containerField - End Get - Set - Me.containerField = Value - End Set - End Property - - Public Property Freight() As TFreightCosts - Get - Return Me.freightField - End Get - Set - Me.freightField = Value - End Set - End Property - - Public Property Insurance() As TInsuranceCosts - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - Public Property AdditionalCosts() As List(Of TAddCosts) - Get - Return Me.additionalCostsField - End Get - Set - Me.additionalCostsField = Value - End Set - End Property - - Public Property additionalCostVAT() As Decimal - Get - Return Me.additionalCostVATField - End Get - Set - Me.additionalCostVATField = Value - End Set - End Property - - - Public Property additionalCostVATSpecified() As Boolean - Get - Return Me.additionalCostVATFieldSpecified - End Get - Set - Me.additionalCostVATFieldSpecified = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property exportDate() As Date - Get - Return Me.exportDateField - End Get - Set - Me.exportDateField = Value - End Set - End Property - - - Public Property exportDateSpecified() As Boolean - Get - Return Me.exportDateFieldSpecified - End Get - Set - Me.exportDateFieldSpecified = Value - End Set - End Property - - Public Property importDate() As Date - Get - Return Me.importDateField - End Get - Set - Me.importDateField = Value - End Set - End Property - - - Public Property importDateSpecified() As Boolean - Get - Return Me.importDateFieldSpecified - End Get - Set - Me.importDateFieldSpecified = Value - End Set - End Property - - Public Property estArrivalDate() As Date - Get - Return Me.estArrivalDateField - End Get - Set - Me.estArrivalDateField = Value - End Set - End Property - - - Public Property estArrivalDateSpecified() As Boolean - Get - Return Me.estArrivalDateFieldSpecified - End Get - Set - Me.estArrivalDateFieldSpecified = Value - End Set - End Property - - Public Property partyConst() As String - Get - Return Me.partyConstField - End Get - Set - Me.partyConstField = Value - End Set - End Property - - Public Property period() As String - Get - Return Me.periodField - End Get - Set - Me.periodField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property countryDestination() As String - Get - Return Me.countryDestinationField - End Get - Set - Me.countryDestinationField = Value - End Set - End Property - - Public Property clearenceType() As String - Get - Return Me.clearenceTypeField - End Get - Set - Me.clearenceTypeField = Value - End Set - End Property - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property customsOfficeOfDestination() As String - Get - Return Me.customsOfficeOfDestinationField - End Get - Set - Me.customsOfficeOfDestinationField = Value - End Set - End Property - - Public Property carrierNumber() As String - Get - Return Me.carrierNumberField - End Get - Set - Me.carrierNumberField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property supervisingOffice() As String - Get - Return Me.supervisingOfficeField - End Get - Set - Me.supervisingOfficeField = Value - End Set - End Property - - Public Property typeIdentificationOfTransportArrival() As String - Get - Return Me.typeIdentificationOfTransportArrivalField - End Get - Set - Me.typeIdentificationOfTransportArrivalField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TShipmentHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TShipmentHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TShipmentHead object - ''' - '''string workflow markup to deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TShipmentHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TShipmentHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TShipmentHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TShipmentHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TShipmentHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TShipmentHeadShipmentType - - ''' - E - - ''' - B - - ''' - U - - ''' - X - - ''' - I - End Enum - - Partial Public Class TDeclType - - Private type1Field As String - - Private type2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type1() As String - Get - Return Me.type1Field - End Get - Set - Me.type1Field = Value - End Set - End Property - - Public Property type2() As String - Get - Return Me.type2Field - End Get - Set - Me.type2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeclType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeclType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeclType object - ''' - '''string workflow markup to deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeclType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeclType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeclType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeclType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDeclType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackageData - - Private signoField As String - - Private numberOfPackagesField As Long - - Private numberOfPackagesFieldSpecified As Boolean - - Private packageTypeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property signo() As String - Get - Return Me.signoField - End Get - Set - Me.signoField = Value - End Set - End Property - - Public Property numberOfPackages() As Long - Get - Return Me.numberOfPackagesField - End Get - Set - Me.numberOfPackagesField = Value - End Set - End Property - - - Public Property numberOfPackagesSpecified() As Boolean - Get - Return Me.numberOfPackagesFieldSpecified - End Get - Set - Me.numberOfPackagesFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackageData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackageData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackageData object - ''' - '''string workflow markup to deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackageData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackageData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackageData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackageData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackageData object - ''' - '''string xml file to load and deserialize - '''Output TPackageData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackageData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackageData) - 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 TPackageData) 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 TPackageData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackagesData - - Private packageDataField As List(Of TPackageData) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packageDataField = New List(Of TPackageData)() - End Sub - - Public Property PackageData() As List(Of TPackageData) - Get - Return Me.packageDataField - End Get - Set - Me.packageDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackagesData)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackagesData object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackagesData object - ''' - '''string workflow markup to deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackagesData) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackagesData - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackagesData) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPackagesData 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPackagesData object - ''' - '''string xml file to load and deserialize - '''Output TPackagesData object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPackagesData, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackagesData) - 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 TPackagesData) 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 TPackagesData - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRefPrevProcedure - - Private referenceTypeField As String - - Private referenceNumberField As String - - Private authorisationNumberField As String - - Private registrationNumberField As String - - Private positionNumberField As Long - - Private positionNumberFieldSpecified As Boolean - - Private partNumberField As String - - Private tariffNumberField As String - - Private tradeQuantityField As Decimal - - Private tradeQuantityFieldSpecified As Boolean - - Private tradeUnitOfMeasurementField As String - - Private tradeQualifierField As String - - Private deductionQuantityField As Decimal - - Private deductionQuantityFieldSpecified As Boolean - - Private deductionUnitOfMeasurementField As String - - Private deductionQualifierField As String - - Private additionalInformationField As String - - Private normalTreatmentFlagField As Boolean - - Private normalTreatmentFlagFieldSpecified As Boolean - - Private atlasFlagField As Boolean - - Private atlasFlagFieldSpecified As Boolean - - Private customsNumberField As String - - Private statisticalQuantityField As Decimal - - Private statisticalQuantityFieldSpecified As Boolean - - Private netMassField As Decimal - - Private netMassFieldSpecified As Boolean - - Private grossMassField As Decimal - - Private grossMassFieldSpecified As Boolean - - Private packageQuantityField As Decimal - - Private packageQuantityFieldSpecified As Boolean - - Private simpleIprApplicationField As Boolean - - Private simpleIprApplicationFieldSpecified As Boolean - - Private supervisingOfficeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property authorisationNumber() As String - Get - Return Me.authorisationNumberField - End Get - Set - Me.authorisationNumberField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property positionNumber() As Long - Get - Return Me.positionNumberField - End Get - Set - Me.positionNumberField = Value - End Set - End Property - - - Public Property positionNumberSpecified() As Boolean - Get - Return Me.positionNumberFieldSpecified - End Get - Set - Me.positionNumberFieldSpecified = Value - End Set - End Property - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property tariffNumber() As String - Get - Return Me.tariffNumberField - End Get - Set - Me.tariffNumberField = Value - End Set - End Property - - Public Property tradeQuantity() As Decimal - Get - Return Me.tradeQuantityField - End Get - Set - Me.tradeQuantityField = Value - End Set - End Property - - - Public Property tradeQuantitySpecified() As Boolean - Get - Return Me.tradeQuantityFieldSpecified - End Get - Set - Me.tradeQuantityFieldSpecified = Value - End Set - End Property - - Public Property tradeUnitOfMeasurement() As String - Get - Return Me.tradeUnitOfMeasurementField - End Get - Set - Me.tradeUnitOfMeasurementField = Value - End Set - End Property - - Public Property tradeQualifier() As String - Get - Return Me.tradeQualifierField - End Get - Set - Me.tradeQualifierField = Value - End Set - End Property - - Public Property deductionQuantity() As Decimal - Get - Return Me.deductionQuantityField - End Get - Set - Me.deductionQuantityField = Value - End Set - End Property - - - Public Property deductionQuantitySpecified() As Boolean - Get - Return Me.deductionQuantityFieldSpecified - End Get - Set - Me.deductionQuantityFieldSpecified = Value - End Set - End Property - - Public Property deductionUnitOfMeasurement() As String - Get - Return Me.deductionUnitOfMeasurementField - End Get - Set - Me.deductionUnitOfMeasurementField = Value - End Set - End Property - - Public Property deductionQualifier() As String - Get - Return Me.deductionQualifierField - End Get - Set - Me.deductionQualifierField = Value - End Set - End Property - - Public Property additionalInformation() As String - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property normalTreatmentFlag() As Boolean - Get - Return Me.normalTreatmentFlagField - End Get - Set - Me.normalTreatmentFlagField = Value - End Set - End Property - - - Public Property normalTreatmentFlagSpecified() As Boolean - Get - Return Me.normalTreatmentFlagFieldSpecified - End Get - Set - Me.normalTreatmentFlagFieldSpecified = Value - End Set - End Property - - Public Property atlasFlag() As Boolean - Get - Return Me.atlasFlagField - End Get - Set - Me.atlasFlagField = Value - End Set - End Property - - - Public Property atlasFlagSpecified() As Boolean - Get - Return Me.atlasFlagFieldSpecified - End Get - Set - Me.atlasFlagFieldSpecified = Value - End Set - End Property - - Public Property customsNumber() As String - Get - Return Me.customsNumberField - End Get - Set - Me.customsNumberField = Value - End Set - End Property - - Public Property statisticalQuantity() As Decimal - Get - Return Me.statisticalQuantityField - End Get - Set - Me.statisticalQuantityField = Value - End Set - End Property - - - Public Property statisticalQuantitySpecified() As Boolean - Get - Return Me.statisticalQuantityFieldSpecified - End Get - Set - Me.statisticalQuantityFieldSpecified = Value - End Set - End Property - - Public Property netMass() As Decimal - Get - Return Me.netMassField - End Get - Set - Me.netMassField = Value - End Set - End Property - - - Public Property netMassSpecified() As Boolean - Get - Return Me.netMassFieldSpecified - End Get - Set - Me.netMassFieldSpecified = Value - End Set - End Property - - Public Property grossMass() As Decimal - Get - Return Me.grossMassField - End Get - Set - Me.grossMassField = Value - End Set - End Property - - - Public Property grossMassSpecified() As Boolean - Get - Return Me.grossMassFieldSpecified - End Get - Set - Me.grossMassFieldSpecified = Value - End Set - End Property - - Public Property packageQuantity() As Decimal - Get - Return Me.packageQuantityField - End Get - Set - Me.packageQuantityField = Value - End Set - End Property - - - Public Property packageQuantitySpecified() As Boolean - Get - Return Me.packageQuantityFieldSpecified - End Get - Set - Me.packageQuantityFieldSpecified = Value - End Set - End Property - - Public Property simpleIprApplication() As Boolean - Get - Return Me.simpleIprApplicationField - End Get - Set - Me.simpleIprApplicationField = Value - End Set - End Property - - - Public Property simpleIprApplicationSpecified() As Boolean - Get - Return Me.simpleIprApplicationFieldSpecified - End Get - Set - Me.simpleIprApplicationFieldSpecified = Value - End Set - End Property - - Public Property supervisingOffice() As String - Get - Return Me.supervisingOfficeField - End Get - Set - Me.supervisingOfficeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRefPrevProcedure)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRefPrevProcedure object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRefPrevProcedure object - ''' - '''string workflow markup to deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRefPrevProcedure) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRefPrevProcedure - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRefPrevProcedure) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRefPrevProcedure 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRefPrevProcedure object - ''' - '''string xml file to load and deserialize - '''Output TRefPrevProcedure object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRefPrevProcedure, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRefPrevProcedure) - 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 TRefPrevProcedure) 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 TRefPrevProcedure - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPreSupplier - - Private infDutyValueField As Decimal - - Private infDutyValueFieldSpecified As Boolean - - Private infDutyRateField As Decimal - - Private infDutyRateFieldSpecified As Boolean - - Private infDutyField As Decimal - - Private infDutyFieldSpecified As Boolean - - Private infDutyCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property infDutyValue() As Decimal - Get - Return Me.infDutyValueField - End Get - Set - Me.infDutyValueField = Value - End Set - End Property - - - Public Property infDutyValueSpecified() As Boolean - Get - Return Me.infDutyValueFieldSpecified - End Get - Set - Me.infDutyValueFieldSpecified = Value - End Set - End Property - - Public Property infDutyRate() As Decimal - Get - Return Me.infDutyRateField - End Get - Set - Me.infDutyRateField = Value - End Set - End Property - - - Public Property infDutyRateSpecified() As Boolean - Get - Return Me.infDutyRateFieldSpecified - End Get - Set - Me.infDutyRateFieldSpecified = Value - End Set - End Property - - Public Property infDuty() As Decimal - Get - Return Me.infDutyField - End Get - Set - Me.infDutyField = Value - End Set - End Property - - - Public Property infDutySpecified() As Boolean - Get - Return Me.infDutyFieldSpecified - End Get - Set - Me.infDutyFieldSpecified = Value - End Set - End Property - - Public Property infDutyCurrency() As String - Get - Return Me.infDutyCurrencyField - End Get - Set - Me.infDutyCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPreSupplier)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPreSupplier object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPreSupplier object - ''' - '''string workflow markup to deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPreSupplier) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPreSupplier - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPreSupplier) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPreSupplier 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPreSupplier object - ''' - '''string xml file to load and deserialize - '''Output TPreSupplier object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPreSupplier, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPreSupplier) - 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 TPreSupplier) 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 TPreSupplier - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntraLine - - Private statusField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private periodField As Long - - Private periodFieldSpecified As Boolean - - Private regionField As String - - Private statisticalProcedureField As String - - Private statisticalValueField As Decimal - - Private statisticalValueFieldSpecified As Boolean - - Private additionalCostsCurrency1Field As String - - Private additionalCostsType1Field As String - - Private additionalCostsCurrency2Field As String - - Private additionalCostsType2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As String - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property period() As Long - Get - Return Me.periodField - End Get - Set - Me.periodField = Value - End Set - End Property - - - Public Property periodSpecified() As Boolean - Get - Return Me.periodFieldSpecified - End Get - Set - Me.periodFieldSpecified = Value - End Set - End Property - - Public Property region() As String - Get - Return Me.regionField - End Get - Set - Me.regionField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property statisticalValue() As Decimal - Get - Return Me.statisticalValueField - End Get - Set - Me.statisticalValueField = Value - End Set - End Property - - - Public Property statisticalValueSpecified() As Boolean - Get - Return Me.statisticalValueFieldSpecified - End Get - Set - Me.statisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsCurrency1() As String - Get - Return Me.additionalCostsCurrency1Field - End Get - Set - Me.additionalCostsCurrency1Field = Value - End Set - End Property - - Public Property additionalCostsType1() As String - Get - Return Me.additionalCostsType1Field - End Get - Set - Me.additionalCostsType1Field = Value - End Set - End Property - - Public Property additionalCostsCurrency2() As String - Get - Return Me.additionalCostsCurrency2Field - End Get - Set - Me.additionalCostsCurrency2Field = Value - End Set - End Property - - Public Property additionalCostsType2() As String - Get - Return Me.additionalCostsType2Field - End Get - Set - Me.additionalCostsType2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntraLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntraLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntraLine object - ''' - '''string workflow markup to deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntraLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntraLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntraLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntraLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntraLine object - ''' - '''string xml file to load and deserialize - '''Output TCustIntraLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntraLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntraLine) - 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 TCustIntraLine) 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 TCustIntraLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TOprInfo - - Private dutyGroup1Field As String - - Private reductionAmount1Field As Decimal - - Private reductionAmount1FieldSpecified As Boolean - - Private dutyGroup2Field As String - - Private reductionAmount2Field As Decimal - - Private reductionAmount2FieldSpecified As Boolean - - Private dutyGroup3Field As String - - Private reductionAmount3Field As Decimal - - Private reductionAmount3FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property dutyGroup1() As String - Get - Return Me.dutyGroup1Field - End Get - Set - Me.dutyGroup1Field = Value - End Set - End Property - - Public Property reductionAmount1() As Decimal - Get - Return Me.reductionAmount1Field - End Get - Set - Me.reductionAmount1Field = Value - End Set - End Property - - - Public Property reductionAmount1Specified() As Boolean - Get - Return Me.reductionAmount1FieldSpecified - End Get - Set - Me.reductionAmount1FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup2() As String - Get - Return Me.dutyGroup2Field - End Get - Set - Me.dutyGroup2Field = Value - End Set - End Property - - Public Property reductionAmount2() As Decimal - Get - Return Me.reductionAmount2Field - End Get - Set - Me.reductionAmount2Field = Value - End Set - End Property - - - Public Property reductionAmount2Specified() As Boolean - Get - Return Me.reductionAmount2FieldSpecified - End Get - Set - Me.reductionAmount2FieldSpecified = Value - End Set - End Property - - Public Property dutyGroup3() As String - Get - Return Me.dutyGroup3Field - End Get - Set - Me.dutyGroup3Field = Value - End Set - End Property - - Public Property reductionAmount3() As Decimal - Get - Return Me.reductionAmount3Field - End Get - Set - Me.reductionAmount3Field = Value - End Set - End Property - - - Public Property reductionAmount3Specified() As Boolean - Get - Return Me.reductionAmount3FieldSpecified - End Get - Set - Me.reductionAmount3FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TOprInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TOprInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TOprInfo object - ''' - '''string workflow markup to deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TOprInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TOprInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TOprInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TOprInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TOprInfo object - ''' - '''string xml file to load and deserialize - '''Output TOprInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TOprInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TOprInfo) - 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 TOprInfo) 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 TOprInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutySaving - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private measuresTypeField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private additionField As Decimal - - Private additionFieldSpecified As Boolean - - Private preferentialFlagField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property addition() As Decimal - Get - Return Me.additionField - End Get - Set - Me.additionField = Value - End Set - End Property - - - Public Property additionSpecified() As Boolean - Get - Return Me.additionFieldSpecified - End Get - Set - Me.additionFieldSpecified = Value - End Set - End Property - - Public Property preferentialFlag() As String - Get - Return Me.preferentialFlagField - End Get - Set - Me.preferentialFlagField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutySaving)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutySaving object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutySaving object - ''' - '''string workflow markup to deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutySaving) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutySaving - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutySaving) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutySaving 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutySaving object - ''' - '''string xml file to load and deserialize - '''Output TDutySaving object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutySaving, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutySaving) - 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 TDutySaving) 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 TDutySaving - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDutyTax - - Private additionalCostsTypeField As String - - Private codeField As String - - Private calculatedCustDutiesField As Decimal - - Private calculatedCustDutiesFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private creationFlagField As String - - Private unitOfMeasurmentField As String - - Private calculationBaseField As Decimal - - Private calculationBaseFieldSpecified As Boolean - - Private countryOfDutiesField As String - - Private calculatedDutiesField As Decimal - - Private calculatedDutiesFieldSpecified As Boolean - - Private calculatedAssessmentBasisField As Decimal - - Private calculatedAssessmentBasisFieldSpecified As Boolean - - Private areaCodeField As String - - Private measuresTypeField As String - - Private dutyCodeCustomsOfficeField As String - - Private indentureNumberField As String - - Private dutyRateField As Decimal - - Private dutyRateFieldSpecified As Boolean - - Private stornoFlagField As String - - Private dutyAmountIncreaseOrDecreaseField As Decimal - - Private dutyAmountIncreaseOrDecreaseFieldSpecified As Boolean - - Private typeOfAdditionalCodeField As String - - Private noOfAdditionalCodeField As String - - Private calculatedDutyRateField As Decimal - - Private calculatedDutyRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property additionalCostsType() As String - Get - Return Me.additionalCostsTypeField - End Get - Set - Me.additionalCostsTypeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property calculatedCustDuties() As Decimal - Get - Return Me.calculatedCustDutiesField - End Get - Set - Me.calculatedCustDutiesField = Value - End Set - End Property - - - Public Property calculatedCustDutiesSpecified() As Boolean - Get - Return Me.calculatedCustDutiesFieldSpecified - End Get - Set - Me.calculatedCustDutiesFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property creationFlag() As String - Get - Return Me.creationFlagField - End Get - Set - Me.creationFlagField = Value - End Set - End Property - - Public Property unitOfMeasurment() As String - Get - Return Me.unitOfMeasurmentField - End Get - Set - Me.unitOfMeasurmentField = Value - End Set - End Property - - Public Property calculationBase() As Decimal - Get - Return Me.calculationBaseField - End Get - Set - Me.calculationBaseField = Value - End Set - End Property - - - Public Property calculationBaseSpecified() As Boolean - Get - Return Me.calculationBaseFieldSpecified - End Get - Set - Me.calculationBaseFieldSpecified = Value - End Set - End Property - - Public Property countryOfDuties() As String - Get - Return Me.countryOfDutiesField - End Get - Set - Me.countryOfDutiesField = Value - End Set - End Property - - Public Property calculatedDuties() As Decimal - Get - Return Me.calculatedDutiesField - End Get - Set - Me.calculatedDutiesField = Value - End Set - End Property - - - Public Property calculatedDutiesSpecified() As Boolean - Get - Return Me.calculatedDutiesFieldSpecified - End Get - Set - Me.calculatedDutiesFieldSpecified = Value - End Set - End Property - - Public Property calculatedAssessmentBasis() As Decimal - Get - Return Me.calculatedAssessmentBasisField - End Get - Set - Me.calculatedAssessmentBasisField = Value - End Set - End Property - - - Public Property calculatedAssessmentBasisSpecified() As Boolean - Get - Return Me.calculatedAssessmentBasisFieldSpecified - End Get - Set - Me.calculatedAssessmentBasisFieldSpecified = Value - End Set - End Property - - Public Property areaCode() As String - Get - Return Me.areaCodeField - End Get - Set - Me.areaCodeField = Value - End Set - End Property - - Public Property measuresType() As String - Get - Return Me.measuresTypeField - End Get - Set - Me.measuresTypeField = Value - End Set - End Property - - Public Property dutyCodeCustomsOffice() As String - Get - Return Me.dutyCodeCustomsOfficeField - End Get - Set - Me.dutyCodeCustomsOfficeField = Value - End Set - End Property - - Public Property indentureNumber() As String - Get - Return Me.indentureNumberField - End Get - Set - Me.indentureNumberField = Value - End Set - End Property - - Public Property dutyRate() As Decimal - Get - Return Me.dutyRateField - End Get - Set - Me.dutyRateField = Value - End Set - End Property - - - Public Property dutyRateSpecified() As Boolean - Get - Return Me.dutyRateFieldSpecified - End Get - Set - Me.dutyRateFieldSpecified = Value - End Set - End Property - - Public Property stornoFlag() As String - Get - Return Me.stornoFlagField - End Get - Set - Me.stornoFlagField = Value - End Set - End Property - - Public Property dutyAmountIncreaseOrDecrease() As Decimal - Get - Return Me.dutyAmountIncreaseOrDecreaseField - End Get - Set - Me.dutyAmountIncreaseOrDecreaseField = Value - End Set - End Property - - - Public Property dutyAmountIncreaseOrDecreaseSpecified() As Boolean - Get - Return Me.dutyAmountIncreaseOrDecreaseFieldSpecified - End Get - Set - Me.dutyAmountIncreaseOrDecreaseFieldSpecified = Value - End Set - End Property - - Public Property typeOfAdditionalCode() As String - Get - Return Me.typeOfAdditionalCodeField - End Get - Set - Me.typeOfAdditionalCodeField = Value - End Set - End Property - - Public Property noOfAdditionalCode() As String - Get - Return Me.noOfAdditionalCodeField - End Get - Set - Me.noOfAdditionalCodeField = Value - End Set - End Property - - Public Property calculatedDutyRate() As Decimal - Get - Return Me.calculatedDutyRateField - End Get - Set - Me.calculatedDutyRateField = Value - End Set - End Property - - - Public Property calculatedDutyRateSpecified() As Boolean - Get - Return Me.calculatedDutyRateFieldSpecified - End Get - Set - Me.calculatedDutyRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDutyTax)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDutyTax object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDutyTax object - ''' - '''string workflow markup to deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDutyTax) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDutyTax - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDutyTax) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDutyTax 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDutyTax object - ''' - '''string xml file to load and deserialize - '''Output TDutyTax object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDutyTax, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDutyTax) - 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 TDutyTax) 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 TDutyTax - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDuty - - Private typeField As String - - Private calcDutyBaseField As Decimal - - Private calcDutyBaseFieldSpecified As Boolean - - Private currencyField As String - - Private codeField As String - - Private rateField As Decimal - - Private rateFieldSpecified As Boolean - - Private amountField As Decimal - - Private amountFieldSpecified As Boolean - - Private addDeductField As Decimal - - Private addDeductFieldSpecified As Boolean - - Private calcDutyField As Decimal - - Private calcDutyFieldSpecified As Boolean - - Private dutyField As Decimal - - Private dutyFieldSpecified As Boolean - - Private dutyBaseField As Decimal - - Private dutyBaseFieldSpecified As Boolean - - Private measureCodeField As String - - Private measureField As String - - Private authorityDutyCodeField As String - - Private territoryField As String - - Private typeAddCodeField As String - - Private numberAddCodeField As String - - Private tariffRateQuotaField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property calcDutyBase() As Decimal - Get - Return Me.calcDutyBaseField - End Get - Set - Me.calcDutyBaseField = Value - End Set - End Property - - - Public Property calcDutyBaseSpecified() As Boolean - Get - Return Me.calcDutyBaseFieldSpecified - End Get - Set - Me.calcDutyBaseFieldSpecified = Value - End Set - End Property - - Public Property currency() As String - Get - Return Me.currencyField - End Get - Set - Me.currencyField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property rate() As Decimal - Get - Return Me.rateField - End Get - Set - Me.rateField = Value - End Set - End Property - - - Public Property rateSpecified() As Boolean - Get - Return Me.rateFieldSpecified - End Get - Set - Me.rateFieldSpecified = Value - End Set - End Property - - Public Property amount() As Decimal - Get - Return Me.amountField - End Get - Set - Me.amountField = Value - End Set - End Property - - - Public Property amountSpecified() As Boolean - Get - Return Me.amountFieldSpecified - End Get - Set - Me.amountFieldSpecified = Value - End Set - End Property - - Public Property addDeduct() As Decimal - Get - Return Me.addDeductField - End Get - Set - Me.addDeductField = Value - End Set - End Property - - - Public Property addDeductSpecified() As Boolean - Get - Return Me.addDeductFieldSpecified - End Get - Set - Me.addDeductFieldSpecified = Value - End Set - End Property - - Public Property calcDuty() As Decimal - Get - Return Me.calcDutyField - End Get - Set - Me.calcDutyField = Value - End Set - End Property - - - Public Property calcDutySpecified() As Boolean - Get - Return Me.calcDutyFieldSpecified - End Get - Set - Me.calcDutyFieldSpecified = Value - End Set - End Property - - Public Property duty() As Decimal - Get - Return Me.dutyField - End Get - Set - Me.dutyField = Value - End Set - End Property - - - Public Property dutySpecified() As Boolean - Get - Return Me.dutyFieldSpecified - End Get - Set - Me.dutyFieldSpecified = Value - End Set - End Property - - Public Property dutyBase() As Decimal - Get - Return Me.dutyBaseField - End Get - Set - Me.dutyBaseField = Value - End Set - End Property - - - Public Property dutyBaseSpecified() As Boolean - Get - Return Me.dutyBaseFieldSpecified - End Get - Set - Me.dutyBaseFieldSpecified = Value - End Set - End Property - - Public Property measureCode() As String - Get - Return Me.measureCodeField - End Get - Set - Me.measureCodeField = Value - End Set - End Property - - Public Property measure() As String - Get - Return Me.measureField - End Get - Set - Me.measureField = Value - End Set - End Property - - Public Property authorityDutyCode() As String - Get - Return Me.authorityDutyCodeField - End Get - Set - Me.authorityDutyCodeField = Value - End Set - End Property - - Public Property territory() As String - Get - Return Me.territoryField - End Get - Set - Me.territoryField = Value - End Set - End Property - - Public Property typeAddCode() As String - Get - Return Me.typeAddCodeField - End Get - Set - Me.typeAddCodeField = Value - End Set - End Property - - Public Property numberAddCode() As String - Get - Return Me.numberAddCodeField - End Get - Set - Me.numberAddCodeField = Value - End Set - End Property - - Public Property tariffRateQuota() As String - Get - Return Me.tariffRateQuotaField - End Get - Set - Me.tariffRateQuotaField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDuty)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDuty object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDuty object - ''' - '''string workflow markup to deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDuty) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDuty - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDuty) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDuty 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDuty object - ''' - '''string xml file to load and deserialize - '''Output TDuty object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDuty, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDuty) - 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 TDuty) 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 TDuty - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValuesCust - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private additionalStatisticalValueField As Decimal - - Private additionalStatisticalValueFieldSpecified As Boolean - - Private additionalCostsVatField As Decimal - - Private additionalCostsVatFieldSpecified As Boolean - - Private addStatisticValueField As Decimal - - Private addStatisticValueFieldSpecified As Boolean - - Private oprIngredientsValueField As Decimal - - Private oprIngredientsValueFieldSpecified As Boolean - - Private additionalCosts1Field As Decimal - - Private additionalCosts1FieldSpecified As Boolean - - Private additionalCosts2Field As Decimal - - Private additionalCosts2FieldSpecified As Boolean - - Private additionalCosts3Field As Decimal - - Private additionalCosts3FieldSpecified As Boolean - - Private additionalCosts4Field As Decimal - - Private additionalCosts4FieldSpecified As Boolean - - Private additionalCosts5Field As Decimal - - Private additionalCosts5FieldSpecified As Boolean - - Private additionalCosts6Field As Decimal - - Private additionalCosts6FieldSpecified As Boolean - - Private additionalCosts7Field As Decimal - - Private additionalCosts7FieldSpecified As Boolean - - Private additionalCosts8Field As Decimal - - Private additionalCosts8FieldSpecified As Boolean - - Private additionalCosts9Field As Decimal - - Private additionalCosts9FieldSpecified As Boolean - - Private additionalCosts10Field As Decimal - - Private additionalCosts10FieldSpecified As Boolean - - Private additionalCosts11Field As Decimal - - Private additionalCosts11FieldSpecified As Boolean - - Private additionalCosts12Field As Decimal - - Private additionalCosts12FieldSpecified As Boolean - - Private additionalCosts13Field As Decimal - - Private additionalCosts13FieldSpecified As Boolean - - Private additionalCosts14Field As Decimal - - Private additionalCosts14FieldSpecified As Boolean - - Private additionalCosts15Field As Decimal - - Private additionalCosts15FieldSpecified As Boolean - - Private additionalCosts16Field As Decimal - - Private additionalCosts16FieldSpecified As Boolean - - Private additionalCosts17Field As Decimal - - Private additionalCosts17FieldSpecified As Boolean - - Private additionalCosts18Field As Decimal - - Private additionalCosts18FieldSpecified As Boolean - - Private additionalCosts19Field As Decimal - - Private additionalCosts19FieldSpecified As Boolean - - Private additionalCosts20Field As Decimal - - Private additionalCosts20FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property additionalStatisticalValue() As Decimal - Get - Return Me.additionalStatisticalValueField - End Get - Set - Me.additionalStatisticalValueField = Value - End Set - End Property - - - Public Property additionalStatisticalValueSpecified() As Boolean - Get - Return Me.additionalStatisticalValueFieldSpecified - End Get - Set - Me.additionalStatisticalValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCostsVat() As Decimal - Get - Return Me.additionalCostsVatField - End Get - Set - Me.additionalCostsVatField = Value - End Set - End Property - - - Public Property additionalCostsVatSpecified() As Boolean - Get - Return Me.additionalCostsVatFieldSpecified - End Get - Set - Me.additionalCostsVatFieldSpecified = Value - End Set - End Property - - Public Property addStatisticValue() As Decimal - Get - Return Me.addStatisticValueField - End Get - Set - Me.addStatisticValueField = Value - End Set - End Property - - - Public Property addStatisticValueSpecified() As Boolean - Get - Return Me.addStatisticValueFieldSpecified - End Get - Set - Me.addStatisticValueFieldSpecified = Value - End Set - End Property - - Public Property oprIngredientsValue() As Decimal - Get - Return Me.oprIngredientsValueField - End Get - Set - Me.oprIngredientsValueField = Value - End Set - End Property - - - Public Property oprIngredientsValueSpecified() As Boolean - Get - Return Me.oprIngredientsValueFieldSpecified - End Get - Set - Me.oprIngredientsValueFieldSpecified = Value - End Set - End Property - - Public Property additionalCosts1() As Decimal - Get - Return Me.additionalCosts1Field - End Get - Set - Me.additionalCosts1Field = Value - End Set - End Property - - - Public Property additionalCosts1Specified() As Boolean - Get - Return Me.additionalCosts1FieldSpecified - End Get - Set - Me.additionalCosts1FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts2() As Decimal - Get - Return Me.additionalCosts2Field - End Get - Set - Me.additionalCosts2Field = Value - End Set - End Property - - - Public Property additionalCosts2Specified() As Boolean - Get - Return Me.additionalCosts2FieldSpecified - End Get - Set - Me.additionalCosts2FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts3() As Decimal - Get - Return Me.additionalCosts3Field - End Get - Set - Me.additionalCosts3Field = Value - End Set - End Property - - - Public Property additionalCosts3Specified() As Boolean - Get - Return Me.additionalCosts3FieldSpecified - End Get - Set - Me.additionalCosts3FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts4() As Decimal - Get - Return Me.additionalCosts4Field - End Get - Set - Me.additionalCosts4Field = Value - End Set - End Property - - - Public Property additionalCosts4Specified() As Boolean - Get - Return Me.additionalCosts4FieldSpecified - End Get - Set - Me.additionalCosts4FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts5() As Decimal - Get - Return Me.additionalCosts5Field - End Get - Set - Me.additionalCosts5Field = Value - End Set - End Property - - - Public Property additionalCosts5Specified() As Boolean - Get - Return Me.additionalCosts5FieldSpecified - End Get - Set - Me.additionalCosts5FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts6() As Decimal - Get - Return Me.additionalCosts6Field - End Get - Set - Me.additionalCosts6Field = Value - End Set - End Property - - - Public Property additionalCosts6Specified() As Boolean - Get - Return Me.additionalCosts6FieldSpecified - End Get - Set - Me.additionalCosts6FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts7() As Decimal - Get - Return Me.additionalCosts7Field - End Get - Set - Me.additionalCosts7Field = Value - End Set - End Property - - - Public Property additionalCosts7Specified() As Boolean - Get - Return Me.additionalCosts7FieldSpecified - End Get - Set - Me.additionalCosts7FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts8() As Decimal - Get - Return Me.additionalCosts8Field - End Get - Set - Me.additionalCosts8Field = Value - End Set - End Property - - - Public Property additionalCosts8Specified() As Boolean - Get - Return Me.additionalCosts8FieldSpecified - End Get - Set - Me.additionalCosts8FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts9() As Decimal - Get - Return Me.additionalCosts9Field - End Get - Set - Me.additionalCosts9Field = Value - End Set - End Property - - - Public Property additionalCosts9Specified() As Boolean - Get - Return Me.additionalCosts9FieldSpecified - End Get - Set - Me.additionalCosts9FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts10() As Decimal - Get - Return Me.additionalCosts10Field - End Get - Set - Me.additionalCosts10Field = Value - End Set - End Property - - - Public Property additionalCosts10Specified() As Boolean - Get - Return Me.additionalCosts10FieldSpecified - End Get - Set - Me.additionalCosts10FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts11() As Decimal - Get - Return Me.additionalCosts11Field - End Get - Set - Me.additionalCosts11Field = Value - End Set - End Property - - - Public Property additionalCosts11Specified() As Boolean - Get - Return Me.additionalCosts11FieldSpecified - End Get - Set - Me.additionalCosts11FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts12() As Decimal - Get - Return Me.additionalCosts12Field - End Get - Set - Me.additionalCosts12Field = Value - End Set - End Property - - - Public Property additionalCosts12Specified() As Boolean - Get - Return Me.additionalCosts12FieldSpecified - End Get - Set - Me.additionalCosts12FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts13() As Decimal - Get - Return Me.additionalCosts13Field - End Get - Set - Me.additionalCosts13Field = Value - End Set - End Property - - - Public Property additionalCosts13Specified() As Boolean - Get - Return Me.additionalCosts13FieldSpecified - End Get - Set - Me.additionalCosts13FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts14() As Decimal - Get - Return Me.additionalCosts14Field - End Get - Set - Me.additionalCosts14Field = Value - End Set - End Property - - - Public Property additionalCosts14Specified() As Boolean - Get - Return Me.additionalCosts14FieldSpecified - End Get - Set - Me.additionalCosts14FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts15() As Decimal - Get - Return Me.additionalCosts15Field - End Get - Set - Me.additionalCosts15Field = Value - End Set - End Property - - - Public Property additionalCosts15Specified() As Boolean - Get - Return Me.additionalCosts15FieldSpecified - End Get - Set - Me.additionalCosts15FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts16() As Decimal - Get - Return Me.additionalCosts16Field - End Get - Set - Me.additionalCosts16Field = Value - End Set - End Property - - - Public Property additionalCosts16Specified() As Boolean - Get - Return Me.additionalCosts16FieldSpecified - End Get - Set - Me.additionalCosts16FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts17() As Decimal - Get - Return Me.additionalCosts17Field - End Get - Set - Me.additionalCosts17Field = Value - End Set - End Property - - - Public Property additionalCosts17Specified() As Boolean - Get - Return Me.additionalCosts17FieldSpecified - End Get - Set - Me.additionalCosts17FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts18() As Decimal - Get - Return Me.additionalCosts18Field - End Get - Set - Me.additionalCosts18Field = Value - End Set - End Property - - - Public Property additionalCosts18Specified() As Boolean - Get - Return Me.additionalCosts18FieldSpecified - End Get - Set - Me.additionalCosts18FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts19() As Decimal - Get - Return Me.additionalCosts19Field - End Get - Set - Me.additionalCosts19Field = Value - End Set - End Property - - - Public Property additionalCosts19Specified() As Boolean - Get - Return Me.additionalCosts19FieldSpecified - End Get - Set - Me.additionalCosts19FieldSpecified = Value - End Set - End Property - - Public Property additionalCosts20() As Decimal - Get - Return Me.additionalCosts20Field - End Get - Set - Me.additionalCosts20Field = Value - End Set - End Property - - - Public Property additionalCosts20Specified() As Boolean - Get - Return Me.additionalCosts20FieldSpecified - End Get - Set - Me.additionalCosts20FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValuesCust)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValuesCust object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValuesCust object - ''' - '''string workflow markup to deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValuesCust) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValuesCust - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValuesCust) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValuesCust 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValuesCust object - ''' - '''string xml file to load and deserialize - '''Output TCalcValuesCust object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValuesCust, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValuesCust) - 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 TCalcValuesCust) 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 TCalcValuesCust - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCalcValues - - Private customsValueField As Decimal - - Private customsValueFieldSpecified As Boolean - - Private netValueField As Decimal - - Private netValueFieldSpecified As Boolean - - Private statValueField As Decimal - - Private statValueFieldSpecified As Boolean - - Private freightStatValField As Decimal - - Private freightStatValFieldSpecified As Boolean - - Private freightInternationalField As Decimal - - Private freightInternationalFieldSpecified As Boolean - - Private freightEUField As Decimal - - Private freightEUFieldSpecified As Boolean - - Private freightNationalField As Decimal - - Private freightNationalFieldSpecified As Boolean - - Private insuranceField As Decimal - - Private insuranceFieldSpecified As Boolean - - Private shipAddCostsField As List(Of Decimal) - - Private invAddCostsField As List(Of Decimal) - - Private lineAddCostsField As List(Of Decimal) - - Private custValueField As Decimal - - Private custValueFieldSpecified As Boolean - - Private assistValueField As Decimal - - Private assistValueFieldSpecified As Boolean - - Private vatAddCostsField As Decimal - - Private vatAddCostsFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.lineAddCostsField = New List(Of Decimal)() - Me.invAddCostsField = New List(Of Decimal)() - Me.shipAddCostsField = New List(Of Decimal)() - End Sub - - Public Property customsValue() As Decimal - Get - Return Me.customsValueField - End Get - Set - Me.customsValueField = Value - End Set - End Property - - - Public Property customsValueSpecified() As Boolean - Get - Return Me.customsValueFieldSpecified - End Get - Set - Me.customsValueFieldSpecified = Value - End Set - End Property - - Public Property netValue() As Decimal - Get - Return Me.netValueField - End Get - Set - Me.netValueField = Value - End Set - End Property - - - Public Property netValueSpecified() As Boolean - Get - Return Me.netValueFieldSpecified - End Get - Set - Me.netValueFieldSpecified = Value - End Set - End Property - - Public Property statValue() As Decimal - Get - Return Me.statValueField - End Get - Set - Me.statValueField = Value - End Set - End Property - - - Public Property statValueSpecified() As Boolean - Get - Return Me.statValueFieldSpecified - End Get - Set - Me.statValueFieldSpecified = Value - End Set - End Property - - Public Property freightStatVal() As Decimal - Get - Return Me.freightStatValField - End Get - Set - Me.freightStatValField = Value - End Set - End Property - - - Public Property freightStatValSpecified() As Boolean - Get - Return Me.freightStatValFieldSpecified - End Get - Set - Me.freightStatValFieldSpecified = Value - End Set - End Property - - Public Property freightInternational() As Decimal - Get - Return Me.freightInternationalField - End Get - Set - Me.freightInternationalField = Value - End Set - End Property - - - Public Property freightInternationalSpecified() As Boolean - Get - Return Me.freightInternationalFieldSpecified - End Get - Set - Me.freightInternationalFieldSpecified = Value - End Set - End Property - - Public Property freightEU() As Decimal - Get - Return Me.freightEUField - End Get - Set - Me.freightEUField = Value - End Set - End Property - - - Public Property freightEUSpecified() As Boolean - Get - Return Me.freightEUFieldSpecified - End Get - Set - Me.freightEUFieldSpecified = Value - End Set - End Property - - Public Property freightNational() As Decimal - Get - Return Me.freightNationalField - End Get - Set - Me.freightNationalField = Value - End Set - End Property - - - Public Property freightNationalSpecified() As Boolean - Get - Return Me.freightNationalFieldSpecified - End Get - Set - Me.freightNationalFieldSpecified = Value - End Set - End Property - - Public Property insurance() As Decimal - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - - Public Property insuranceSpecified() As Boolean - Get - Return Me.insuranceFieldSpecified - End Get - Set - Me.insuranceFieldSpecified = Value - End Set - End Property - - Public Property shipAddCosts() As List(Of Decimal) - Get - Return Me.shipAddCostsField - End Get - Set - Me.shipAddCostsField = Value - End Set - End Property - - Public Property invAddCosts() As List(Of Decimal) - Get - Return Me.invAddCostsField - End Get - Set - Me.invAddCostsField = Value - End Set - End Property - - Public Property lineAddCosts() As List(Of Decimal) - Get - Return Me.lineAddCostsField - End Get - Set - Me.lineAddCostsField = Value - End Set - End Property - - Public Property custValue() As Decimal - Get - Return Me.custValueField - End Get - Set - Me.custValueField = Value - End Set - End Property - - - Public Property custValueSpecified() As Boolean - Get - Return Me.custValueFieldSpecified - End Get - Set - Me.custValueFieldSpecified = Value - End Set - End Property - - Public Property assistValue() As Decimal - Get - Return Me.assistValueField - End Get - Set - Me.assistValueField = Value - End Set - End Property - - - Public Property assistValueSpecified() As Boolean - Get - Return Me.assistValueFieldSpecified - End Get - Set - Me.assistValueFieldSpecified = Value - End Set - End Property - - Public Property vatAddCosts() As Decimal - Get - Return Me.vatAddCostsField - End Get - Set - Me.vatAddCostsField = Value - End Set - End Property - - - Public Property vatAddCostsSpecified() As Boolean - Get - Return Me.vatAddCostsFieldSpecified - End Get - Set - Me.vatAddCostsFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCalcValues)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCalcValues object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCalcValues object - ''' - '''string workflow markup to deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCalcValues) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCalcValues - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCalcValues) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCalcValues 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCalcValues object - ''' - '''string xml file to load and deserialize - '''Output TCalcValues object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCalcValues, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCalcValues) - 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 TCalcValues) 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 TCalcValues - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportRegistrationNo - - Private registrationNumber1Field As String - - Private registrationNumber2Field As String - - Private registrationNumber3Field As String - - Private registrationNumber4Field As String - - Private messageRefNumber1Field As String - - Private messageRefNumber2Field As String - - Private messageRefNumber3Field As String - - Private positionNumber1Field As Decimal - - Private positionNumber1FieldSpecified As Boolean - - Private positionNumber2Field As Decimal - - Private positionNumber2FieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property registrationNumber1() As String - Get - Return Me.registrationNumber1Field - End Get - Set - Me.registrationNumber1Field = Value - End Set - End Property - - Public Property registrationNumber2() As String - Get - Return Me.registrationNumber2Field - End Get - Set - Me.registrationNumber2Field = Value - End Set - End Property - - Public Property registrationNumber3() As String - Get - Return Me.registrationNumber3Field - End Get - Set - Me.registrationNumber3Field = Value - End Set - End Property - - Public Property registrationNumber4() As String - Get - Return Me.registrationNumber4Field - End Get - Set - Me.registrationNumber4Field = Value - End Set - End Property - - Public Property messageRefNumber1() As String - Get - Return Me.messageRefNumber1Field - End Get - Set - Me.messageRefNumber1Field = Value - End Set - End Property - - Public Property messageRefNumber2() As String - Get - Return Me.messageRefNumber2Field - End Get - Set - Me.messageRefNumber2Field = Value - End Set - End Property - - Public Property messageRefNumber3() As String - Get - Return Me.messageRefNumber3Field - End Get - Set - Me.messageRefNumber3Field = Value - End Set - End Property - - Public Property positionNumber1() As Decimal - Get - Return Me.positionNumber1Field - End Get - Set - Me.positionNumber1Field = Value - End Set - End Property - - - Public Property positionNumber1Specified() As Boolean - Get - Return Me.positionNumber1FieldSpecified - End Get - Set - Me.positionNumber1FieldSpecified = Value - End Set - End Property - - Public Property positionNumber2() As Decimal - Get - Return Me.positionNumber2Field - End Get - Set - Me.positionNumber2Field = Value - End Set - End Property - - - Public Property positionNumber2Specified() As Boolean - Get - Return Me.positionNumber2FieldSpecified - End Get - Set - Me.positionNumber2FieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportRegistrationNo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportRegistrationNo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportRegistrationNo object - ''' - '''string workflow markup to deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportRegistrationNo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportRegistrationNo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportRegistrationNo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportRegistrationNo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportRegistrationNo object - ''' - '''string xml file to load and deserialize - '''Output TImportRegistrationNo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportRegistrationNo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportRegistrationNo) - 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 TImportRegistrationNo) 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 TImportRegistrationNo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReceipt - - Private receiptNumberField As String - - Private receiptDateField As Date - - Private receiptDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property receiptNumber() As String - Get - Return Me.receiptNumberField - End Get - Set - Me.receiptNumberField = Value - End Set - End Property - - Public Property receiptDate() As Date - Get - Return Me.receiptDateField - End Get - Set - Me.receiptDateField = Value - End Set - End Property - - - Public Property receiptDateSpecified() As Boolean - Get - Return Me.receiptDateFieldSpecified - End Get - Set - Me.receiptDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReceipt)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReceipt object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReceipt object - ''' - '''string workflow markup to deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReceipt) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReceipt - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReceipt) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TReceipt 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TReceipt object - ''' - '''string xml file to load and deserialize - '''Output TReceipt object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TReceipt, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReceipt) - 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 TReceipt) 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 TReceipt - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPackage - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private packageDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property packageDescription() As String - Get - Return Me.packageDescriptionField - End Get - Set - Me.packageDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPackage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPackage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPackage object - ''' - '''string workflow markup to deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPackage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPackage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPackage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPackage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPackage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TBom - - Private noField As String - - Private varField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property no() As String - Get - Return Me.noField - End Get - Set - Me.noField = Value - End Set - End Property - - Public Property var() As String - Get - Return Me.varField - End Get - Set - Me.varField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TBom)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TBom object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TBom object - ''' - '''string workflow markup to deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TBom) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TBom - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TBom) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TBom 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TBom object - ''' - '''string xml file to load and deserialize - '''Output TBom object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TBom, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TBom) - 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 TBom) 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 TBom - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCostsVAT - - Private addAmountVATField As Decimal - - Private addAmountVATFieldSpecified As Boolean - - Private addCurrencyVATField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addAmountVAT() As Decimal - Get - Return Me.addAmountVATField - End Get - Set - Me.addAmountVATField = Value - End Set - End Property - - - Public Property addAmountVATSpecified() As Boolean - Get - Return Me.addAmountVATFieldSpecified - End Get - Set - Me.addAmountVATFieldSpecified = Value - End Set - End Property - - Public Property addCurrencyVAT() As String - Get - Return Me.addCurrencyVATField - End Get - Set - Me.addCurrencyVATField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCostsVAT)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCostsVAT object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCostsVAT object - ''' - '''string workflow markup to deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCostsVAT) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCostsVAT - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCostsVAT) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAddCostsVAT 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAddCostsVAT object - ''' - '''string xml file to load and deserialize - '''Output TAddCostsVAT object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAddCostsVAT, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCostsVAT) - 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 TAddCostsVAT) 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 TAddCostsVAT - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebateLine - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebateLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebateLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebateLine object - ''' - '''string workflow markup to deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebateLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebateLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebateLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebateLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebateLine object - ''' - '''string xml file to load and deserialize - '''Output TRebateLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebateLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebateLine) - 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 TRebateLine) 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 TRebateLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsLine - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsLine) - 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 TInsuranceCostsLine) 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 TInsuranceCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsLine - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtFlagPercentOrValueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.frtFlagPercentOrValueField = "P" - End Sub - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - - Public Property frtFlagPercentOrValue() As String - Get - Return Me.frtFlagPercentOrValueField - End Get - Set - Me.frtFlagPercentOrValueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsLine object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsLine 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsLine object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsLine) - 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 TFreightCostsLine) 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 TFreightCostsLine - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPricing - - Private prcTypeField As String - - Private prcReferenceField As String - - Private prcDateField As Date - - Private prcDateFieldSpecified As Boolean - - Private prcSystemField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property prcType() As String - Get - Return Me.prcTypeField - End Get - Set - Me.prcTypeField = Value - End Set - End Property - - Public Property prcReference() As String - Get - Return Me.prcReferenceField - End Get - Set - Me.prcReferenceField = Value - End Set - End Property - - Public Property prcDate() As Date - Get - Return Me.prcDateField - End Get - Set - Me.prcDateField = Value - End Set - End Property - - - Public Property prcDateSpecified() As Boolean - Get - Return Me.prcDateFieldSpecified - End Get - Set - Me.prcDateFieldSpecified = Value - End Set - End Property - - Public Property prcSystem() As String - Get - Return Me.prcSystemField - End Get - Set - Me.prcSystemField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPricing)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPricing object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPricing object - ''' - '''string workflow markup to deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPricing) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPricing - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPricing) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPricing 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPricing object - ''' - '''string xml file to load and deserialize - '''Output TPricing object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPricing, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPricing) - 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 TPricing) 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 TPricing - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportLineLicense - - Private typeField As String - - Private codeField As String - - Private numberField As String - - Private dateField As Date - - Private dateFieldSpecified As Boolean - - Private notRequiredField As Boolean - - Private notRequiredFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property number() As String - Get - Return Me.numberField - End Get - Set - Me.numberField = Value - End Set - End Property - - Public Property [date]() As Date - Get - Return Me.dateField - End Get - Set - Me.dateField = Value - End Set - End Property - - - Public Property dateSpecified() As Boolean - Get - Return Me.dateFieldSpecified - End Get - Set - Me.dateFieldSpecified = Value - End Set - End Property - - Public Property notRequired() As Boolean - Get - Return Me.notRequiredField - End Get - Set - Me.notRequiredField = Value - End Set - End Property - - - Public Property notRequiredSpecified() As Boolean - Get - Return Me.notRequiredFieldSpecified - End Get - Set - Me.notRequiredFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportLineLicense)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportLineLicense object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportLineLicense object - ''' - '''string workflow markup to deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportLineLicense) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportLineLicense - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportLineLicense) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportLineLicense 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportLineLicense object - ''' - '''string xml file to load and deserialize - '''Output TImportLineLicense object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportLineLicense, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportLineLicense) - 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 TImportLineLicense) 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 TImportLineLicense - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TTariffCode - - Private hsCodeField As String - - Private vatCodeField As String - - Private exciseTaxCodeField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property hsCode() As String - Get - Return Me.hsCodeField - End Get - Set - Me.hsCodeField = Value - End Set - End Property - - Public Property vatCode() As String - Get - Return Me.vatCodeField - End Get - Set - Me.vatCodeField = Value - End Set - End Property - - Public Property exciseTaxCode() As String - Get - Return Me.exciseTaxCodeField - End Get - Set - Me.exciseTaxCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TTariffCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TTariffCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TTariffCode object - ''' - '''string workflow markup to deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TTariffCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TTariffCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TTariffCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TTariffCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TTariffCode object - ''' - '''string xml file to load and deserialize - '''Output TTariffCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TTariffCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TTariffCode) - 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 TTariffCode) 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 TTariffCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TItem - - Private partNumberField As String - - Private partDescriptionField As String - - Private serialNumberField As String - - Private productGroupField As String - - Private modelField As String - - Private brandField As String - - Private manufacturerNumberField As String - - Private ctoNumberField As String - - Private confidenceLevelField As Long - - Private confidenceLevelFieldSpecified As Boolean - - Private productCategoryField As String - - Private tariffCodeField As TTariffCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.tariffCodeField = New TTariffCode() - End Sub - - Public Property partNumber() As String - Get - Return Me.partNumberField - End Get - Set - Me.partNumberField = Value - End Set - End Property - - Public Property partDescription() As String - Get - Return Me.partDescriptionField - End Get - Set - Me.partDescriptionField = Value - End Set - End Property - - Public Property serialNumber() As String - Get - Return Me.serialNumberField - End Get - Set - Me.serialNumberField = Value - End Set - End Property - - Public Property productGroup() As String - Get - Return Me.productGroupField - End Get - Set - Me.productGroupField = Value - End Set - End Property - - Public Property model() As String - Get - Return Me.modelField - End Get - Set - Me.modelField = Value - End Set - End Property - - Public Property brand() As String - Get - Return Me.brandField - End Get - Set - Me.brandField = Value - End Set - End Property - - Public Property manufacturerNumber() As String - Get - Return Me.manufacturerNumberField - End Get - Set - Me.manufacturerNumberField = Value - End Set - End Property - - Public Property ctoNumber() As String - Get - Return Me.ctoNumberField - End Get - Set - Me.ctoNumberField = Value - End Set - End Property - - Public Property confidenceLevel() As Long - Get - Return Me.confidenceLevelField - End Get - Set - Me.confidenceLevelField = Value - End Set - End Property - - - Public Property confidenceLevelSpecified() As Boolean - Get - Return Me.confidenceLevelFieldSpecified - End Get - Set - Me.confidenceLevelFieldSpecified = Value - End Set - End Property - - Public Property productCategory() As String - Get - Return Me.productCategoryField - End Get - Set - Me.productCategoryField = Value - End Set - End Property - - Public Property TariffCode() As TTariffCode - Get - Return Me.tariffCodeField - End Get - Set - Me.tariffCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TItem)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TItem object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TItem object - ''' - '''string workflow markup to deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TItem) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TItem) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TItem - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TItem) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TItem object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceLine - - Private lineNumberField As Decimal - - Private itemField As TItem - - Private quantityField As Decimal - - Private quantityFieldSpecified As Boolean - - Private quantityUomField As String - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private reportingQuantityField As Decimal - - Private reportingQuantityFieldSpecified As Boolean - - Private reportingQuantityUomField As String - - Private priceField As Decimal - - Private priceFieldSpecified As Boolean - - Private lineValueField As Decimal - - Private lineValueFieldSpecified As Boolean - - Private licenseField As TImportLineLicense - - Private pricingField As TPricing - - Private freightCostsField As TFreightCostsLine - - Private insuranceCostsField As TInsuranceCostsLine - - Private additionalCostField As List(Of TAddCosts) - - Private rebateField As TRebateLine - - Private additionalCostsVATField As TAddCostsVAT - - Private countryOfOriginField As String - - Private prefCountryOfOriginField As String - - Private locationOfGoodsField As String - - Private importQuotaField As String - - Private importQuotaKeyField As String - - Private importQuotaQuantityField As Decimal - - Private importQuotaQuantityFieldSpecified As Boolean - - Private importQuotaUnitOfMeasurementField As String - - Private importQuotaQualifierField As String - - Private customsProcedureField As String - - Private statisticalCodeField As String - - Private endUseIndicatorField As String - - Private transactionTypeField As String - - Private addCodeField As List(Of String) - - Private prefRequestCodeField As String - - Private documentsField As List(Of TDocument) - - Private previousDocumentField As List(Of TPrevDoc) - - Private bOMField As TBom - - Private stockTypeField As String - - Private stockType2Field As String - - Private stockExpiryDateField As Date - - Private stockExpiryDateFieldSpecified As Boolean - - Private packageField As TPackage - - Private accountNumberField As String - - Private deliveryNoteField As String - - Private orderNumberField As String - - Private receiptField As TReceipt - - Private asnNumberField As String - - Private referenceValueField As Decimal - - Private referenceValueFieldSpecified As Boolean - - Private referenceCurrencyField As String - - Private textField As String - - Private text2Field As String - - Private registrationNumbersField As TImportRegistrationNo - - Private customerFieldsField As TCustomerFields - - Private attributesField As List(Of TAttribute) - - Private containerInfoField As List(Of TDetailContainerInfo) - - Private partnersField As List(Of TPartner) - - Private calculatedValuesField As TCalcValues - - Private calculatedValuesCustField As TCalcValuesCust - - Private dutiesField As List(Of TDuty) - - Private dutyTaxesField As List(Of TDutyTax) - - Private dutySavingsField As List(Of TDutySaving) - - Private oprDetailsField As TOprInfo - - Private uniqueIdField As Decimal - - Private uniqueIdFieldSpecified As Boolean - - Private externalProcessingField As String - - Private additionalInformationField As List(Of TAttribute) - - Private intraField As TCustIntraLine - - Private preSupplierField As TPreSupplier - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private valuationIndicatorField As String - - Private referencePreviousProceduresField As List(Of TRefPrevProcedure) - - Private packagesDataField As TPackagesData - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.packagesDataField = New TPackagesData() - Me.referencePreviousProceduresField = New List(Of TRefPrevProcedure)() - Me.preSupplierField = New TPreSupplier() - Me.intraField = New TCustIntraLine() - Me.additionalInformationField = New List(Of TAttribute)() - Me.oprDetailsField = New TOprInfo() - Me.dutySavingsField = New List(Of TDutySaving)() - Me.dutyTaxesField = New List(Of TDutyTax)() - Me.dutiesField = New List(Of TDuty)() - Me.calculatedValuesCustField = New TCalcValuesCust() - Me.calculatedValuesField = New TCalcValues() - Me.partnersField = New List(Of TPartner)() - Me.containerInfoField = New List(Of TDetailContainerInfo)() - Me.attributesField = New List(Of TAttribute)() - Me.customerFieldsField = New TCustomerFields() - Me.registrationNumbersField = New TImportRegistrationNo() - Me.receiptField = New TReceipt() - Me.packageField = New TPackage() - Me.bOMField = New TBom() - Me.previousDocumentField = New List(Of TPrevDoc)() - Me.documentsField = New List(Of TDocument)() - Me.addCodeField = New List(Of String)() - Me.additionalCostsVATField = New TAddCostsVAT() - Me.rebateField = New TRebateLine() - Me.additionalCostField = New List(Of TAddCosts)() - Me.insuranceCostsField = New TInsuranceCostsLine() - Me.freightCostsField = New TFreightCostsLine() - Me.pricingField = New TPricing() - Me.licenseField = New TImportLineLicense() - Me.itemField = New TItem() - End Sub - - Public Property lineNumber() As Decimal - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - Public Property Item() As TItem - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - Public Property quantity() As Decimal - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property quantityUom() As String - Get - Return Me.quantityUomField - End Get - Set - Me.quantityUomField = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantity() As Decimal - Get - Return Me.reportingQuantityField - End Get - Set - Me.reportingQuantityField = Value - End Set - End Property - - - Public Property reportingQuantitySpecified() As Boolean - Get - Return Me.reportingQuantityFieldSpecified - End Get - Set - Me.reportingQuantityFieldSpecified = Value - End Set - End Property - - Public Property reportingQuantityUom() As String - Get - Return Me.reportingQuantityUomField - End Get - Set - Me.reportingQuantityUomField = Value - End Set - End Property - - Public Property price() As Decimal - Get - Return Me.priceField - End Get - Set - Me.priceField = Value - End Set - End Property - - - Public Property priceSpecified() As Boolean - Get - Return Me.priceFieldSpecified - End Get - Set - Me.priceFieldSpecified = Value - End Set - End Property - - Public Property lineValue() As Decimal - Get - Return Me.lineValueField - End Get - Set - Me.lineValueField = Value - End Set - End Property - - - Public Property lineValueSpecified() As Boolean - Get - Return Me.lineValueFieldSpecified - End Get - Set - Me.lineValueFieldSpecified = Value - End Set - End Property - - Public Property License() As TImportLineLicense - Get - Return Me.licenseField - End Get - Set - Me.licenseField = Value - End Set - End Property - - Public Property Pricing() As TPricing - Get - Return Me.pricingField - End Get - Set - Me.pricingField = Value - End Set - End Property - - Public Property FreightCosts() As TFreightCostsLine - Get - Return Me.freightCostsField - End Get - Set - Me.freightCostsField = Value - End Set - End Property - - Public Property InsuranceCosts() As TInsuranceCostsLine - Get - Return Me.insuranceCostsField - End Get - Set - Me.insuranceCostsField = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property Rebate() As TRebateLine - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property AdditionalCostsVAT() As TAddCostsVAT - Get - Return Me.additionalCostsVATField - End Get - Set - Me.additionalCostsVATField = Value - End Set - End Property - - Public Property countryOfOrigin() As String - Get - Return Me.countryOfOriginField - End Get - Set - Me.countryOfOriginField = Value - End Set - End Property - - Public Property prefCountryOfOrigin() As String - Get - Return Me.prefCountryOfOriginField - End Get - Set - Me.prefCountryOfOriginField = Value - End Set - End Property - - Public Property locationOfGoods() As String - Get - Return Me.locationOfGoodsField - End Get - Set - Me.locationOfGoodsField = Value - End Set - End Property - - Public Property importQuota() As String - Get - Return Me.importQuotaField - End Get - Set - Me.importQuotaField = Value - End Set - End Property - - Public Property importQuotaKey() As String - Get - Return Me.importQuotaKeyField - End Get - Set - Me.importQuotaKeyField = Value - End Set - End Property - - Public Property importQuotaQuantity() As Decimal - Get - Return Me.importQuotaQuantityField - End Get - Set - Me.importQuotaQuantityField = Value - End Set - End Property - - - Public Property importQuotaQuantitySpecified() As Boolean - Get - Return Me.importQuotaQuantityFieldSpecified - End Get - Set - Me.importQuotaQuantityFieldSpecified = Value - End Set - End Property - - Public Property importQuotaUnitOfMeasurement() As String - Get - Return Me.importQuotaUnitOfMeasurementField - End Get - Set - Me.importQuotaUnitOfMeasurementField = Value - End Set - End Property - - Public Property importQuotaQualifier() As String - Get - Return Me.importQuotaQualifierField - End Get - Set - Me.importQuotaQualifierField = Value - End Set - End Property - - Public Property customsProcedure() As String - Get - Return Me.customsProcedureField - End Get - Set - Me.customsProcedureField = Value - End Set - End Property - - Public Property statisticalCode() As String - Get - Return Me.statisticalCodeField - End Get - Set - Me.statisticalCodeField = Value - End Set - End Property - - Public Property endUseIndicator() As String - Get - Return Me.endUseIndicatorField - End Get - Set - Me.endUseIndicatorField = Value - End Set - End Property - - Public Property transactionType() As String - Get - Return Me.transactionTypeField - End Get - Set - Me.transactionTypeField = Value - End Set - End Property - - Public Property addCode() As List(Of String) - Get - Return Me.addCodeField - End Get - Set - Me.addCodeField = Value - End Set - End Property - - Public Property prefRequestCode() As String - Get - Return Me.prefRequestCodeField - End Get - Set - Me.prefRequestCodeField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property PreviousDocument() As List(Of TPrevDoc) - Get - Return Me.previousDocumentField - End Get - Set - Me.previousDocumentField = Value - End Set - End Property - - Public Property BOM() As TBom - Get - Return Me.bOMField - End Get - Set - Me.bOMField = Value - End Set - End Property - - Public Property stockType() As String - Get - Return Me.stockTypeField - End Get - Set - Me.stockTypeField = Value - End Set - End Property - - Public Property stockType2() As String - Get - Return Me.stockType2Field - End Get - Set - Me.stockType2Field = Value - End Set - End Property - - Public Property stockExpiryDate() As Date - Get - Return Me.stockExpiryDateField - End Get - Set - Me.stockExpiryDateField = Value - End Set - End Property - - - Public Property stockExpiryDateSpecified() As Boolean - Get - Return Me.stockExpiryDateFieldSpecified - End Get - Set - Me.stockExpiryDateFieldSpecified = Value - End Set - End Property - - Public Property Package() As TPackage - Get - Return Me.packageField - End Get - Set - Me.packageField = Value - End Set - End Property - - Public Property accountNumber() As String - Get - Return Me.accountNumberField - End Get - Set - Me.accountNumberField = Value - End Set - End Property - - Public Property deliveryNote() As String - Get - Return Me.deliveryNoteField - End Get - Set - Me.deliveryNoteField = Value - End Set - End Property - - Public Property orderNumber() As String - Get - Return Me.orderNumberField - End Get - Set - Me.orderNumberField = Value - End Set - End Property - - Public Property Receipt() As TReceipt - Get - Return Me.receiptField - End Get - Set - Me.receiptField = Value - End Set - End Property - - Public Property asnNumber() As String - Get - Return Me.asnNumberField - End Get - Set - Me.asnNumberField = Value - End Set - End Property - - Public Property referenceValue() As Decimal - Get - Return Me.referenceValueField - End Get - Set - Me.referenceValueField = Value - End Set - End Property - - - Public Property referenceValueSpecified() As Boolean - Get - Return Me.referenceValueFieldSpecified - End Get - Set - Me.referenceValueFieldSpecified = Value - End Set - End Property - - Public Property referenceCurrency() As String - Get - Return Me.referenceCurrencyField - End Get - Set - Me.referenceCurrencyField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property RegistrationNumbers() As TImportRegistrationNo - Get - Return Me.registrationNumbersField - End Get - Set - Me.registrationNumbersField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property ContainerInfo() As List(Of TDetailContainerInfo) - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - Public Property CalculatedValues() As TCalcValues - Get - Return Me.calculatedValuesField - End Get - Set - Me.calculatedValuesField = Value - End Set - End Property - - Public Property CalculatedValuesCust() As TCalcValuesCust - Get - Return Me.calculatedValuesCustField - End Get - Set - Me.calculatedValuesCustField = Value - End Set - End Property - - - Public Property Duties() As List(Of TDuty) - Get - Return Me.dutiesField - End Get - Set - Me.dutiesField = Value - End Set - End Property - - - Public Property DutyTaxes() As List(Of TDutyTax) - Get - Return Me.dutyTaxesField - End Get - Set - Me.dutyTaxesField = Value - End Set - End Property - - - Public Property DutySavings() As List(Of TDutySaving) - Get - Return Me.dutySavingsField - End Get - Set - Me.dutySavingsField = Value - End Set - End Property - - Public Property OprDetails() As TOprInfo - Get - Return Me.oprDetailsField - End Get - Set - Me.oprDetailsField = Value - End Set - End Property - - Public Property uniqueId() As Decimal - Get - Return Me.uniqueIdField - End Get - Set - Me.uniqueIdField = Value - End Set - End Property - - - Public Property uniqueIdSpecified() As Boolean - Get - Return Me.uniqueIdFieldSpecified - End Get - Set - Me.uniqueIdFieldSpecified = Value - End Set - End Property - - Public Property externalProcessing() As String - Get - Return Me.externalProcessingField - End Get - Set - Me.externalProcessingField = Value - End Set - End Property - - - Public Property AdditionalInformation() As List(Of TAttribute) - Get - Return Me.additionalInformationField - End Get - Set - Me.additionalInformationField = Value - End Set - End Property - - Public Property Intra() As TCustIntraLine - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - Public Property PreSupplier() As TPreSupplier - Get - Return Me.preSupplierField - End Get - Set - Me.preSupplierField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property valuationIndicator() As String - Get - Return Me.valuationIndicatorField - End Get - Set - Me.valuationIndicatorField = Value - End Set - End Property - - - Public Property ReferencePreviousProcedures() As List(Of TRefPrevProcedure) - Get - Return Me.referencePreviousProceduresField - End Get - Set - Me.referencePreviousProceduresField = Value - End Set - End Property - - Public Property PackagesData() As TPackagesData - Get - Return Me.packagesDataField - End Get - Set - Me.packagesDataField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceLine)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceLine object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceLine object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceLine) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceLine) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceLine - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceLine) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceLine object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddCosts - - Private addTypeField As String - - Private addAmountField As Decimal - - Private addAmountFieldSpecified As Boolean - - Private addCurrencyField As String - - Private addProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property addType() As String - Get - Return Me.addTypeField - End Get - Set - Me.addTypeField = Value - End Set - End Property - - Public Property addAmount() As Decimal - Get - Return Me.addAmountField - End Get - Set - Me.addAmountField = Value - End Set - End Property - - - Public Property addAmountSpecified() As Boolean - Get - Return Me.addAmountFieldSpecified - End Get - Set - Me.addAmountFieldSpecified = Value - End Set - End Property - - Public Property addCurrency() As String - Get - Return Me.addCurrencyField - End Get - Set - Me.addCurrencyField = Value - End Set - End Property - - Public Property addProRating() As String - Get - Return Me.addProRatingField - End Get - Set - Me.addProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddCosts object - ''' - '''string workflow markup to deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDocument - - Private docNoField As String - - Private docDateField As Date - - Private docDateFieldSpecified As Boolean - - Private docTypeField As String - - Private docQualField As String - - Private docValidFromField As Date - - Private docValidFromFieldSpecified As Boolean - - Private docValidToField As Date - - Private docValidToFieldSpecified As Boolean - - Private docAddTextField As String - - Private docQuantityField As Decimal - - Private docQuantityFieldSpecified As Boolean - - Private docUnitField As String - - Private docValueField As Decimal - - Private docValueFieldSpecified As Boolean - - Private docCategoryField As String - - Private docWriteOffQuantityField As Decimal - - Private docWriteOffQuantityFieldSpecified As Boolean - - Private docIssuerCountryField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property docNo() As String - Get - Return Me.docNoField - End Get - Set - Me.docNoField = Value - End Set - End Property - - Public Property docDate() As Date - Get - Return Me.docDateField - End Get - Set - Me.docDateField = Value - End Set - End Property - - - Public Property docDateSpecified() As Boolean - Get - Return Me.docDateFieldSpecified - End Get - Set - Me.docDateFieldSpecified = Value - End Set - End Property - - Public Property docType() As String - Get - Return Me.docTypeField - End Get - Set - Me.docTypeField = Value - End Set - End Property - - Public Property docQual() As String - Get - Return Me.docQualField - End Get - Set - Me.docQualField = Value - End Set - End Property - - Public Property docValidFrom() As Date - Get - Return Me.docValidFromField - End Get - Set - Me.docValidFromField = Value - End Set - End Property - - - Public Property docValidFromSpecified() As Boolean - Get - Return Me.docValidFromFieldSpecified - End Get - Set - Me.docValidFromFieldSpecified = Value - End Set - End Property - - Public Property docValidTo() As Date - Get - Return Me.docValidToField - End Get - Set - Me.docValidToField = Value - End Set - End Property - - - Public Property docValidToSpecified() As Boolean - Get - Return Me.docValidToFieldSpecified - End Get - Set - Me.docValidToFieldSpecified = Value - End Set - End Property - - Public Property docAddText() As String - Get - Return Me.docAddTextField - End Get - Set - Me.docAddTextField = Value - End Set - End Property - - Public Property docQuantity() As Decimal - Get - Return Me.docQuantityField - End Get - Set - Me.docQuantityField = Value - End Set - End Property - - - Public Property docQuantitySpecified() As Boolean - Get - Return Me.docQuantityFieldSpecified - End Get - Set - Me.docQuantityFieldSpecified = Value - End Set - End Property - - Public Property docUnit() As String - Get - Return Me.docUnitField - End Get - Set - Me.docUnitField = Value - End Set - End Property - - Public Property docValue() As Decimal - Get - Return Me.docValueField - End Get - Set - Me.docValueField = Value - End Set - End Property - - - Public Property docValueSpecified() As Boolean - Get - Return Me.docValueFieldSpecified - End Get - Set - Me.docValueFieldSpecified = Value - End Set - End Property - - Public Property docCategory() As String - Get - Return Me.docCategoryField - End Get - Set - Me.docCategoryField = Value - End Set - End Property - - Public Property docWriteOffQuantity() As Decimal - Get - Return Me.docWriteOffQuantityField - End Get - Set - Me.docWriteOffQuantityField = Value - End Set - End Property - - - Public Property docWriteOffQuantitySpecified() As Boolean - Get - Return Me.docWriteOffQuantityFieldSpecified - End Get - Set - Me.docWriteOffQuantityFieldSpecified = Value - End Set - End Property - - Public Property docIssuerCountry() As String - Get - Return Me.docIssuerCountryField - End Get - Set - Me.docIssuerCountryField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDocument)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDocument object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDocument object - ''' - '''string workflow markup to deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDocument) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDocument - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDocument) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDocument 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDocument object - ''' - '''string xml file to load and deserialize - '''Output TDocument object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDocument, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDocument) - 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 TDocument) 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 TDocument - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPrevDoc - - Private previousDocTypeField As String - - Private previousDocNumberField As String - - Private previousDocDateField As Date - - Private previousDocDateFieldSpecified As Boolean - - Private departureCustomsOfficeField As String - - Private destinationCustomsOfficeField As String - - Private typeField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property previousDocType() As String - Get - Return Me.previousDocTypeField - End Get - Set - Me.previousDocTypeField = Value - End Set - End Property - - Public Property previousDocNumber() As String - Get - Return Me.previousDocNumberField - End Get - Set - Me.previousDocNumberField = Value - End Set - End Property - - Public Property previousDocDate() As Date - Get - Return Me.previousDocDateField - End Get - Set - Me.previousDocDateField = Value - End Set - End Property - - - Public Property previousDocDateSpecified() As Boolean - Get - Return Me.previousDocDateFieldSpecified - End Get - Set - Me.previousDocDateFieldSpecified = Value - End Set - End Property - - Public Property departureCustomsOffice() As String - Get - Return Me.departureCustomsOfficeField - End Get - Set - Me.departureCustomsOfficeField = Value - End Set - End Property - - Public Property destinationCustomsOffice() As String - Get - Return Me.destinationCustomsOfficeField - End Get - Set - Me.destinationCustomsOfficeField = Value - End Set - End Property - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPrevDoc)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPrevDoc object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPrevDoc object - ''' - '''string workflow markup to deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPrevDoc) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPrevDoc - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPrevDoc) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TPrevDoc 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TPrevDoc object - ''' - '''string xml file to load and deserialize - '''Output TPrevDoc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TPrevDoc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPrevDoc) - 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 TPrevDoc) 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 TPrevDoc - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFields - - Private textsField As List(Of TCustomerText) - - Private datesField As List(Of TCustomerDate) - - Private flagsField As List(Of TCustomerFlag) - - Private numbersField As List(Of TCustomerNumber) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.numbersField = New List(Of TCustomerNumber)() - Me.flagsField = New List(Of TCustomerFlag)() - Me.datesField = New List(Of TCustomerDate)() - Me.textsField = New List(Of TCustomerText)() - End Sub - - - Public Property Texts() As List(Of TCustomerText) - Get - Return Me.textsField - End Get - Set - Me.textsField = Value - End Set - End Property - - - Public Property Dates() As List(Of TCustomerDate) - Get - Return Me.datesField - End Get - Set - Me.datesField = Value - End Set - End Property - - - Public Property Flags() As List(Of TCustomerFlag) - Get - Return Me.flagsField - End Get - Set - Me.flagsField = Value - End Set - End Property - - - Public Property Numbers() As List(Of TCustomerNumber) - Get - Return Me.numbersField - End Get - Set - Me.numbersField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFields)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFields object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFields object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFields) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFields) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFields - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFields) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFields object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerText - - Private keyField As Integer - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerText)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerText object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerText object - ''' - '''string workflow markup to deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerText) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerText) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerText - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerText) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerText object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerDate - - Private keyField As Integer - - Private valueField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Date - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerDate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerDate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerDate object - ''' - '''string workflow markup to deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerDate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerDate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerDate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerDate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerDate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerFlag - - Private keyField As Integer - - Private valueField As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Boolean - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerFlag)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerFlag object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerFlag object - ''' - '''string workflow markup to deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerFlag) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerFlag) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerFlag - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerFlag) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerFlag object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustomerNumber - - Private keyField As Integer - - Private valueField As Decimal - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As Integer - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As Decimal - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustomerNumber)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustomerNumber object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustomerNumber object - ''' - '''string workflow markup to deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustomerNumber) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustomerNumber) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustomerNumber - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustomerNumber) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TCustomerNumber object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAttribute - - Private attrTypeField As String - - Private attrTextField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property attrType() As String - Get - Return Me.attrTypeField - End Get - Set - Me.attrTypeField = Value - End Set - End Property - - Public Property attrText() As String - Get - Return Me.attrTextField - End Get - Set - Me.attrTextField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAttribute)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAttribute object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAttribute object - ''' - '''string workflow markup to deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAttribute) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAttribute) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAttribute - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAttribute) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAttribute object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDetailContainerInfo - - Private containerNumberField As String - - Private containerSealNumberField As String - - Private containerPackagesField As Decimal - - Private containerPackagesFieldSpecified As Boolean - - Private containerGrossWeightField As Decimal - - Private containerGrossWeightFieldSpecified As Boolean - - Private containerNetWeightField As Decimal - - Private containerNetWeightFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerSealNumber() As String - Get - Return Me.containerSealNumberField - End Get - Set - Me.containerSealNumberField = Value - End Set - End Property - - Public Property containerPackages() As Decimal - Get - Return Me.containerPackagesField - End Get - Set - Me.containerPackagesField = Value - End Set - End Property - - - Public Property containerPackagesSpecified() As Boolean - Get - Return Me.containerPackagesFieldSpecified - End Get - Set - Me.containerPackagesFieldSpecified = Value - End Set - End Property - - Public Property containerGrossWeight() As Decimal - Get - Return Me.containerGrossWeightField - End Get - Set - Me.containerGrossWeightField = Value - End Set - End Property - - - Public Property containerGrossWeightSpecified() As Boolean - Get - Return Me.containerGrossWeightFieldSpecified - End Get - Set - Me.containerGrossWeightFieldSpecified = Value - End Set - End Property - - Public Property containerNetWeight() As Decimal - Get - Return Me.containerNetWeightField - End Get - Set - Me.containerNetWeightField = Value - End Set - End Property - - - Public Property containerNetWeightSpecified() As Boolean - Get - Return Me.containerNetWeightFieldSpecified - End Get - Set - Me.containerNetWeightFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDetailContainerInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDetailContainerInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDetailContainerInfo object - ''' - '''string workflow markup to deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDetailContainerInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDetailContainerInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDetailContainerInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDetailContainerInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDetailContainerInfo object - ''' - '''string xml file to load and deserialize - '''Output TDetailContainerInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDetailContainerInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDetailContainerInfo) - 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 TDetailContainerInfo) 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 TDetailContainerInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TPartner - - Private partnerTypeField As String - - Private partnerAddressField As TAddress - - Private partnerRelationField As String - - Private partnerInfoField As String - - Private partnerTelephoneField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.partnerAddressField = New TAddress() - End Sub - - Public Property partnerType() As String - Get - Return Me.partnerTypeField - End Get - Set - Me.partnerTypeField = Value - End Set - End Property - - Public Property PartnerAddress() As TAddress - Get - Return Me.partnerAddressField - End Get - Set - Me.partnerAddressField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property partnerInfo() As String - Get - Return Me.partnerInfoField - End Get - Set - Me.partnerInfoField = Value - End Set - End Property - - Public Property partnerTelephone() As String - Get - Return Me.partnerTelephoneField - End Get - Set - Me.partnerTelephoneField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TPartner)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TPartner object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TPartner object - ''' - '''string workflow markup to deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TPartner) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TPartner) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TPartner - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TPartner) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TPartner object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAddress - - Private addrNoField As String - - Private addrNoTypeField As String - - Private addrNameField As List(Of String) - - Private addrStreetField As String - - Private addrLocField As String - - Private addrCtryField As String - - Private addrStateField As String - - Private addrZipField As String - - Private addrTinField As String - - Private addrEoriField As String - - Private partnerRelationField As String - - Private addrDistrictField As String - - Private addrBranchNoField As String - - Private emailField As String - - Private addrVatNumberField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.addrNameField = New List(Of String)() - End Sub - - Public Property addrNo() As String - Get - Return Me.addrNoField - End Get - Set - Me.addrNoField = Value - End Set - End Property - - Public Property addrNoType() As String - Get - Return Me.addrNoTypeField - End Get - Set - Me.addrNoTypeField = Value - End Set - End Property - - Public Property addrName() As List(Of String) - Get - Return Me.addrNameField - End Get - Set - Me.addrNameField = Value - End Set - End Property - - Public Property addrStreet() As String - Get - Return Me.addrStreetField - End Get - Set - Me.addrStreetField = Value - End Set - End Property - - Public Property addrLoc() As String - Get - Return Me.addrLocField - End Get - Set - Me.addrLocField = Value - End Set - End Property - - Public Property addrCtry() As String - Get - Return Me.addrCtryField - End Get - Set - Me.addrCtryField = Value - End Set - End Property - - Public Property addrState() As String - Get - Return Me.addrStateField - End Get - Set - Me.addrStateField = Value - End Set - End Property - - Public Property addrZip() As String - Get - Return Me.addrZipField - End Get - Set - Me.addrZipField = Value - End Set - End Property - - Public Property addrTin() As String - Get - Return Me.addrTinField - End Get - Set - Me.addrTinField = Value - End Set - End Property - - Public Property addrEori() As String - Get - Return Me.addrEoriField - End Get - Set - Me.addrEoriField = Value - End Set - End Property - - Public Property partnerRelation() As String - Get - Return Me.partnerRelationField - End Get - Set - Me.partnerRelationField = Value - End Set - End Property - - Public Property addrDistrict() As String - Get - Return Me.addrDistrictField - End Get - Set - Me.addrDistrictField = Value - End Set - End Property - - Public Property addrBranchNo() As String - Get - Return Me.addrBranchNoField - End Get - Set - Me.addrBranchNoField = Value - End Set - End Property - - Public Property email() As String - Get - Return Me.emailField - End Get - Set - Me.emailField = Value - End Set - End Property - - Public Property addrVatNumber() As String - Get - Return Me.addrVatNumberField - End Get - Set - Me.addrVatNumberField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAddress)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAddress object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAddress object - ''' - '''string workflow markup to deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAddress) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAddress) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAddress - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAddress) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TAddress object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TCustIntra - - Private vendorVatIdField As String - - Private statisticalProcedureField As String - - Private internalReferenceField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property vendorVatId() As String - Get - Return Me.vendorVatIdField - End Get - Set - Me.vendorVatIdField = Value - End Set - End Property - - Public Property statisticalProcedure() As String - Get - Return Me.statisticalProcedureField - End Get - Set - Me.statisticalProcedureField = Value - End Set - End Property - - Public Property internalReference() As String - Get - Return Me.internalReferenceField - End Get - Set - Me.internalReferenceField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TCustIntra)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TCustIntra object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TCustIntra object - ''' - '''string workflow markup to deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TCustIntra) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TCustIntra - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TCustIntra) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TCustIntra 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TCustIntra object - ''' - '''string xml file to load and deserialize - '''Output TCustIntra object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TCustIntra, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TCustIntra) - 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 TCustIntra) 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 TCustIntra - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportPaymentInfo - - Private paymentTypeField As String - - Private paymentDateField As Date - - Private paymentDateFieldSpecified As Boolean - - Private paymentBankCodeField As String - - Private paymentBankBranchCodeField As String - - Private paymentCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property paymentType() As String - Get - Return Me.paymentTypeField - End Get - Set - Me.paymentTypeField = Value - End Set - End Property - - Public Property paymentDate() As Date - Get - Return Me.paymentDateField - End Get - Set - Me.paymentDateField = Value - End Set - End Property - - - Public Property paymentDateSpecified() As Boolean - Get - Return Me.paymentDateFieldSpecified - End Get - Set - Me.paymentDateFieldSpecified = Value - End Set - End Property - - Public Property paymentBankCode() As String - Get - Return Me.paymentBankCodeField - End Get - Set - Me.paymentBankCodeField = Value - End Set - End Property - - Public Property paymentBankBranchCode() As String - Get - Return Me.paymentBankBranchCodeField - End Get - Set - Me.paymentBankBranchCodeField = Value - End Set - End Property - - Public Property paymentCurrency() As String - Get - Return Me.paymentCurrencyField - End Get - Set - Me.paymentCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportPaymentInfo)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportPaymentInfo object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportPaymentInfo object - ''' - '''string workflow markup to deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportPaymentInfo) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportPaymentInfo - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportPaymentInfo) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportPaymentInfo 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportPaymentInfo object - ''' - '''string xml file to load and deserialize - '''Output TImportPaymentInfo object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportPaymentInfo, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportPaymentInfo) - 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 TImportPaymentInfo) 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 TImportPaymentInfo - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCostsInv - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCostsInv) - 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 TInsuranceCostsInv) 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 TInsuranceCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCostsInv - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCostsInv)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCostsInv object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCostsInv object - ''' - '''string workflow markup to deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCostsInv) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCostsInv - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCostsInv) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCostsInv 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCostsInv object - ''' - '''string xml file to load and deserialize - '''Output TFreightCostsInv object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCostsInv, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCostsInv) - 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 TFreightCostsInv) 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 TFreightCostsInv - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TRebate - - Private rebAmountField As Decimal - - Private rebAmountFieldSpecified As Boolean - - Private rebCurrencyField As String - - Private rebProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property rebAmount() As Decimal - Get - Return Me.rebAmountField - End Get - Set - Me.rebAmountField = Value - End Set - End Property - - - Public Property rebAmountSpecified() As Boolean - Get - Return Me.rebAmountFieldSpecified - End Get - Set - Me.rebAmountFieldSpecified = Value - End Set - End Property - - Public Property rebCurrency() As String - Get - Return Me.rebCurrencyField - End Get - Set - Me.rebCurrencyField = Value - End Set - End Property - - Public Property rebProRating() As String - Get - Return Me.rebProRatingField - End Get - Set - Me.rebProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TRebate)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TRebate object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TRebate object - ''' - '''string workflow markup to deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TRebate) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TRebate - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TRebate) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TRebate 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TRebate object - ''' - '''string xml file to load and deserialize - '''Output TRebate object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRebate, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TRebate) - 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 TRebate) 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 TRebate - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDelTerm - - Private codeField As String - - Private descField As String - - Private calculationOfFreightCostsField As String - - Private code2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property desc() As String - Get - Return Me.descField - End Get - Set - Me.descField = Value - End Set - End Property - - Public Property calculationOfFreightCosts() As String - Get - Return Me.calculationOfFreightCostsField - End Get - Set - Me.calculationOfFreightCostsField = Value - End Set - End Property - - Public Property code2() As String - Get - Return Me.code2Field - End Get - Set - Me.code2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDelTerm)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDelTerm object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDelTerm object - ''' - '''string workflow markup to deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDelTerm) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDelTerm) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDelTerm - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDelTerm) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TDelTerm object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoiceHead - - Private invoiceTypeField As String - - Private contractDateField As Date - - Private contractDateFieldSpecified As Boolean - - Private countryOfTradeField As String - - Private supplierField As TAddress - - Private grossWeightField As Decimal - - Private grossWeightFieldSpecified As Boolean - - Private netWeightField As Decimal - - Private netWeightFieldSpecified As Boolean - - Private invoiceValueField As Decimal - - Private invoiceValueFieldSpecified As Boolean - - Private invoiceCurrencyField As String - - Private deliveryTermsField As TDelTerm - - Private rebateField As TRebate - - Private discountField As Decimal - - Private discountFieldSpecified As Boolean - - Private additionalCostField As List(Of TAddCosts) - - Private textField As String - - Private text2Field As String - - Private freightField As TFreightCostsInv - - Private insuranceField As TInsuranceCostsInv - - Private referenceNumberField As String - - Private transportNumberField As String - - Private transportTypeField As String - - Private acceptanceDateField As Date - - Private acceptanceDateFieldSpecified As Boolean - - Private disposalDateField As Date - - Private disposalDateFieldSpecified As Boolean - - Private timeLimitField As Date - - Private timeLimitFieldSpecified As Boolean - - Private registrationNumberField As String - - Private sealNumberField As String - - Private billOfLadingField As String - - Private packageCountField As Decimal - - Private packageCountFieldSpecified As Boolean - - Private packageTypeField As String - - Private buyerField As String - - Private consigneeField As String - - Private paymentInformationField As TImportPaymentInfo - - Private customerFieldsField As TCustomerFields - - Private sellerField As TAddress - - Private exchangeRateField As Decimal - - Private exchangeRateFieldSpecified As Boolean - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private containerInfoField As TContainer - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.containerInfoField = New TContainer() - Me.sellerField = New TAddress() - Me.customerFieldsField = New TCustomerFields() - Me.paymentInformationField = New TImportPaymentInfo() - Me.insuranceField = New TInsuranceCostsInv() - Me.freightField = New TFreightCostsInv() - Me.additionalCostField = New List(Of TAddCosts)() - Me.rebateField = New TRebate() - Me.deliveryTermsField = New TDelTerm() - Me.supplierField = New TAddress() - End Sub - - Public Property invoiceType() As String - Get - Return Me.invoiceTypeField - End Get - Set - Me.invoiceTypeField = Value - End Set - End Property - - Public Property contractDate() As Date - Get - Return Me.contractDateField - End Get - Set - Me.contractDateField = Value - End Set - End Property - - - Public Property contractDateSpecified() As Boolean - Get - Return Me.contractDateFieldSpecified - End Get - Set - Me.contractDateFieldSpecified = Value - End Set - End Property - - Public Property countryOfTrade() As String - Get - Return Me.countryOfTradeField - End Get - Set - Me.countryOfTradeField = Value - End Set - End Property - - Public Property Supplier() As TAddress - Get - Return Me.supplierField - End Get - Set - Me.supplierField = Value - End Set - End Property - - Public Property grossWeight() As Decimal - Get - Return Me.grossWeightField - End Get - Set - Me.grossWeightField = Value - End Set - End Property - - - Public Property grossWeightSpecified() As Boolean - Get - Return Me.grossWeightFieldSpecified - End Get - Set - Me.grossWeightFieldSpecified = Value - End Set - End Property - - Public Property netWeight() As Decimal - Get - Return Me.netWeightField - End Get - Set - Me.netWeightField = Value - End Set - End Property - - - Public Property netWeightSpecified() As Boolean - Get - Return Me.netWeightFieldSpecified - End Get - Set - Me.netWeightFieldSpecified = Value - End Set - End Property - - Public Property invoiceValue() As Decimal - Get - Return Me.invoiceValueField - End Get - Set - Me.invoiceValueField = Value - End Set - End Property - - - Public Property invoiceValueSpecified() As Boolean - Get - Return Me.invoiceValueFieldSpecified - End Get - Set - Me.invoiceValueFieldSpecified = Value - End Set - End Property - - Public Property invoiceCurrency() As String - Get - Return Me.invoiceCurrencyField - End Get - Set - Me.invoiceCurrencyField = Value - End Set - End Property - - Public Property deliveryTerms() As TDelTerm - Get - Return Me.deliveryTermsField - End Get - Set - Me.deliveryTermsField = Value - End Set - End Property - - Public Property Rebate() As TRebate - Get - Return Me.rebateField - End Get - Set - Me.rebateField = Value - End Set - End Property - - Public Property discount() As Decimal - Get - Return Me.discountField - End Get - Set - Me.discountField = Value - End Set - End Property - - - Public Property discountSpecified() As Boolean - Get - Return Me.discountFieldSpecified - End Get - Set - Me.discountFieldSpecified = Value - End Set - End Property - - Public Property AdditionalCost() As List(Of TAddCosts) - Get - Return Me.additionalCostField - End Get - Set - Me.additionalCostField = Value - End Set - End Property - - Public Property text() As String - Get - Return Me.textField - End Get - Set - Me.textField = Value - End Set - End Property - - Public Property text2() As String - Get - Return Me.text2Field - End Get - Set - Me.text2Field = Value - End Set - End Property - - Public Property Freight() As TFreightCostsInv - Get - Return Me.freightField - End Get - Set - Me.freightField = Value - End Set - End Property - - Public Property Insurance() As TInsuranceCostsInv - Get - Return Me.insuranceField - End Get - Set - Me.insuranceField = Value - End Set - End Property - - Public Property referenceNumber() As String - Get - Return Me.referenceNumberField - End Get - Set - Me.referenceNumberField = Value - End Set - End Property - - Public Property transportNumber() As String - Get - Return Me.transportNumberField - End Get - Set - Me.transportNumberField = Value - End Set - End Property - - Public Property transportType() As String - Get - Return Me.transportTypeField - End Get - Set - Me.transportTypeField = Value - End Set - End Property - - Public Property acceptanceDate() As Date - Get - Return Me.acceptanceDateField - End Get - Set - Me.acceptanceDateField = Value - End Set - End Property - - - Public Property acceptanceDateSpecified() As Boolean - Get - Return Me.acceptanceDateFieldSpecified - End Get - Set - Me.acceptanceDateFieldSpecified = Value - End Set - End Property - - Public Property disposalDate() As Date - Get - Return Me.disposalDateField - End Get - Set - Me.disposalDateField = Value - End Set - End Property - - - Public Property disposalDateSpecified() As Boolean - Get - Return Me.disposalDateFieldSpecified - End Get - Set - Me.disposalDateFieldSpecified = Value - End Set - End Property - - Public Property timeLimit() As Date - Get - Return Me.timeLimitField - End Get - Set - Me.timeLimitField = Value - End Set - End Property - - - Public Property timeLimitSpecified() As Boolean - Get - Return Me.timeLimitFieldSpecified - End Get - Set - Me.timeLimitFieldSpecified = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property sealNumber() As String - Get - Return Me.sealNumberField - End Get - Set - Me.sealNumberField = Value - End Set - End Property - - Public Property billOfLading() As String - Get - Return Me.billOfLadingField - End Get - Set - Me.billOfLadingField = Value - End Set - End Property - - Public Property packageCount() As Decimal - Get - Return Me.packageCountField - End Get - Set - Me.packageCountField = Value - End Set - End Property - - - Public Property packageCountSpecified() As Boolean - Get - Return Me.packageCountFieldSpecified - End Get - Set - Me.packageCountFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property buyer() As String - Get - Return Me.buyerField - End Get - Set - Me.buyerField = Value - End Set - End Property - - Public Property consignee() As String - Get - Return Me.consigneeField - End Get - Set - Me.consigneeField = Value - End Set - End Property - - Public Property PaymentInformation() As TImportPaymentInfo - Get - Return Me.paymentInformationField - End Get - Set - Me.paymentInformationField = Value - End Set - End Property - - Public Property CustomerFields() As TCustomerFields - Get - Return Me.customerFieldsField - End Get - Set - Me.customerFieldsField = Value - End Set - End Property - - Public Property seller() As TAddress - Get - Return Me.sellerField - End Get - Set - Me.sellerField = Value - End Set - End Property - - Public Property exchangeRate() As Decimal - Get - Return Me.exchangeRateField - End Get - Set - Me.exchangeRateField = Value - End Set - End Property - - - Public Property exchangeRateSpecified() As Boolean - Get - Return Me.exchangeRateFieldSpecified - End Get - Set - Me.exchangeRateFieldSpecified = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Public Property ContainerInfo() As TContainer - Get - Return Me.containerInfoField - End Get - Set - Me.containerInfoField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoiceHead)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoiceHead object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoiceHead object - ''' - '''string workflow markup to deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoiceHead) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoiceHead) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoiceHead - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoiceHead) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoiceHead object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TContainer - - Private containerIndicatorField As String - - Private containerNumberField As String - - Private containerTypeField As String - - Private containerLCLIndicatorField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property containerIndicator() As String - Get - Return Me.containerIndicatorField - End Get - Set - Me.containerIndicatorField = Value - End Set - End Property - - Public Property containerNumber() As String - Get - Return Me.containerNumberField - End Get - Set - Me.containerNumberField = Value - End Set - End Property - - Public Property containerType() As String - Get - Return Me.containerTypeField - End Get - Set - Me.containerTypeField = Value - End Set - End Property - - Public Property containerLCLIndicator() As String - Get - Return Me.containerLCLIndicatorField - End Get - Set - Me.containerLCLIndicatorField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TContainer)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TContainer object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TContainer object - ''' - '''string workflow markup to deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TContainer) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TContainer) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TContainer - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TContainer) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TContainer object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInvoice - - Private invoiceNumberField As String - - Private invoiceVersionField As String - - Private invoiceDateField As Date - - Private invoiceDateFieldSpecified As Boolean - - Private invoiceHeadField As TInvoiceHead - - Private attributesField As List(Of TAttribute) - - Private documentsField As List(Of TDocument) - - Private partnersField As List(Of TPartner) - - Private atlasCompletionSumDsField As List(Of TAtlasCompSumDEntry) - - Private intraField As TCustIntra - - Private invoiceLinesField As List(Of TInvoiceLine) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.invoiceLinesField = New List(Of TInvoiceLine)() - Me.intraField = New TCustIntra() - Me.atlasCompletionSumDsField = New List(Of TAtlasCompSumDEntry)() - Me.partnersField = New List(Of TPartner)() - Me.documentsField = New List(Of TDocument)() - Me.attributesField = New List(Of TAttribute)() - Me.invoiceHeadField = New TInvoiceHead() - End Sub - - Public Property invoiceNumber() As String - Get - Return Me.invoiceNumberField - End Get - Set - Me.invoiceNumberField = Value - End Set - End Property - - Public Property invoiceVersion() As String - Get - Return Me.invoiceVersionField - End Get - Set - Me.invoiceVersionField = Value - End Set - End Property - - Public Property invoiceDate() As Date - Get - Return Me.invoiceDateField - End Get - Set - Me.invoiceDateField = Value - End Set - End Property - - - Public Property invoiceDateSpecified() As Boolean - Get - Return Me.invoiceDateFieldSpecified - End Get - Set - Me.invoiceDateFieldSpecified = Value - End Set - End Property - - Public Property InvoiceHead() As TInvoiceHead - Get - Return Me.invoiceHeadField - End Get - Set - Me.invoiceHeadField = Value - End Set - End Property - - - Public Property Attributes() As List(Of TAttribute) - Get - Return Me.attributesField - End Get - Set - Me.attributesField = Value - End Set - End Property - - - Public Property Documents() As List(Of TDocument) - Get - Return Me.documentsField - End Get - Set - Me.documentsField = Value - End Set - End Property - - - Public Property Partners() As List(Of TPartner) - Get - Return Me.partnersField - End Get - Set - Me.partnersField = Value - End Set - End Property - - - Public Property AtlasCompletionSumDs() As List(Of TAtlasCompSumDEntry) - Get - Return Me.atlasCompletionSumDsField - End Get - Set - Me.atlasCompletionSumDsField = Value - End Set - End Property - - Public Property Intra() As TCustIntra - Get - Return Me.intraField - End Get - Set - Me.intraField = Value - End Set - End Property - - - Public Property InvoiceLines() As List(Of TInvoiceLine) - Get - Return Me.invoiceLinesField - End Get - Set - Me.invoiceLinesField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInvoice)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInvoice object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInvoice object - ''' - '''string workflow markup to deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInvoice) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInvoice) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInvoice - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInvoice) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TInvoice object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAtlasCompSumDEntry - - Private idTypeField As String - - Private quantityField As Long - - Private quantityFieldSpecified As Boolean - - Private packageTypeField As String - - Private registrationNumberField As String - - Private lineNumberField As Long - - Private lineNumberFieldSpecified As Boolean - - Private depositorField As String - - Private spoTypeField As String - - Private spoField As String - - Private creationUserField As String - - Private creationDateField As Date - - Private creationDateFieldSpecified As Boolean - - Private modificationUserField As String - - Private modificationDateField As Date - - Private modificationDateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property idType() As String - Get - Return Me.idTypeField - End Get - Set - Me.idTypeField = Value - End Set - End Property - - Public Property quantity() As Long - Get - Return Me.quantityField - End Get - Set - Me.quantityField = Value - End Set - End Property - - - Public Property quantitySpecified() As Boolean - Get - Return Me.quantityFieldSpecified - End Get - Set - Me.quantityFieldSpecified = Value - End Set - End Property - - Public Property packageType() As String - Get - Return Me.packageTypeField - End Get - Set - Me.packageTypeField = Value - End Set - End Property - - Public Property registrationNumber() As String - Get - Return Me.registrationNumberField - End Get - Set - Me.registrationNumberField = Value - End Set - End Property - - Public Property lineNumber() As Long - Get - Return Me.lineNumberField - End Get - Set - Me.lineNumberField = Value - End Set - End Property - - - Public Property lineNumberSpecified() As Boolean - Get - Return Me.lineNumberFieldSpecified - End Get - Set - Me.lineNumberFieldSpecified = Value - End Set - End Property - - Public Property depositor() As String - Get - Return Me.depositorField - End Get - Set - Me.depositorField = Value - End Set - End Property - - Public Property spoType() As String - Get - Return Me.spoTypeField - End Get - Set - Me.spoTypeField = Value - End Set - End Property - - Public Property spo() As String - Get - Return Me.spoField - End Get - Set - Me.spoField = Value - End Set - End Property - - Public Property creationUser() As String - Get - Return Me.creationUserField - End Get - Set - Me.creationUserField = Value - End Set - End Property - - Public Property creationDate() As Date - Get - Return Me.creationDateField - End Get - Set - Me.creationDateField = Value - End Set - End Property - - - Public Property creationDateSpecified() As Boolean - Get - Return Me.creationDateFieldSpecified - End Get - Set - Me.creationDateFieldSpecified = Value - End Set - End Property - - Public Property modificationUser() As String - Get - Return Me.modificationUserField - End Get - Set - Me.modificationUserField = Value - End Set - End Property - - Public Property modificationDate() As Date - Get - Return Me.modificationDateField - End Get - Set - Me.modificationDateField = Value - End Set - End Property - - - Public Property modificationDateSpecified() As Boolean - Get - Return Me.modificationDateFieldSpecified - End Get - Set - Me.modificationDateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAtlasCompSumDEntry)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAtlasCompSumDEntry object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAtlasCompSumDEntry object - ''' - '''string workflow markup to deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAtlasCompSumDEntry) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAtlasCompSumDEntry - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAtlasCompSumDEntry) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAtlasCompSumDEntry 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAtlasCompSumDEntry object - ''' - '''string xml file to load and deserialize - '''Output TAtlasCompSumDEntry object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAtlasCompSumDEntry, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAtlasCompSumDEntry) - 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 TAtlasCompSumDEntry) 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 TAtlasCompSumDEntry - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TGuarantee - - Private guaranteeNumberField As Long - - Private guaranteeNumberFieldSpecified As Boolean - - Private guaranteeCodeField As String - - Private guaranteeTypeField As String - - Private guaranteeAmountField As Decimal - - Private guaranteeAmountFieldSpecified As Boolean - - Private guaranteeCurrencyField As String - - Private guaranteeReferenceField As String - - Private guaranteeCustomsOfficeField As String - - Private localBaseField As Decimal - - Private localBaseFieldSpecified As Boolean - - Private factoringBaseField As String - - Private customsRateField As Decimal - - Private customsRateFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property guaranteeNumber() As Long - Get - Return Me.guaranteeNumberField - End Get - Set - Me.guaranteeNumberField = Value - End Set - End Property - - - Public Property guaranteeNumberSpecified() As Boolean - Get - Return Me.guaranteeNumberFieldSpecified - End Get - Set - Me.guaranteeNumberFieldSpecified = Value - End Set - End Property - - Public Property guaranteeCode() As String - Get - Return Me.guaranteeCodeField - End Get - Set - Me.guaranteeCodeField = Value - End Set - End Property - - Public Property guaranteeType() As String - Get - Return Me.guaranteeTypeField - End Get - Set - Me.guaranteeTypeField = Value - End Set - End Property - - Public Property guaranteeAmount() As Decimal - Get - Return Me.guaranteeAmountField - End Get - Set - Me.guaranteeAmountField = Value - End Set - End Property - - - Public Property guaranteeAmountSpecified() As Boolean - Get - Return Me.guaranteeAmountFieldSpecified - End Get - Set - Me.guaranteeAmountFieldSpecified = Value - End Set - End Property - - Public Property guaranteeCurrency() As String - Get - Return Me.guaranteeCurrencyField - End Get - Set - Me.guaranteeCurrencyField = Value - End Set - End Property - - Public Property guaranteeReference() As String - Get - Return Me.guaranteeReferenceField - End Get - Set - Me.guaranteeReferenceField = Value - End Set - End Property - - Public Property guaranteeCustomsOffice() As String - Get - Return Me.guaranteeCustomsOfficeField - End Get - Set - Me.guaranteeCustomsOfficeField = Value - End Set - End Property - - Public Property localBase() As Decimal - Get - Return Me.localBaseField - End Get - Set - Me.localBaseField = Value - End Set - End Property - - - Public Property localBaseSpecified() As Boolean - Get - Return Me.localBaseFieldSpecified - End Get - Set - Me.localBaseFieldSpecified = Value - End Set - End Property - - Public Property factoringBase() As String - Get - Return Me.factoringBaseField - End Get - Set - Me.factoringBaseField = Value - End Set - End Property - - Public Property customsRate() As Decimal - Get - Return Me.customsRateField - End Get - Set - Me.customsRateField = Value - End Set - End Property - - - Public Property customsRateSpecified() As Boolean - Get - Return Me.customsRateFieldSpecified - End Get - Set - Me.customsRateFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TGuarantee)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TGuarantee object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TGuarantee object - ''' - '''string workflow markup to deserialize - '''Output TGuarantee object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantee, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantee) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantee) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TGuarantee - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TGuarantee) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TGuarantee 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TGuarantee object - ''' - '''string xml file to load and deserialize - '''Output TGuarantee object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TGuarantee, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantee) - 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 TGuarantee) 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 TGuarantee - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TGuarantees - - Private guaranteeField As List(Of TGuarantee) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.guaranteeField = New List(Of TGuarantee)() - End Sub - - Public Property Guarantee() As List(Of TGuarantee) - Get - Return Me.guaranteeField - End Get - Set - Me.guaranteeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TGuarantees)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TGuarantees object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TGuarantees object - ''' - '''string workflow markup to deserialize - '''Output TGuarantees object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantees, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantees) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TGuarantees) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TGuarantees - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TGuarantees) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TGuarantees 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TGuarantees object - ''' - '''string xml file to load and deserialize - '''Output TGuarantees object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TGuarantees, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TGuarantees) - 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 TGuarantees) 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 TGuarantees - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeferAcc - - Private accountNumber1Field As String - - Private accountNumber2Field As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property accountNumber1() As String - Get - Return Me.accountNumber1Field - End Get - Set - Me.accountNumber1Field = Value - End Set - End Property - - Public Property accountNumber2() As String - Get - Return Me.accountNumber2Field - End Get - Set - Me.accountNumber2Field = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeferAcc)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeferAcc object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeferAcc object - ''' - '''string workflow markup to deserialize - '''Output TDeferAcc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAcc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAcc) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAcc) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeferAcc - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeferAcc) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDeferAcc 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDeferAcc object - ''' - '''string xml file to load and deserialize - '''Output TDeferAcc object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeferAcc, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAcc) - 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 TDeferAcc) 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 TDeferAcc - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TDeferAccs - - Private defermentAccountField As TDeferAcc - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.defermentAccountField = New TDeferAcc() - End Sub - - Public Property DefermentAccount() As TDeferAcc - Get - Return Me.defermentAccountField - End Get - Set - Me.defermentAccountField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TDeferAccs)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TDeferAccs object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TDeferAccs object - ''' - '''string workflow markup to deserialize - '''Output TDeferAccs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAccs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAccs) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TDeferAccs) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TDeferAccs - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TDeferAccs) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TDeferAccs 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TDeferAccs object - ''' - '''string xml file to load and deserialize - '''Output TDeferAccs object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TDeferAccs, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TDeferAccs) - 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 TDeferAccs) 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 TDeferAccs - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAuthHolder - - Private typeCodeField As String - - Private identifierField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property typeCode() As String - Get - Return Me.typeCodeField - End Get - Set - Me.typeCodeField = Value - End Set - End Property - - Public Property identifier() As String - Get - Return Me.identifierField - End Get - Set - Me.identifierField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAuthHolder)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAuthHolder object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAuthHolder object - ''' - '''string workflow markup to deserialize - '''Output TAuthHolder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolder) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolder) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAuthHolder - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAuthHolder) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAuthHolder 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAuthHolder object - ''' - '''string xml file to load and deserialize - '''Output TAuthHolder object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAuthHolder, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolder) - 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 TAuthHolder) 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 TAuthHolder - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TAuthHolders - - Private authorisationHolderField As List(Of TAuthHolder) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.authorisationHolderField = New List(Of TAuthHolder)() - End Sub - - Public Property AuthorisationHolder() As List(Of TAuthHolder) - Get - Return Me.authorisationHolderField - End Get - Set - Me.authorisationHolderField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TAuthHolders)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TAuthHolders object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TAuthHolders object - ''' - '''string workflow markup to deserialize - '''Output TAuthHolders object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolders, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolders) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TAuthHolders) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TAuthHolders - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TAuthHolders) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TAuthHolders 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TAuthHolders object - ''' - '''string xml file to load and deserialize - '''Output TAuthHolders object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TAuthHolders, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TAuthHolders) - 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 TAuthHolders) 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 TAuthHolders - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TInsuranceCosts - - Private insAmountField As Decimal - - Private insAmountFieldSpecified As Boolean - - Private insCurrencyField As String - - Private insProRatingField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property insAmount() As Decimal - Get - Return Me.insAmountField - End Get - Set - Me.insAmountField = Value - End Set - End Property - - - Public Property insAmountSpecified() As Boolean - Get - Return Me.insAmountFieldSpecified - End Get - Set - Me.insAmountFieldSpecified = Value - End Set - End Property - - Public Property insCurrency() As String - Get - Return Me.insCurrencyField - End Get - Set - Me.insCurrencyField = Value - End Set - End Property - - Public Property insProRating() As String - Get - Return Me.insProRatingField - End Get - Set - Me.insProRatingField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TInsuranceCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TInsuranceCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TInsuranceCosts object - ''' - '''string workflow markup to deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TInsuranceCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TInsuranceCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TInsuranceCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TInsuranceCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TInsuranceCosts object - ''' - '''string xml file to load and deserialize - '''Output TInsuranceCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TInsuranceCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TInsuranceCosts) - 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 TInsuranceCosts) 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 TInsuranceCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TFreightCosts - - Private frtAmountField As Decimal - - Private frtAmountFieldSpecified As Boolean - - Private frtCurrencyField As String - - Private frtInternationalField As Decimal - - Private frtInternationalFieldSpecified As Boolean - - Private frtEuNationalField As Decimal - - Private frtEuNationalFieldSpecified As Boolean - - Private frtInlandField As Decimal - - Private frtInlandFieldSpecified As Boolean - - Private frtProRatingField As String - - Private frtInternationalAbsField As Decimal - - Private frtInternationalAbsFieldSpecified As Boolean - - Private frtIntCurrencyField As String - - Private frtCommunityAbsField As Decimal - - Private frtCommunityAbsFieldSpecified As Boolean - - Private frtCommunityCurrencyField As String - - Private frtNatAbsField As Decimal - - Private frtNatAbsFieldSpecified As Boolean - - Private frtNatCurrencyField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property frtAmount() As Decimal - Get - Return Me.frtAmountField - End Get - Set - Me.frtAmountField = Value - End Set - End Property - - - Public Property frtAmountSpecified() As Boolean - Get - Return Me.frtAmountFieldSpecified - End Get - Set - Me.frtAmountFieldSpecified = Value - End Set - End Property - - Public Property frtCurrency() As String - Get - Return Me.frtCurrencyField - End Get - Set - Me.frtCurrencyField = Value - End Set - End Property - - Public Property frtInternational() As Decimal - Get - Return Me.frtInternationalField - End Get - Set - Me.frtInternationalField = Value - End Set - End Property - - - Public Property frtInternationalSpecified() As Boolean - Get - Return Me.frtInternationalFieldSpecified - End Get - Set - Me.frtInternationalFieldSpecified = Value - End Set - End Property - - Public Property frtEuNational() As Decimal - Get - Return Me.frtEuNationalField - End Get - Set - Me.frtEuNationalField = Value - End Set - End Property - - - Public Property frtEuNationalSpecified() As Boolean - Get - Return Me.frtEuNationalFieldSpecified - End Get - Set - Me.frtEuNationalFieldSpecified = Value - End Set - End Property - - Public Property frtInland() As Decimal - Get - Return Me.frtInlandField - End Get - Set - Me.frtInlandField = Value - End Set - End Property - - - Public Property frtInlandSpecified() As Boolean - Get - Return Me.frtInlandFieldSpecified - End Get - Set - Me.frtInlandFieldSpecified = Value - End Set - End Property - - Public Property frtProRating() As String - Get - Return Me.frtProRatingField - End Get - Set - Me.frtProRatingField = Value - End Set - End Property - - Public Property frtInternationalAbs() As Decimal - Get - Return Me.frtInternationalAbsField - End Get - Set - Me.frtInternationalAbsField = Value - End Set - End Property - - - Public Property frtInternationalAbsSpecified() As Boolean - Get - Return Me.frtInternationalAbsFieldSpecified - End Get - Set - Me.frtInternationalAbsFieldSpecified = Value - End Set - End Property - - Public Property frtIntCurrency() As String - Get - Return Me.frtIntCurrencyField - End Get - Set - Me.frtIntCurrencyField = Value - End Set - End Property - - Public Property frtCommunityAbs() As Decimal - Get - Return Me.frtCommunityAbsField - End Get - Set - Me.frtCommunityAbsField = Value - End Set - End Property - - - Public Property frtCommunityAbsSpecified() As Boolean - Get - Return Me.frtCommunityAbsFieldSpecified - End Get - Set - Me.frtCommunityAbsFieldSpecified = Value - End Set - End Property - - Public Property frtCommunityCurrency() As String - Get - Return Me.frtCommunityCurrencyField - End Get - Set - Me.frtCommunityCurrencyField = Value - End Set - End Property - - Public Property frtNatAbs() As Decimal - Get - Return Me.frtNatAbsField - End Get - Set - Me.frtNatAbsField = Value - End Set - End Property - - - Public Property frtNatAbsSpecified() As Boolean - Get - Return Me.frtNatAbsFieldSpecified - End Get - Set - Me.frtNatAbsFieldSpecified = Value - End Set - End Property - - Public Property frtNatCurrency() As String - Get - Return Me.frtNatCurrencyField - End Get - Set - Me.frtNatCurrencyField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TFreightCosts)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TFreightCosts object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TFreightCosts object - ''' - '''string workflow markup to deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TFreightCosts) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TFreightCosts - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TFreightCosts) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TFreightCosts 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TFreightCosts object - ''' - '''string xml file to load and deserialize - '''Output TFreightCosts object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TFreightCosts, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TFreightCosts) - 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 TFreightCosts) 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 TFreightCosts - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMot - - Private motModeField As String - - Private meansOfTransportField As String - - Private motCountryField As String - - Private motVehicleField As String - - Private meansOfTransportDescriptionField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property motMode() As String - Get - Return Me.motModeField - End Get - Set - Me.motModeField = Value - End Set - End Property - - Public Property meansOfTransport() As String - Get - Return Me.meansOfTransportField - End Get - Set - Me.meansOfTransportField = Value - End Set - End Property - - Public Property motCountry() As String - Get - Return Me.motCountryField - End Get - Set - Me.motCountryField = Value - End Set - End Property - - Public Property motVehicle() As String - Get - Return Me.motVehicleField - End Get - Set - Me.motVehicleField = Value - End Set - End Property - - Public Property meansOfTransportDescription() As String - Get - Return Me.meansOfTransportDescriptionField - End Get - Set - Me.meansOfTransportDescriptionField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMot)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMot object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMot object - ''' - '''string workflow markup to deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMot) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMot) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMot - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMot) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMot object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class InsertImportShipment - - Private importShipmentMessageField As TImportShipMsg - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.importShipmentMessageField = New TImportShipMsg() - End Sub - - Public Property ImportShipmentMessage() As TImportShipMsg - Get - Return Me.importShipmentMessageField - End Get - Set - Me.importShipmentMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(InsertImportShipment)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current InsertImportShipment object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an InsertImportShipment object - ''' - '''string workflow markup to deserialize - '''Output InsertImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As InsertImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, InsertImportShipment) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As InsertImportShipment) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As InsertImportShipment - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), InsertImportShipment) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current InsertImportShipment 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an InsertImportShipment object - ''' - '''string xml file to load and deserialize - '''Output InsertImportShipment object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As InsertImportShipment, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, InsertImportShipment) - 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 InsertImportShipment) 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 InsertImportShipment - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TImportShipMsg - - Private metadataField As TMicMetadata - - Private messageDetailField As TMessageDetail - - Private importShipmentField As ImportShipment - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.importShipmentField = New ImportShipment() - Me.messageDetailField = New TMessageDetail() - Me.metadataField = New TMicMetadata() - End Sub - - Public Property Metadata() As TMicMetadata - Get - Return Me.metadataField - End Get - Set - Me.metadataField = Value - End Set - End Property - - Public Property MessageDetail() As TMessageDetail - Get - Return Me.messageDetailField - End Get - Set - Me.messageDetailField = Value - End Set - End Property - - Public Property ImportShipment() As ImportShipment - Get - Return Me.importShipmentField - End Get - Set - Me.importShipmentField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TImportShipMsg)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TImportShipMsg object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TImportShipMsg object - ''' - '''string workflow markup to deserialize - '''Output TImportShipMsg object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportShipMsg, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportShipMsg) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TImportShipMsg) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TImportShipMsg - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TImportShipMsg) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TImportShipMsg 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TImportShipMsg object - ''' - '''string xml file to load and deserialize - '''Output TImportShipMsg object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TImportShipMsg, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TImportShipMsg) - 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 TImportShipMsg) 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 TImportShipMsg - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMicMetadata - - Private connectionIdField As String - - Private partnerIdField As String - - Private dateTimeField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property connectionId() As String - Get - Return Me.connectionIdField - End Get - Set - Me.connectionIdField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property dateTime() As Date - Get - Return Me.dateTimeField - End Get - Set - Me.dateTimeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMicMetadata)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMicMetadata object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMicMetadata object - ''' - '''string workflow markup to deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMicMetadata) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMicMetadata - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMicMetadata) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMessageDetail - - Private messageIdField As String - - Private partyIdField As String - - Private transactionIdField As String - - Private sequenceNumField As String - - Private actionCodeField As TActionCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.actionCodeField = New TActionCode() - End Sub - - Public Property messageId() As String - Get - Return Me.messageIdField - End Get - Set - Me.messageIdField = Value - End Set - End Property - - Public Property partyId() As String - Get - Return Me.partyIdField - End Get - Set - Me.partyIdField = Value - End Set - End Property - - Public Property transactionId() As String - Get - Return Me.transactionIdField - End Get - Set - Me.transactionIdField = Value - End Set - End Property - - Public Property sequenceNum() As String - Get - Return Me.sequenceNumField - End Get - Set - Me.sequenceNumField = Value - End Set - End Property - - Public Property ActionCode() As TActionCode - Get - Return Me.actionCodeField - End Get - Set - Me.actionCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMessageDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMessageDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMessageDetail object - ''' - '''string workflow markup to deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMessageDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMessageDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMessageDetail 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMessageDetail object - ''' - '''string xml file to load and deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - 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 TMessageDetail) 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 TMessageDetail - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCode - - Private codeField As String - - Private parameterField As List(Of TActionCodeParameter) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.parameterField = New List(Of TActionCodeParameter)() - End Sub - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property parameter() As List(Of TActionCodeParameter) - Get - Return Me.parameterField - End Get - Set - Me.parameterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCode object - ''' - '''string workflow markup to deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCode object - ''' - '''string xml file to load and deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - 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 TActionCode) 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 TActionCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCodeParameter - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCodeParameter)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCodeParameter object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCodeParameter object - ''' - '''string workflow markup to deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCodeParameter - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCodeParameter) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCodeParameter 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCodeParameter object - ''' - '''string xml file to load and deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - 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 TActionCodeParameter) 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 TActionCodeParameter - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatusResponse - - Private statusField As TStatus - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.statusField = New TStatus() - End Sub - - Public Property Status() As TStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatusResponse)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatusResponse object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatusResponse object - ''' - '''string workflow markup to deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatusResponse - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatusResponse) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatusResponse 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatusResponse object - ''' - '''string xml file to load and deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - 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 TStatusResponse) 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 TStatusResponse - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatus - - Private statusField As TStatusStatus - - Private itemField As Object - - Private itemElementNameField As ItemChoiceType - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As TStatusStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - - Public Property Item() As Object - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - - Public Property ItemElementName() As ItemChoiceType - Get - Return Me.itemElementNameField - End Get - Set - Me.itemElementNameField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatus)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatus object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatus object - ''' - '''string workflow markup to deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatus - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatus) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatus 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatus object - ''' - '''string xml file to load and deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - 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 TStatus) 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 TStatus - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TStatusStatus - - ''' - OK - - ''' - [ERROR] - - ''' - WARNING - End Enum - - Partial Public Class ErrorMessages - - Private errorMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.errorMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property ErrorMessage() As List(Of TErrorMessageType) - Get - Return Me.errorMessageField - End Get - Set - Me.errorMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ErrorMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ErrorMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ErrorMessages object - ''' - '''string workflow markup to deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ErrorMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ErrorMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ErrorMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorMessageType - - Private moduleField As String - - Private processField As String - - Private errorCodeField As String - - Private errorDescField As String - - Private referenceField As TReference - - Private detailsField As TErrorDetail - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.detailsField = New TErrorDetail() - Me.referenceField = New TReference() - End Sub - - Public Property [module]() As String - Get - Return Me.moduleField - End Get - Set - Me.moduleField = Value - End Set - End Property - - Public Property process() As String - Get - Return Me.processField - End Get - Set - Me.processField = Value - End Set - End Property - - Public Property errorCode() As String - Get - Return Me.errorCodeField - End Get - Set - Me.errorCodeField = Value - End Set - End Property - - Public Property errorDesc() As String - Get - Return Me.errorDescField - End Get - Set - Me.errorDescField = Value - End Set - End Property - - Public Property Reference() As TReference - Get - Return Me.referenceField - End Get - Set - Me.referenceField = Value - End Set - End Property - - Public Property Details() As TErrorDetail - Get - Return Me.detailsField - End Get - Set - Me.detailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorMessageType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorMessageType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorMessageType object - ''' - '''string workflow markup to deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorMessageType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorMessageType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorMessageType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReference - - Private companyField As String - - Private plantField As String - - Private correlationIdField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private userField As String - - Private partnerIdField As String - - Private routeIdField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Public Property user() As String - Get - Return Me.userField - End Get - Set - Me.userField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property routeId() As String - Get - Return Me.routeIdField - End Get - Set - Me.routeIdField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReference object - ''' - '''string workflow markup to deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetail - - Private timestampField As Date - - Private stackTraceField As String - - Private additionalDetailsField As List(Of TErrorDetailAdditionalDetails) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.additionalDetailsField = New List(Of TErrorDetailAdditionalDetails)() - End Sub - - Public Property timestamp() As Date - Get - Return Me.timestampField - End Get - Set - Me.timestampField = Value - End Set - End Property - - Public Property stackTrace() As String - Get - Return Me.stackTraceField - End Get - Set - Me.stackTraceField = Value - End Set - End Property - - Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails) - Get - Return Me.additionalDetailsField - End Get - Set - Me.additionalDetailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetail object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetailAdditionalDetails - - Private typeField As String - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetailAdditionalDetails)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetailAdditionalDetails object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetailAdditionalDetails object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetailAdditionalDetails) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetailAdditionalDetails - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class WarningMessages - - Private warningMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.warningMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property WarningMessage() As List(Of TErrorMessageType) - Get - Return Me.warningMessageField - End Get - Set - Me.warningMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(WarningMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current WarningMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an WarningMessages object - ''' - '''string workflow markup to deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, WarningMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As WarningMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), WarningMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMetaReference - - Private correlationIdField As String - - Private companyField As String - - Private plantField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMetaReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMetaReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMetaReference object - ''' - '''string workflow markup to deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMetaReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMetaReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMetaReference 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMetaReference object - ''' - '''string xml file to load and deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - 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 TMetaReference) 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 TMetaReference - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum ItemChoiceType - - ''' - - ErrorMessages - - ''' - - WarningMessages - - ''' - Reference - End Enum -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.xsd deleted file mode 100644 index 03728314..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetaCustImportShipment.xsd +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - Message for inserting MIC CUST ImportShipment - - - - - - - - - - - - - - MIC request message - - - - - - - - diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.Designer.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.Designer.vb deleted file mode 100644 index eeca10f8..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.Designer.vb +++ /dev/null @@ -1,2733 +0,0 @@ -'' ------------------------------------------------------------------------------ -'' -'' Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) -'' MicMetadataListVisualBasicFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue -'' -'' ------------------------------------------------------------------------------ -Imports System -Imports System.Diagnostics -Imports System.Xml.Serialization -Imports System.Collections -Imports System.Xml.Schema -Imports System.ComponentModel -Imports System.IO -Imports System.Text -Imports System.Collections.Generic - -Namespace MicMetadata - - Partial Public Class TMicMetadata - - Private connectionIdField As String - - Private partnerIdField As String - - Private dateTimeField As Date - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property connectionId() As String - Get - Return Me.connectionIdField - End Get - Set - Me.connectionIdField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property dateTime() As Date - Get - Return Me.dateTimeField - End Get - Set - Me.dateTimeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMicMetadata)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMicMetadata object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMicMetadata object - ''' - '''string workflow markup to deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMicMetadata) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMicMetadata) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMicMetadata - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMicMetadata) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TMicMetadata object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMessageDetail - - Private messageIdField As String - - Private partyIdField As String - - Private transactionIdField As String - - Private sequenceNumField As String - - Private actionCodeField As TActionCode - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.actionCodeField = New TActionCode() - End Sub - - Public Property messageId() As String - Get - Return Me.messageIdField - End Get - Set - Me.messageIdField = Value - End Set - End Property - - Public Property partyId() As String - Get - Return Me.partyIdField - End Get - Set - Me.partyIdField = Value - End Set - End Property - - Public Property transactionId() As String - Get - Return Me.transactionIdField - End Get - Set - Me.transactionIdField = Value - End Set - End Property - - Public Property sequenceNum() As String - Get - Return Me.sequenceNumField - End Get - Set - Me.sequenceNumField = Value - End Set - End Property - - Public Property ActionCode() As TActionCode - Get - Return Me.actionCodeField - End Get - Set - Me.actionCodeField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMessageDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMessageDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMessageDetail object - ''' - '''string workflow markup to deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMessageDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMessageDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMessageDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMessageDetail 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMessageDetail object - ''' - '''string xml file to load and deserialize - '''Output TMessageDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMessageDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMessageDetail) - 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 TMessageDetail) 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 TMessageDetail - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCode - - Private codeField As String - - Private parameterField As List(Of TActionCodeParameter) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.parameterField = New List(Of TActionCodeParameter)() - End Sub - - Public Property code() As String - Get - Return Me.codeField - End Get - Set - Me.codeField = Value - End Set - End Property - - Public Property parameter() As List(Of TActionCodeParameter) - Get - Return Me.parameterField - End Get - Set - Me.parameterField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCode)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCode object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCode object - ''' - '''string workflow markup to deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCode) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCode - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCode) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCode 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCode object - ''' - '''string xml file to load and deserialize - '''Output TActionCode object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCode, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCode) - 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 TActionCode) 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 TActionCode - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TActionCodeParameter - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TActionCodeParameter)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TActionCodeParameter object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TActionCodeParameter object - ''' - '''string workflow markup to deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TActionCodeParameter) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TActionCodeParameter - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TActionCodeParameter) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TActionCodeParameter 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TActionCodeParameter object - ''' - '''string xml file to load and deserialize - '''Output TActionCodeParameter object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TActionCodeParameter, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TActionCodeParameter) - 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 TActionCodeParameter) 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 TActionCodeParameter - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatus - - Private statusField As TStatusStatus - - Private itemField As Object - - Private itemElementNameField As ItemChoiceType - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property status() As TStatusStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - - Public Property Item() As Object - Get - Return Me.itemField - End Get - Set - Me.itemField = Value - End Set - End Property - - - Public Property ItemElementName() As ItemChoiceType - Get - Return Me.itemElementNameField - End Get - Set - Me.itemElementNameField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatus)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatus object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatus object - ''' - '''string workflow markup to deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatus) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatus - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatus) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatus 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatus object - ''' - '''string xml file to load and deserialize - '''Output TStatus object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatus, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatus) - 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 TStatus) 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 TStatus - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum TStatusStatus - - ''' - OK - - ''' - [ERROR] - - ''' - WARNING - End Enum - - Partial Public Class ErrorMessages - - Private errorMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.errorMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property ErrorMessage() As List(Of TErrorMessageType) - Get - Return Me.errorMessageField - End Get - Set - Me.errorMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ErrorMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current ErrorMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an ErrorMessages object - ''' - '''string workflow markup to deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, ErrorMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As ErrorMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As ErrorMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), ErrorMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output ErrorMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorMessageType - - Private moduleField As String - - Private processField As String - - Private errorCodeField As String - - Private errorDescField As String - - Private referenceField As TReference - - Private detailsField As TErrorDetail - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.detailsField = New TErrorDetail() - Me.referenceField = New TReference() - End Sub - - Public Property [module]() As String - Get - Return Me.moduleField - End Get - Set - Me.moduleField = Value - End Set - End Property - - Public Property process() As String - Get - Return Me.processField - End Get - Set - Me.processField = Value - End Set - End Property - - Public Property errorCode() As String - Get - Return Me.errorCodeField - End Get - Set - Me.errorCodeField = Value - End Set - End Property - - Public Property errorDesc() As String - Get - Return Me.errorDescField - End Get - Set - Me.errorDescField = Value - End Set - End Property - - Public Property Reference() As TReference - Get - Return Me.referenceField - End Get - Set - Me.referenceField = Value - End Set - End Property - - Public Property Details() As TErrorDetail - Get - Return Me.detailsField - End Get - Set - Me.detailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorMessageType)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorMessageType object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorMessageType object - ''' - '''string workflow markup to deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorMessageType) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorMessageType) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorMessageType - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorMessageType) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorMessageType object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TReference - - Private companyField As String - - Private plantField As String - - Private correlationIdField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private userField As String - - Private partnerIdField As String - - Private routeIdField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Public Property user() As String - Get - Return Me.userField - End Get - Set - Me.userField = Value - End Set - End Property - - Public Property partnerId() As String - Get - Return Me.partnerIdField - End Get - Set - Me.partnerIdField = Value - End Set - End Property - - Public Property routeId() As String - Get - Return Me.routeIdField - End Get - Set - Me.routeIdField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TReference object - ''' - '''string workflow markup to deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetail - - Private timestampField As Date - - Private stackTraceField As String - - Private additionalDetailsField As List(Of TErrorDetailAdditionalDetails) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.additionalDetailsField = New List(Of TErrorDetailAdditionalDetails)() - End Sub - - Public Property timestamp() As Date - Get - Return Me.timestampField - End Get - Set - Me.timestampField = Value - End Set - End Property - - Public Property stackTrace() As String - Get - Return Me.stackTraceField - End Get - Set - Me.stackTraceField = Value - End Set - End Property - - Public Property additionalDetails() As List(Of TErrorDetailAdditionalDetails) - Get - Return Me.additionalDetailsField - End Get - Set - Me.additionalDetailsField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetail)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetail object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetail object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetail) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetail) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetail - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetail) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetail object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TErrorDetailAdditionalDetails - - Private typeField As String - - Private keyField As String - - Private valueField As String - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property type() As String - Get - Return Me.typeField - End Get - Set - Me.typeField = Value - End Set - End Property - - Public Property key() As String - Get - Return Me.keyField - End Get - Set - Me.keyField = Value - End Set - End Property - - Public Property value() As String - Get - Return Me.valueField - End Get - Set - Me.valueField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TErrorDetailAdditionalDetails)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TErrorDetailAdditionalDetails object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TErrorDetailAdditionalDetails object - ''' - '''string workflow markup to deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TErrorDetailAdditionalDetails) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TErrorDetailAdditionalDetails) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TErrorDetailAdditionalDetails - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TErrorDetailAdditionalDetails) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output TErrorDetailAdditionalDetails object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class WarningMessages - - Private warningMessageField As List(Of TErrorMessageType) - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.warningMessageField = New List(Of TErrorMessageType)() - End Sub - - Public Property WarningMessage() As List(Of TErrorMessageType) - Get - Return Me.warningMessageField - End Get - Set - Me.warningMessageField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(WarningMessages)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current WarningMessages object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an WarningMessages object - ''' - '''string workflow markup to deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, WarningMessages) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As WarningMessages) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As WarningMessages - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), WarningMessages) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - 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 - ''' - '''string xml file to load and deserialize - '''Output WarningMessages object - '''output Exception value if deserialize failed - '''true if this XmlSerializer 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 System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TMetaReference - - Private correlationIdField As String - - Private companyField As String - - Private plantField As String - - Private referenceTypeField As String - - Private referenceSidField As Long - - Private referenceSidFieldSpecified As Boolean - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Property correlationId() As String - Get - Return Me.correlationIdField - End Get - Set - Me.correlationIdField = Value - End Set - End Property - - Public Property company() As String - Get - Return Me.companyField - End Get - Set - Me.companyField = Value - End Set - End Property - - Public Property plant() As String - Get - Return Me.plantField - End Get - Set - Me.plantField = Value - End Set - End Property - - Public Property referenceType() As String - Get - Return Me.referenceTypeField - End Get - Set - Me.referenceTypeField = Value - End Set - End Property - - Public Property referenceSid() As Long - Get - Return Me.referenceSidField - End Get - Set - Me.referenceSidField = Value - End Set - End Property - - - Public Property referenceSidSpecified() As Boolean - Get - Return Me.referenceSidFieldSpecified - End Get - Set - Me.referenceSidFieldSpecified = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TMetaReference)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TMetaReference object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TMetaReference object - ''' - '''string workflow markup to deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TMetaReference) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TMetaReference - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TMetaReference) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TMetaReference 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TMetaReference object - ''' - '''string xml file to load and deserialize - '''Output TMetaReference object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TMetaReference, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TMetaReference) - 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 TMetaReference) 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 TMetaReference - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Public Enum ItemChoiceType - - ''' - - ErrorMessages - - ''' - - WarningMessages - - ''' - Reference - End Enum - - Partial Public Class StatusMessage - - Private metadataField As TMicMetadata - - Private messageDetailField As TMessageDetail - - Private statusField As TStatus - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.statusField = New TStatus() - Me.messageDetailField = New TMessageDetail() - Me.metadataField = New TMicMetadata() - End Sub - - Public Property Metadata() As TMicMetadata - Get - Return Me.metadataField - End Get - Set - Me.metadataField = Value - End Set - End Property - - Public Property MessageDetail() As TMessageDetail - Get - Return Me.messageDetailField - End Get - Set - Me.messageDetailField = Value - End Set - End Property - - Public Property Status() As TStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(StatusMessage)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current StatusMessage object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an StatusMessage object - ''' - '''string workflow markup to deserialize - '''Output StatusMessage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As StatusMessage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, StatusMessage) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As StatusMessage) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As StatusMessage - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), StatusMessage) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current StatusMessage 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an StatusMessage object - ''' - '''string xml file to load and deserialize - '''Output StatusMessage object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As StatusMessage, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, StatusMessage) - 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 StatusMessage) 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 StatusMessage - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class - - Partial Public Class TStatusResponse - - Private statusField As TStatus - - Private Shared sSerializer As System.Xml.Serialization.XmlSerializer - - Public Sub New() - MyBase.New - Me.statusField = New TStatus() - End Sub - - Public Property Status() As TStatus - Get - Return Me.statusField - End Get - Set - Me.statusField = Value - End Set - End Property - - Private Shared ReadOnly Property Serializer() As System.Xml.Serialization.XmlSerializer - Get - If (sSerializer Is Nothing) Then - sSerializer = New System.Xml.Serialization.XmlSerializer(GetType(TStatusResponse)) - End If - Return sSerializer - End Get - End Property - -#Region "Serialize/Deserialize" - ''' - '''Serializes current TStatusResponse object into an XML document - ''' - '''string XML value - Public Overridable Function Serialize() As String - Dim streamReader As System.IO.StreamReader = Nothing - Dim memoryStream As System.IO.MemoryStream = Nothing - Try - memoryStream = New System.IO.MemoryStream() - Serializer.Serialize(memoryStream, Me) - memoryStream.Seek(0, System.IO.SeekOrigin.Begin) - streamReader = New System.IO.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 workflow markup into an TStatusResponse object - ''' - '''string workflow markup to deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - Try - obj = Deserialize(xml) - Return True - Catch ex As System.Exception - exception = ex - Return False - End Try - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String, ByRef obj As TStatusResponse) As Boolean - Dim exception As System.Exception = Nothing - Return Deserialize(xml, obj, exception) - End Function - - Public Overloads Shared Function Deserialize(ByVal xml As String) As TStatusResponse - Dim stringReader As System.IO.StringReader = Nothing - Try - stringReader = New System.IO.StringReader(xml) - Return CType(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)), TStatusResponse) - Finally - If (Not (stringReader) Is Nothing) Then - stringReader.Dispose() - End If - End Try - End Function - - ''' - '''Serializes current TStatusResponse 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 System.IO.StreamWriter = Nothing - Try - Dim xmlString As String = Serialize() - Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName) - streamWriter = xmlFile.CreateText - streamWriter.WriteLine(xmlString) - streamWriter.Close() - Finally - If (Not (streamWriter) Is Nothing) Then - streamWriter.Dispose() - End If - End Try - End Sub - - ''' - '''Deserializes xml markup from file into an TStatusResponse object - ''' - '''string xml file to load and deserialize - '''Output TStatusResponse object - '''output Exception value if deserialize failed - '''true if this XmlSerializer can deserialize the object; otherwise, false - Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TStatusResponse, ByRef exception As System.Exception) As Boolean - exception = Nothing - obj = CType(Nothing, TStatusResponse) - 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 TStatusResponse) 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 TStatusResponse - Dim file As System.IO.FileStream = Nothing - Dim sr As System.IO.StreamReader = Nothing - Try - file = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read) - sr = New System.IO.StreamReader(file) - Dim xmlString As String = sr.ReadToEnd - sr.Close() - file.Close() - Return Deserialize(xmlString) - 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 Region - End Class -End Namespace diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.xsd b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.xsd deleted file mode 100644 index 467837c4..00000000 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/MicMetadata.xsd +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - Details of the connection to the ERP-System - - - - - - The partner ID is a unique ID provided by the MIC-System and classify the ERP-System of the customer. This information is given by MIC. - - - - - Creation date/time of the message in the ERP-System - - - - - - - Action Requested for automatic processing - - - - - Action code for automatic processing - - - - - - - - - - - additional parameters - - - - - - - - - - - MIC Interface Message Envelope: description of the single message - - - - - Unique Message ID - - - - - Party ID is used as a separations of departments or single message groups - - - - - Unique Identifier of a transaction (declaration) e.g. MRN or LRN - - - - - Running number of the transaction Id - - - - - The ActionCode definies the autmoatic process in the MIC-Application. - - - - - - - Status message with Metadata and MessageDetail - - - - - - - - Set of Messages - - - - - - - - Status response message used for synchronous answers - - - - - Set of Messages - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unique reference number generated in MIC - - - - - - - - - - MIC company - - - - - MIC plant - - - - - Reference type used in MIC - - - - - Reference sid used MIC - - - - - - - Envelope:Unique transaction ID used for communication with EDIS webservice - - - - - - - - Envelope:running count - - - - - - envelope:Unique Message ID used for communication in message envelope - - - - - - - - - Envelope: communication pary - - - - - - - - - Envelope: communication partner - - - - - - - - - Connection ID of the MIC-Webservice - - - - - - - diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/cMIC.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/cMIC.vb index 0d3d0d4a..bb0c144b 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/cMIC.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MIC/cMIC.vb @@ -31,10 +31,10 @@ - Shared Function getInvPartner(KdNr As Integer, NameText As String, Type As String) As MIC_IMPORT.TPartner + Shared Function getInvPartner(KdNr As Integer, NameText As String, Type As String) As MicCustImportMessage.TMicPartner If KdNr > 0 Then - Dim PARTNER As New MIC_IMPORT.TPartner + Dim PARTNER As New MicCustImportMessage.TMicPartner Dim AD As New cAdressen(KdNr) Dim KD As New cKunde(KdNr) PARTNER.partnerType = Type @@ -48,7 +48,7 @@ PARTNER.PartnerAddress.addrTin = KD.EORITIN Return PARTNER ElseIf If(NameText, "") <> "" Then - Dim PARTNER As New MIC_IMPORT.TPartner + Dim PARTNER As New MicCustImportMessage.TMicPartner PARTNER.partnerType = Type PARTNER.PartnerAddress.addrName.Add(NameText) Return PARTNER @@ -63,11 +63,11 @@ 'Dim Interface_VERSION = "003" 'Dim ObjectAktion = DY_ACTION - Dim XML As New MIC_EXPORT.ExportShipment - 'Transaktion: - XML.ShipmentHead.company = "VERAG" - XML.ShipmentHead.plant = "GB/01" - XML.ShipmentHead.shipmentId = BezugsNr + 'Dim XML As New MIC_EXPORT.ExportShipment + ''Transaktion: + 'XML.ShipmentHead.company = "VERAG" + 'XML.ShipmentHead.plant = "GB/01" + 'XML.ShipmentHead.shipmentId = BezugsNr saveFile = getDefaultFolder_SEND("NCTS") & "MIC_NCTS_" & Now.ToString("yyMMdd_HHmmss") & ".xml" @@ -81,7 +81,7 @@ 'saveFile = saveDir & "MIC_" & Now.ToString("yyMMdd_HHmmss") & ".xml" 'MsgBox(saveFile) - XML.SaveToFile(saveFile) + 'XML.SaveToFile(saveFile) replaceNullDateXML(saveFile) @@ -98,16 +98,16 @@ Shared Function generateIMPORT(AVISO As cAviso, SENDUNG As cSendungen, ByRef saveFile As String, ByRef BezugsNr As String) As Boolean Dim Interface_VERSION = "000" - Dim XML As New MIC_IMPORT.InsertImportShipment + Dim XML_IMP As New MicCustImportMessage.MicCustImportMessage + - Dim XML_IMP = XML.ImportShipmentMessage.ImportShipment 'XML.schemaVersion = XML_IMP.Shipment.company = "VERAG" - XML_IMP.Shipment.plant = "GB/01" + XML_IMP.Shipment.plant = "NL/01" XML_IMP.Shipment.shipmentId = BezugsNr - XML_IMP.Shipment.ShipmentHead.shipmentType = MIC_IMPORT.TShipmentHeadShipmentType.E 'E:Import + XML_IMP.Shipment.ShipmentHead.shipmentType = MicCustImportMessage.TMicShipmentHeadShipmentType.E 'E:Import XML_IMP.Shipment.ShipmentHead.customsDate = Now If SENDUNG.tblSnd_Gewicht IsNot Nothing AndAlso IsNumeric(SENDUNG.tblSnd_Gewicht) Then XML_IMP.Shipment.ShipmentHead.grossWeight = CDec(SENDUNG.tblSnd_Gewicht) 'XML.Shipment.ShipmentHead.departurePlace = Now @@ -118,36 +118,36 @@ XML_IMP.Shipment.ShipmentHead.MotInland.motVehicle = AVISO.LKW_Nr XML_IMP.Shipment.ShipmentHead.MotInland.motCountry = AVISO.LKW_Nationalitaet - Dim INV As New MIC_IMPORT.TInvoice + Dim INV As New MicCustImportMessage.TMicInvoice - Dim ILN As New MIC_IMPORT.TInvoiceLine + Dim ILN As New MicCustImportMessage.TMicInvoiceLine Dim Partner_IM = getInvPartner(SENDUNG.tblSnd_EmpfaengerKdNr, SENDUNG.tblSnd_Empfaenger, "IM") - If Partner_IM IsNot Nothing Then ILN.Partners.Add(Partner_IM) + If Partner_IM IsNot Nothing Then ILN.Partners.Partner.Add(Partner_IM) - Dim Partner_CZ = getInvPartner(SENDUNG.tblSnd_AbsenderKdNr, SENDUNG.tblSnd_Absender, "CZ") - If Partner_CZ IsNot Nothing Then ILN.Partners.Add(Partner_CZ) + Dim Partner_CZ = getInvPartner(SENDUNG.tblSnd_AbsenderKdNr, SENDUNG.tblSnd_Absender, "CZ") + If Partner_CZ IsNot Nothing Then ILN.Partners.Partner.Add(Partner_CZ) - INV.InvoiceLines.Add(ILN) + INV.InvoiceLines.Line.Add(ILN) - XML_IMP.Invoice.Add(INV) + XML_IMP.Invoice.Add(INV) - Dim CF_BezugsNr = New MIC_IMPORT.TCustomerText() - CF_BezugsNr.key = 1 - CF_BezugsNr.value = BezugsNr - XML_IMP.Shipment.ShipmentHead.CustomerFields.Texts.Add(CF_BezugsNr) + 'Dim CF_BezugsNr = New MicCustImportMessage.TMicImportCustomerFields + 'CF_BezugsNr.text1 = BezugsNr - XML_IMP.Shipment.ShipmentHead.countryDestination = "UK" - XML_IMP.Shipment.ShipmentHead.creationDate = Now - XML_IMP.Shipment.ShipmentHead.creationUser = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME + XML_IMP.Shipment.ShipmentHead.CustomerFields.text1 = BezugsNr + + XML_IMP.Shipment.ShipmentHead.countryDestination = "NL" + XML_IMP.Shipment.ShipmentHead.creationDate = Now + XML_IMP.Shipment.ShipmentHead.creationUser = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME If SENDUNG.tblSnd_Frachtkosten IsNot Nothing Then XML_IMP.Shipment.ShipmentHead.Freight.frtAmount = SENDUNG.tblSnd_Frachtkosten saveFile = getDefaultFolder_SEND("IMPORT") & "MIC_IMPORT_" & Now.ToString("yyMMdd_HHmmss") & ".xml" 'MsgBox(saveFile) - XML.SaveToFile(saveFile) + XML_IMP.SaveToFile(saveFile) replaceNullDateXML(saveFile) Return True diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj index cef0a197..0d211557 100644 --- a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj +++ b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj @@ -452,6 +452,17 @@ + + + + + + + + + + + @@ -751,16 +762,6 @@ - - - - - - - - - - @@ -1061,34 +1062,40 @@ Designer - + Designer - + Designer - + Designer - + Designer - + Designer - + Designer - + Designer - + + Designer - + Designer - + + Designer + + + + Designer