'' ------------------------------------------------------------------------------
''  <auto-generated>
''    Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL) 
''    <NameSpace>MicCustExportInvoiceTypes</NameSpace><Collection>List</Collection><codeType>VisualBasic</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>False</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>False</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net40</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>False</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitializeFields>True</EnableInitializeFields>
''  </auto-generated>
'' ------------------------------------------------------------------------------
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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TInvoiceHead object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceHead object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceHead object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceHead object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceHead object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceHead object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TAddress object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TAddress object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TAddress object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TAddress object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TAddress object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TAddress object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TContactPerson object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TContactPerson object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TContactPerson object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TContactPerson object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TContactPerson object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TContactPerson object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TCustomerNumber object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TCustomerNumber object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TCustomerNumber object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TCustomerNumber object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TCustomerNumber object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TCustomerNumber object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TCustomerFlag object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TCustomerFlag object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TCustomerFlag object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TCustomerFlag object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TCustomerFlag object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TCustomerFlag object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TCustomerDate object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TCustomerDate object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TCustomerDate object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TCustomerDate object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TCustomerDate object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TCustomerDate object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TCustomerText object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TCustomerText object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TCustomerText object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TCustomerText object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TCustomerText object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TCustomerText object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlArrayItemAttribute("text", IsNullable:=False)>
        Public Property texts() As List(Of TCustomerText)
            Get
                Return Me.textsField
            End Get
            Set
                Me.textsField = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlArrayItemAttribute("date", IsNullable:=False)>
        Public Property dates() As List(Of TCustomerDate)
            Get
                Return Me.datesField
            End Get
            Set
                Me.datesField = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlArrayItemAttribute("flag", IsNullable:=False)>
        Public Property flags() As List(Of TCustomerFlag)
            Get
                Return Me.flagsField
            End Get
            Set
                Me.flagsField = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlArrayItemAttribute("number", IsNullable:=False)>
        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"
        '''<summary>
        '''Serializes current TCustomerFields object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TCustomerFields object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TCustomerFields object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TCustomerFields object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TCustomerFields object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TCustomerFields object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TDocuments object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TDocuments object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TDocuments object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TDocuments object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TDocuments object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TDocuments object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TAddCosts object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TAddCosts object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TAddCosts object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TAddCosts object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TAddCosts object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TAddCosts object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<remarks/>
        P

        '''<remarks/>
        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"
        '''<summary>
        '''Serializes current TDelTerm object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TDelTerm object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TDelTerm object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TDelTerm object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TDelTerm object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TDelTerm object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TInvoiceHeadEndUser object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceHeadEndUser object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceHeadEndUser object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceHeadEndUser object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceHeadEndUser object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceHeadEndUser object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TInvoiceLine object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceLine object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceLine object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceLine object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceLine object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceLine object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TPreviousDocument object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TPreviousDocument object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TPreviousDocument object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TPreviousDocument object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TPreviousDocument object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TPreviousDocument object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TItem object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TItem object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TItem object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TItem object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TItem object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TItem object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TInvoiceLineDelTerm object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceLineDelTerm object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceLineDelTerm object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceLineDelTerm object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceLineDelTerm object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceLineDelTerm object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TDelNote object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TDelNote object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TDelNote object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TDelNote object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TDelNote object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TDelNote object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TOrder object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TOrder object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TOrder object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TOrder object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TOrder object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TOrder object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TBomNo object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TBomNo object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TBomNo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TBomNo object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TBomNo object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TBomNo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TAttribute object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TAttribute object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TAttribute object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TAttribute object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TAttribute object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TAttribute object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TContainer object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TContainer object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TContainer object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TContainer object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TContainer object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TContainer object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("")>
        Item

        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("0")>
        Item0

        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("1")>
        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"
        '''<summary>
        '''Serializes current TInvoiceLineShipTo object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceLineShipTo object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceLineShipTo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceLineShipTo object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceLineShipTo object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceLineShipTo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TInvoiceLineEndUser object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoiceLineEndUser object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoiceLineEndUser object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoiceLineEndUser object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoiceLineEndUser object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoiceLineEndUser object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TImportReference object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TImportReference object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TImportReference object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TImportReference object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TImportReference object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TImportReference object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TImportQuantity object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TImportQuantity object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TImportQuantity object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TImportQuantity object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TImportQuantity object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TImportQuantity object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TRegInfo object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TRegInfo object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TRegInfo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TRegInfo object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TRegInfo object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TRegInfo object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TErpLineData object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TErpLineData object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TErpLineData object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TErpLineData object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TErpLineData object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TErpLineData object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TSeal object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TSeal object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TSeal object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TSeal object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TSeal object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TSeal object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TInvoice object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TInvoice object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TInvoice object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TInvoice object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TInvoice object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TInvoice object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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"
        '''<summary>
        '''Serializes current TPackage object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TPackage object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TPackage object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TPackage object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TPackage object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TPackage object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TPackageHead object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TPackageHead object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TPackageHead object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TPackageHead object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TPackageHead object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TPackageHead object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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

        <System.Xml.Serialization.XmlIgnoreAttribute()>
        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"
        '''<summary>
        '''Serializes current TPackageLine object into an XML document
        '''</summary>
        '''<returns>string XML value</returns>
        Public Overridable Function Serialize() As String
            Dim streamReader As System.IO.StreamReader = Nothing
            Dim memoryStream As System.IO.MemoryStream = Nothing
            Try
                memoryStream = New System.IO.MemoryStream()
                Serializer.Serialize(memoryStream, Me)
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        '''<summary>
        '''Deserializes workflow markup into an TPackageLine object
        '''</summary>
        '''<param name="xml">string workflow markup to deserialize</param>
        '''<param name="obj">Output TPackageLine object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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

        '''<summary>
        '''Serializes current TPackageLine object into file
        '''</summary>
        '''<param name="fileName">full path of outupt xml file</param>
        '''<param name="exception">output Exception value if failed</param>
        '''<returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            Dim streamWriter As System.IO.StreamWriter = Nothing
            Try
                Dim xmlString As String = Serialize()
                Dim xmlFile As System.IO.FileInfo = New System.IO.FileInfo(fileName)
                streamWriter = xmlFile.CreateText
                streamWriter.WriteLine(xmlString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        '''<summary>
        '''Deserializes xml markup from file into an TPackageLine object
        '''</summary>
        '''<param name="fileName">string xml file to load and deserialize</param>
        '''<param name="obj">Output TPackageLine object</param>
        '''<param name="exception">output Exception value if deserialize failed</param>
        '''<returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        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
