'' ------------------------------------------------------------------------------
''  <auto-generated>
''    Generated by Xsd2Code++. Version 5.0.0.47. www.xsd2code.com
''    <NameSpace>MIC_EXPORT_InvoiceTypes</NameSpace><Collection>List</Collection><codeType>VisualBasic</codeType><EnableDataBinding>False</EnableDataBinding><GenerateCloneMethod>False</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><DataMemberNameArg>OnlyIfDifferent</DataMemberNameArg><DataMemberOnXmlIgnore>False</DataMemberOnXmlIgnore><CodeBaseTag>Net45</CodeBaseTag><InitializeFields>All</InitializeFields><GenerateUnusedComplexTypes>True</GenerateUnusedComplexTypes><GenerateUnusedSimpleTypes>True</GenerateUnusedSimpleTypes><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableLazyLoading>False</EnableLazyLoading><VirtualProp>False</VirtualProp><PascalCase>False</PascalCase><AutomaticProperties>False</AutomaticProperties><PropNameSpecified>None</PropNameSpecified><PrivateFieldName>StartWithUnderscore</PrivateFieldName><PrivateFieldNamePrefix></PrivateFieldNamePrefix><EnableRestriction>False</EnableRestriction><RestrictionMaxLenght>False</RestrictionMaxLenght><RestrictionRegEx>False</RestrictionRegEx><RestrictionRange>False</RestrictionRange><ValidateProperty>False</ValidateProperty><ClassNamePrefix></ClassNamePrefix><ClassLevel>Public</ClassLevel><PartialClass>True</PartialClass><ClassesInSeparateFiles>False</ClassesInSeparateFiles><ClassesInSeparateFilesDir></ClassesInSeparateFilesDir><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>False</EnableSummaryComment><EnableAppInfoSettings>False</EnableAppInfoSettings><EnableExternalSchemasCache>False</EnableExternalSchemasCache><EnableDebug>False</EnableDebug><EnableWarn>True</EnableWarn><ExcludeImportedTypes>True</ExcludeImportedTypes><ExpandNesteadAttributeGroup>True</ExpandNesteadAttributeGroup><CleanupCode>False</CleanupCode><EnableXmlSerialization>True</EnableXmlSerialization><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><EnableEncoding>False</EnableEncoding><EnableXMLIndent>True</EnableXMLIndent><IndentChar>Indent2Space</IndentChar><NewLineAttr>False</NewLineAttr><OmitXML>False</OmitXML><Encoder>UTF8</Encoder><Serializer>XmlSerializer</Serializer><sspNullable>False</sspNullable><sspString>False</sspString><sspCollection>False</sspCollection><sspComplexType>False</sspComplexType><sspSimpleType>False</sspSimpleType><sspEnumType>False</sspEnumType><XmlSerializerEvent>False</XmlSerializerEvent><BaseClassName>EntityBase</BaseClassName><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><CustomUsings></CustomUsings><AttributesToExlude></AttributesToExlude>
''  </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.Xml
Imports System.Collections.Generic
Imports VERAG_PROG_ALLGEMEIN.MIC_EXPORT_Components

Namespace MIC_EXPORT_InvoiceTypes

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TInvoiceHead

#Region "Private fields"
        Private _invoiceNo As String

        Private _invoiceDate As Date

        Private _invType As String

        Private _totAmount As Decimal

        Private _curr As String

        Private _shipTo As TAddress

        Private _endUser As TInvoiceHeadEndUser

        Private _delTerm As TDelTerm

        Private _billTo As TAddress

        Private _ref As String

        Private _tradeCtry As String

        Private _gWeight As Decimal

        Private _nWeight As Decimal

        Private _addCosts As List(Of TAddCosts)

        Private _bol As String

        Private _transpNr As String

        Private _addtext As List(Of String)

        Private _documents As List(Of TDocuments)

        Private _mrnExt As String

        Private _numberOfPackages As Decimal

        Private _transportType As String

        Private _customerFields As TCustomerFields

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._customerFields = New TCustomerFields()
            Me._documents = New List(Of TDocuments)()
            Me._addtext = New List(Of String)()
            Me._addCosts = New List(Of TAddCosts)()
            Me._billTo = New TAddress()
            Me._delTerm = New TDelTerm()
            Me._endUser = New TInvoiceHeadEndUser()
            Me._shipTo = New TAddress()
        End Sub

        Public Property invoiceNo() As String
            Get
                Return Me._invoiceNo
            End Get
            Set
                Me._invoiceNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property invoiceDate() As Date
            Get
                Return Me._invoiceDate
            End Get
            Set
                Me._invoiceDate = Value
            End Set
        End Property

        Public Property invType() As String
            Get
                Return Me._invType
            End Get
            Set
                Me._invType = Value
            End Set
        End Property

        Public Property totAmount() As Decimal
            Get
                Return Me._totAmount
            End Get
            Set
                Me._totAmount = Value
            End Set
        End Property

        Public Property curr() As String
            Get
                Return Me._curr
            End Get
            Set
                Me._curr = Value
            End Set
        End Property

        Public Property shipTo() As TAddress
            Get
                Return Me._shipTo
            End Get
            Set
                Me._shipTo = Value
            End Set
        End Property

        Public Property endUser() As TInvoiceHeadEndUser
            Get
                Return Me._endUser
            End Get
            Set
                Me._endUser = Value
            End Set
        End Property

        Public Property delTerm() As TDelTerm
            Get
                Return Me._delTerm
            End Get
            Set
                Me._delTerm = Value
            End Set
        End Property

        Public Property billTo() As TAddress
            Get
                Return Me._billTo
            End Get
            Set
                Me._billTo = Value
            End Set
        End Property

        Public Property ref() As String
            Get
                Return Me._ref
            End Get
            Set
                Me._ref = Value
            End Set
        End Property

        Public Property tradeCtry() As String
            Get
                Return Me._tradeCtry
            End Get
            Set
                Me._tradeCtry = Value
            End Set
        End Property

        Public Property gWeight() As Decimal
            Get
                Return Me._gWeight
            End Get
            Set
                Me._gWeight = Value
            End Set
        End Property

        Public Property nWeight() As Decimal
            Get
                Return Me._nWeight
            End Get
            Set
                Me._nWeight = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addCosts")>
        Public Property addCosts() As List(Of TAddCosts)
            Get
                Return Me._addCosts
            End Get
            Set
                Me._addCosts = Value
            End Set
        End Property

        Public Property bol() As String
            Get
                Return Me._bol
            End Get
            Set
                Me._bol = Value
            End Set
        End Property

        Public Property transpNr() As String
            Get
                Return Me._transpNr
            End Get
            Set
                Me._transpNr = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addtext")>
        Public Property addtext() As List(Of String)
            Get
                Return Me._addtext
            End Get
            Set
                Me._addtext = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("documents")>
        Public Property documents() As List(Of TDocuments)
            Get
                Return Me._documents
            End Get
            Set
                Me._documents = Value
            End Set
        End Property

        Public Property mrnExt() As String
            Get
                Return Me._mrnExt
            End Get
            Set
                Me._mrnExt = Value
            End Set
        End Property

        Public Property numberOfPackages() As Decimal
            Get
                Return Me._numberOfPackages
            End Get
            Set
                Me._numberOfPackages = Value
            End Set
        End Property

        Public Property transportType() As String
            Get
                Return Me._transportType
            End Get
            Set
                Me._transportType = Value
            End Set
        End Property

        Public Property customerFields() As TCustomerFields
            Get
                Return Me._customerFields
            End Get
            Set
                Me._customerFields = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceHead))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceHead object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceHead, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceHead)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceHead) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceHead
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceHead)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceHead
            Return CType(Serializer.Deserialize(s), TInvoiceHead)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TDocuments

#Region "Private fields"
        Private _docNo As String

        Private _docDate As Date

        Private _docType As String

        Private _docQual As String

        Private _docValidFrom As Date

        Private _docValidTo As Date

        Private _docAddText As String

        Private _docQuantity As Decimal

        Private _docUnit As String

        Private _docDetail As String

        Private _docValue As Decimal

        Private _docStatUnit As String

        Private _docDepreciateQuantity As Decimal

        Private _docSupplier As String

        Private _docCategory As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property docNo() As String
            Get
                Return Me._docNo
            End Get
            Set
                Me._docNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property docDate() As Date
            Get
                Return Me._docDate
            End Get
            Set
                Me._docDate = Value
            End Set
        End Property

        Public Property docType() As String
            Get
                Return Me._docType
            End Get
            Set
                Me._docType = Value
            End Set
        End Property

        Public Property docQual() As String
            Get
                Return Me._docQual
            End Get
            Set
                Me._docQual = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property docValidFrom() As Date
            Get
                Return Me._docValidFrom
            End Get
            Set
                Me._docValidFrom = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property docValidTo() As Date
            Get
                Return Me._docValidTo
            End Get
            Set
                Me._docValidTo = Value
            End Set
        End Property

        Public Property docAddText() As String
            Get
                Return Me._docAddText
            End Get
            Set
                Me._docAddText = Value
            End Set
        End Property

        Public Property docQuantity() As Decimal
            Get
                Return Me._docQuantity
            End Get
            Set
                Me._docQuantity = Value
            End Set
        End Property

        Public Property docUnit() As String
            Get
                Return Me._docUnit
            End Get
            Set
                Me._docUnit = Value
            End Set
        End Property

        Public Property docDetail() As String
            Get
                Return Me._docDetail
            End Get
            Set
                Me._docDetail = Value
            End Set
        End Property

        Public Property docValue() As Decimal
            Get
                Return Me._docValue
            End Get
            Set
                Me._docValue = Value
            End Set
        End Property

        Public Property docStatUnit() As String
            Get
                Return Me._docStatUnit
            End Get
            Set
                Me._docStatUnit = Value
            End Set
        End Property

        Public Property docDepreciateQuantity() As Decimal
            Get
                Return Me._docDepreciateQuantity
            End Get
            Set
                Me._docDepreciateQuantity = Value
            End Set
        End Property

        Public Property docSupplier() As String
            Get
                Return Me._docSupplier
            End Get
            Set
                Me._docSupplier = Value
            End Set
        End Property

        Public Property docCategory() As String
            Get
                Return Me._docCategory
            End Get
            Set
                Me._docCategory = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TDocuments))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TDocuments object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TDocuments, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TDocuments)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TDocuments) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TDocuments
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TDocuments)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TDocuments
            Return CType(Serializer.Deserialize(s), TDocuments)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TInvoiceHeadEndUser

#Region "Private fields"
        Private _addrNo As String

        Private _addrName As List(Of String)

        Private _addrStreet As String

        Private _addrLoc As String

        Private _addrCtry As String

        Private _addrZip As String

        Private _addrTin As String

        Private _addrEori As String

        Private _addrNatT As String

        Private _branchNo As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._addrName = New List(Of String)()
        End Sub

        Public Property addrNo() As String
            Get
                Return Me._addrNo
            End Get
            Set
                Me._addrNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addrName")>
        Public Property addrName() As List(Of String)
            Get
                Return Me._addrName
            End Get
            Set
                Me._addrName = Value
            End Set
        End Property

        Public Property addrStreet() As String
            Get
                Return Me._addrStreet
            End Get
            Set
                Me._addrStreet = Value
            End Set
        End Property

        Public Property addrLoc() As String
            Get
                Return Me._addrLoc
            End Get
            Set
                Me._addrLoc = Value
            End Set
        End Property

        Public Property addrCtry() As String
            Get
                Return Me._addrCtry
            End Get
            Set
                Me._addrCtry = Value
            End Set
        End Property

        Public Property addrZip() As String
            Get
                Return Me._addrZip
            End Get
            Set
                Me._addrZip = Value
            End Set
        End Property

        Public Property addrTin() As String
            Get
                Return Me._addrTin
            End Get
            Set
                Me._addrTin = Value
            End Set
        End Property

        Public Property addrEori() As String
            Get
                Return Me._addrEori
            End Get
            Set
                Me._addrEori = Value
            End Set
        End Property

        Public Property addrNatT() As String
            Get
                Return Me._addrNatT
            End Get
            Set
                Me._addrNatT = Value
            End Set
        End Property

        Public Property branchNo() As String
            Get
                Return Me._branchNo
            End Get
            Set
                Me._branchNo = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceHeadEndUser))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceHeadEndUser object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceHeadEndUser, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceHeadEndUser)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceHeadEndUser) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceHeadEndUser
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceHeadEndUser)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceHeadEndUser
            Return CType(Serializer.Deserialize(s), TInvoiceHeadEndUser)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TInvoiceLine

#Region "Private fields"
        Private _lineNo As String

        Private _unitPrice As Decimal

        Private _amount As Decimal

        Private _nWeight As Decimal

        Private _gWeight As Decimal

        Private _statQuant As Decimal

        Private _statUnit As String

        Private _statVal As Decimal

        Private _custProc As String

        Private _eUCode As String

        Private _statCode As String

        Private _transType As String

        Private _coo As String

        Private _cooState As String

        Private _addText As List(Of String)

        Private _prevDoc As List(Of TPreviousDocument)

        Private _item As TItem

        Private _documents As List(Of TDocuments)

        Private _delTerm As TInvoiceLineDelTerm

        Private _quantity As Decimal

        Private _unit As String

        Private _delnote As TDelNote

        Private _order As TOrder

        Private _itemRef As String

        Private _addCosts As List(Of TAddCosts)

        Private _addCode As List(Of String)

        Private _natCode As List(Of String)

        Private _stockTypeAdd As String

        Private _stockTypeDed As String

        Private _bom As TBomNo

        Private _accountNo As String

        Private _customerFields As TCustomerFields

        Private _attributes As List(Of TAttribute)

        Private _containers As List(Of TContainer)

        Private _shipmentIdentification As String

        Private _uNDG As String

        Private _consigneeEndUserFlag As String

        Private _endUserInEam As TInvoiceLineEndUserInEam

        Private _carriageCosts As String

        Private _shipTo As TInvoiceLineShipTo

        Private _endUser As TInvoiceLineEndUser

        Private _importReference As List(Of TImportReference)

        Private _registrationInfo As TRegInfo

        Private _serialNo As String

        Private _referenceValue As Decimal

        Private _model As String

        Private _brand As String

        Private _addedValue As Decimal

        Private _ctoId As String

        Private _infoText2 As String

        Private _branchNo As String

        Private _additionalInformation As List(Of TAttribute)

        Private _trackingNumber As String

        Private _erpData As TErpLineData

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._erpData = New TErpLineData()
            Me._additionalInformation = New List(Of TAttribute)()
            Me._registrationInfo = New TRegInfo()
            Me._importReference = New List(Of TImportReference)()
            Me._endUser = New TInvoiceLineEndUser()
            Me._shipTo = New TInvoiceLineShipTo()
            Me._containers = New List(Of TContainer)()
            Me._attributes = New List(Of TAttribute)()
            Me._customerFields = New TCustomerFields()
            Me._bom = New TBomNo()
            Me._natCode = New List(Of String)()
            Me._addCode = New List(Of String)()
            Me._addCosts = New List(Of TAddCosts)()
            Me._order = New TOrder()
            Me._delnote = New TDelNote()
            Me._delTerm = New TInvoiceLineDelTerm()
            Me._documents = New List(Of TDocuments)()
            Me._item = New TItem()
            Me._prevDoc = New List(Of TPreviousDocument)()
            Me._addText = New List(Of String)()
        End Sub

        <System.Xml.Serialization.XmlElementAttribute(DataType:="integer")>
        Public Property lineNo() As String
            Get
                Return Me._lineNo
            End Get
            Set
                Me._lineNo = Value
            End Set
        End Property

        Public Property unitPrice() As Decimal
            Get
                Return Me._unitPrice
            End Get
            Set
                Me._unitPrice = Value
            End Set
        End Property

        Public Property amount() As Decimal
            Get
                Return Me._amount
            End Get
            Set
                Me._amount = Value
            End Set
        End Property

        Public Property nWeight() As Decimal
            Get
                Return Me._nWeight
            End Get
            Set
                Me._nWeight = Value
            End Set
        End Property

        Public Property gWeight() As Decimal
            Get
                Return Me._gWeight
            End Get
            Set
                Me._gWeight = Value
            End Set
        End Property

        Public Property statQuant() As Decimal
            Get
                Return Me._statQuant
            End Get
            Set
                Me._statQuant = Value
            End Set
        End Property

        Public Property statUnit() As String
            Get
                Return Me._statUnit
            End Get
            Set
                Me._statUnit = Value
            End Set
        End Property

        Public Property statVal() As Decimal
            Get
                Return Me._statVal
            End Get
            Set
                Me._statVal = Value
            End Set
        End Property

        Public Property custProc() As String
            Get
                Return Me._custProc
            End Get
            Set
                Me._custProc = Value
            End Set
        End Property

        Public Property EUCode() As String
            Get
                Return Me._eUCode
            End Get
            Set
                Me._eUCode = Value
            End Set
        End Property

        Public Property statCode() As String
            Get
                Return Me._statCode
            End Get
            Set
                Me._statCode = Value
            End Set
        End Property

        Public Property transType() As String
            Get
                Return Me._transType
            End Get
            Set
                Me._transType = Value
            End Set
        End Property

        Public Property coo() As String
            Get
                Return Me._coo
            End Get
            Set
                Me._coo = Value
            End Set
        End Property

        Public Property cooState() As String
            Get
                Return Me._cooState
            End Get
            Set
                Me._cooState = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addText")>
        Public Property addText() As List(Of String)
            Get
                Return Me._addText
            End Get
            Set
                Me._addText = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("prevDoc")>
        Public Property prevDoc() As List(Of TPreviousDocument)
            Get
                Return Me._prevDoc
            End Get
            Set
                Me._prevDoc = Value
            End Set
        End Property

        Public Property item() As TItem
            Get
                Return Me._item
            End Get
            Set
                Me._item = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("documents")>
        Public Property documents() As List(Of TDocuments)
            Get
                Return Me._documents
            End Get
            Set
                Me._documents = Value
            End Set
        End Property

        Public Property delTerm() As TInvoiceLineDelTerm
            Get
                Return Me._delTerm
            End Get
            Set
                Me._delTerm = Value
            End Set
        End Property

        Public Property quantity() As Decimal
            Get
                Return Me._quantity
            End Get
            Set
                Me._quantity = Value
            End Set
        End Property

        Public Property unit() As String
            Get
                Return Me._unit
            End Get
            Set
                Me._unit = Value
            End Set
        End Property

        Public Property delnote() As TDelNote
            Get
                Return Me._delnote
            End Get
            Set
                Me._delnote = Value
            End Set
        End Property

        Public Property order() As TOrder
            Get
                Return Me._order
            End Get
            Set
                Me._order = Value
            End Set
        End Property

        Public Property itemRef() As String
            Get
                Return Me._itemRef
            End Get
            Set
                Me._itemRef = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addCosts")>
        Public Property addCosts() As List(Of TAddCosts)
            Get
                Return Me._addCosts
            End Get
            Set
                Me._addCosts = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addCode")>
        Public Property addCode() As List(Of String)
            Get
                Return Me._addCode
            End Get
            Set
                Me._addCode = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("natCode")>
        Public Property natCode() As List(Of String)
            Get
                Return Me._natCode
            End Get
            Set
                Me._natCode = Value
            End Set
        End Property

        Public Property stockTypeAdd() As String
            Get
                Return Me._stockTypeAdd
            End Get
            Set
                Me._stockTypeAdd = Value
            End Set
        End Property

        Public Property stockTypeDed() As String
            Get
                Return Me._stockTypeDed
            End Get
            Set
                Me._stockTypeDed = Value
            End Set
        End Property

        Public Property bom() As TBomNo
            Get
                Return Me._bom
            End Get
            Set
                Me._bom = Value
            End Set
        End Property

        Public Property accountNo() As String
            Get
                Return Me._accountNo
            End Get
            Set
                Me._accountNo = Value
            End Set
        End Property

        Public Property customerFields() As TCustomerFields
            Get
                Return Me._customerFields
            End Get
            Set
                Me._customerFields = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("attributes")>
        Public Property attributes() As List(Of TAttribute)
            Get
                Return Me._attributes
            End Get
            Set
                Me._attributes = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("containers")>
        Public Property containers() As List(Of TContainer)
            Get
                Return Me._containers
            End Get
            Set
                Me._containers = Value
            End Set
        End Property

        Public Property shipmentIdentification() As String
            Get
                Return Me._shipmentIdentification
            End Get
            Set
                Me._shipmentIdentification = Value
            End Set
        End Property

        Public Property UNDG() As String
            Get
                Return Me._uNDG
            End Get
            Set
                Me._uNDG = Value
            End Set
        End Property

        Public Property consigneeEndUserFlag() As String
            Get
                Return Me._consigneeEndUserFlag
            End Get
            Set
                Me._consigneeEndUserFlag = Value
            End Set
        End Property

        Public Property endUserInEam() As TInvoiceLineEndUserInEam
            Get
                Return Me._endUserInEam
            End Get
            Set
                Me._endUserInEam = Value
            End Set
        End Property

        Public Property carriageCosts() As String
            Get
                Return Me._carriageCosts
            End Get
            Set
                Me._carriageCosts = Value
            End Set
        End Property

        Public Property shipTo() As TInvoiceLineShipTo
            Get
                Return Me._shipTo
            End Get
            Set
                Me._shipTo = Value
            End Set
        End Property

        Public Property endUser() As TInvoiceLineEndUser
            Get
                Return Me._endUser
            End Get
            Set
                Me._endUser = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("importReference")>
        Public Property importReference() As List(Of TImportReference)
            Get
                Return Me._importReference
            End Get
            Set
                Me._importReference = Value
            End Set
        End Property

        Public Property registrationInfo() As TRegInfo
            Get
                Return Me._registrationInfo
            End Get
            Set
                Me._registrationInfo = Value
            End Set
        End Property

        Public Property serialNo() As String
            Get
                Return Me._serialNo
            End Get
            Set
                Me._serialNo = Value
            End Set
        End Property

        Public Property referenceValue() As Decimal
            Get
                Return Me._referenceValue
            End Get
            Set
                Me._referenceValue = Value
            End Set
        End Property

        Public Property model() As String
            Get
                Return Me._model
            End Get
            Set
                Me._model = Value
            End Set
        End Property

        Public Property brand() As String
            Get
                Return Me._brand
            End Get
            Set
                Me._brand = Value
            End Set
        End Property

        Public Property addedValue() As Decimal
            Get
                Return Me._addedValue
            End Get
            Set
                Me._addedValue = Value
            End Set
        End Property

        Public Property ctoId() As String
            Get
                Return Me._ctoId
            End Get
            Set
                Me._ctoId = Value
            End Set
        End Property

        Public Property infoText2() As String
            Get
                Return Me._infoText2
            End Get
            Set
                Me._infoText2 = Value
            End Set
        End Property

        Public Property branchNo() As String
            Get
                Return Me._branchNo
            End Get
            Set
                Me._branchNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("additionalInformation")>
        Public Property additionalInformation() As List(Of TAttribute)
            Get
                Return Me._additionalInformation
            End Get
            Set
                Me._additionalInformation = Value
            End Set
        End Property

        Public Property trackingNumber() As String
            Get
                Return Me._trackingNumber
            End Get
            Set
                Me._trackingNumber = Value
            End Set
        End Property

        Public Property erpData() As TErpLineData
            Get
                Return Me._erpData
            End Get
            Set
                Me._erpData = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLine))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceLine object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLine, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceLine)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLine) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceLine
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceLine)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceLine
            Return CType(Serializer.Deserialize(s), TInvoiceLine)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TPreviousDocument

#Region "Private fields"
        Private _docType As String

        Private _docNo As String

        Private _docAddText As String

        Private _docCategory As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property docType() As String
            Get
                Return Me._docType
            End Get
            Set
                Me._docType = Value
            End Set
        End Property

        Public Property docNo() As String
            Get
                Return Me._docNo
            End Get
            Set
                Me._docNo = Value
            End Set
        End Property

        Public Property docAddText() As String
            Get
                Return Me._docAddText
            End Get
            Set
                Me._docAddText = Value
            End Set
        End Property

        Public Property docCategory() As String
            Get
                Return Me._docCategory
            End Get
            Set
                Me._docCategory = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TPreviousDocument))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TPreviousDocument object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPreviousDocument, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TPreviousDocument)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPreviousDocument) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TPreviousDocument
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TPreviousDocument)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TPreviousDocument
            Return CType(Serializer.Deserialize(s), TPreviousDocument)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TInvoiceLineDelTerm

#Region "Private fields"
        Private _code As String

        Private _desc As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property code() As String
            Get
                Return Me._code
            End Get
            Set
                Me._code = Value
            End Set
        End Property

        Public Property desc() As String
            Get
                Return Me._desc
            End Get
            Set
                Me._desc = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineDelTerm))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceLineDelTerm object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineDelTerm, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceLineDelTerm)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineDelTerm) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceLineDelTerm
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineDelTerm)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceLineDelTerm
            Return CType(Serializer.Deserialize(s), TInvoiceLineDelTerm)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TContainer

#Region "Private fields"
        Private _contNo As String

        Private _contType As String

        Private _sealNumber As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property contNo() As String
            Get
                Return Me._contNo
            End Get
            Set
                Me._contNo = Value
            End Set
        End Property

        Public Property contType() As String
            Get
                Return Me._contType
            End Get
            Set
                Me._contType = Value
            End Set
        End Property

        Public Property sealNumber() As String
            Get
                Return Me._sealNumber
            End Get
            Set
                Me._sealNumber = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TContainer))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TContainer object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TContainer, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TContainer)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TContainer) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TContainer
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TContainer)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TContainer
            Return CType(Serializer.Deserialize(s), TContainer)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    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

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TInvoiceLineShipTo

#Region "Private fields"
        Private _addrNo As String

        Private _addrName As List(Of String)

        Private _addrStreet As String

        Private _addrLoc As String

        Private _addrCtry As String

        Private _addrState As String

        Private _addrZip As String

        Private _addrTin As String

        Private _addrEori As String

        Private _addrNatT As String

        Private _branchNo As String

        Private _addrKvb As String

        Private _contactPerson As TContactPerson

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._contactPerson = New TContactPerson()
            Me._addrName = New List(Of String)()
        End Sub

        Public Property addrNo() As String
            Get
                Return Me._addrNo
            End Get
            Set
                Me._addrNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addrName")>
        Public Property addrName() As List(Of String)
            Get
                Return Me._addrName
            End Get
            Set
                Me._addrName = Value
            End Set
        End Property

        Public Property addrStreet() As String
            Get
                Return Me._addrStreet
            End Get
            Set
                Me._addrStreet = Value
            End Set
        End Property

        Public Property addrLoc() As String
            Get
                Return Me._addrLoc
            End Get
            Set
                Me._addrLoc = Value
            End Set
        End Property

        Public Property addrCtry() As String
            Get
                Return Me._addrCtry
            End Get
            Set
                Me._addrCtry = Value
            End Set
        End Property

        Public Property addrState() As String
            Get
                Return Me._addrState
            End Get
            Set
                Me._addrState = Value
            End Set
        End Property

        Public Property addrZip() As String
            Get
                Return Me._addrZip
            End Get
            Set
                Me._addrZip = Value
            End Set
        End Property

        Public Property addrTin() As String
            Get
                Return Me._addrTin
            End Get
            Set
                Me._addrTin = Value
            End Set
        End Property

        Public Property addrEori() As String
            Get
                Return Me._addrEori
            End Get
            Set
                Me._addrEori = Value
            End Set
        End Property

        Public Property addrNatT() As String
            Get
                Return Me._addrNatT
            End Get
            Set
                Me._addrNatT = Value
            End Set
        End Property

        Public Property branchNo() As String
            Get
                Return Me._branchNo
            End Get
            Set
                Me._branchNo = Value
            End Set
        End Property

        Public Property addrKvb() As String
            Get
                Return Me._addrKvb
            End Get
            Set
                Me._addrKvb = Value
            End Set
        End Property

        Public Property contactPerson() As TContactPerson
            Get
                Return Me._contactPerson
            End Get
            Set
                Me._contactPerson = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineShipTo))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceLineShipTo object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineShipTo, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceLineShipTo)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineShipTo) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceLineShipTo
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineShipTo)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceLineShipTo
            Return CType(Serializer.Deserialize(s), TInvoiceLineShipTo)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TInvoiceLineEndUser

#Region "Private fields"
        Private _addrNo As String

        Private _addrName As List(Of String)

        Private _addrStreet As String

        Private _addrLoc As String

        Private _addrCtry As String

        Private _addrZip As String

        Private _addrTin As String

        Private _addrEori As String

        Private _addrNatT As String

        Private _branchNo As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._addrName = New List(Of String)()
        End Sub

        Public Property addrNo() As String
            Get
                Return Me._addrNo
            End Get
            Set
                Me._addrNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("addrName")>
        Public Property addrName() As List(Of String)
            Get
                Return Me._addrName
            End Get
            Set
                Me._addrName = Value
            End Set
        End Property

        Public Property addrStreet() As String
            Get
                Return Me._addrStreet
            End Get
            Set
                Me._addrStreet = Value
            End Set
        End Property

        Public Property addrLoc() As String
            Get
                Return Me._addrLoc
            End Get
            Set
                Me._addrLoc = Value
            End Set
        End Property

        Public Property addrCtry() As String
            Get
                Return Me._addrCtry
            End Get
            Set
                Me._addrCtry = Value
            End Set
        End Property

        Public Property addrZip() As String
            Get
                Return Me._addrZip
            End Get
            Set
                Me._addrZip = Value
            End Set
        End Property

        Public Property addrTin() As String
            Get
                Return Me._addrTin
            End Get
            Set
                Me._addrTin = Value
            End Set
        End Property

        Public Property addrEori() As String
            Get
                Return Me._addrEori
            End Get
            Set
                Me._addrEori = Value
            End Set
        End Property

        Public Property addrNatT() As String
            Get
                Return Me._addrNatT
            End Get
            Set
                Me._addrNatT = Value
            End Set
        End Property

        Public Property branchNo() As String
            Get
                Return Me._branchNo
            End Get
            Set
                Me._branchNo = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoiceLineEndUser))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoiceLineEndUser object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineEndUser, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoiceLineEndUser)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoiceLineEndUser) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoiceLineEndUser
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoiceLineEndUser)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoiceLineEndUser
            Return CType(Serializer.Deserialize(s), TInvoiceLineEndUser)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2")>
    Partial Public Class TRegInfo

#Region "Private fields"
        Private _registrationNumber1 As String

        Private _registrationNumber2 As String

        Private _registrationNumber3 As String

        Private _referenceNumber1 As String

        Private _referenceNumber2 As String

        Private _referenceNumber3 As String

        Private _registrationDate As Date

        Private _acceptanceDate As Date

        Private _releaseDate As Date

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property registrationNumber1() As String
            Get
                Return Me._registrationNumber1
            End Get
            Set
                Me._registrationNumber1 = Value
            End Set
        End Property

        Public Property registrationNumber2() As String
            Get
                Return Me._registrationNumber2
            End Get
            Set
                Me._registrationNumber2 = Value
            End Set
        End Property

        Public Property registrationNumber3() As String
            Get
                Return Me._registrationNumber3
            End Get
            Set
                Me._registrationNumber3 = Value
            End Set
        End Property

        Public Property referenceNumber1() As String
            Get
                Return Me._referenceNumber1
            End Get
            Set
                Me._referenceNumber1 = Value
            End Set
        End Property

        Public Property referenceNumber2() As String
            Get
                Return Me._referenceNumber2
            End Get
            Set
                Me._referenceNumber2 = Value
            End Set
        End Property

        Public Property referenceNumber3() As String
            Get
                Return Me._referenceNumber3
            End Get
            Set
                Me._referenceNumber3 = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property registrationDate() As Date
            Get
                Return Me._registrationDate
            End Get
            Set
                Me._registrationDate = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property acceptanceDate() As Date
            Get
                Return Me._acceptanceDate
            End Get
            Set
                Me._acceptanceDate = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="date")>
        Public Property releaseDate() As Date
            Get
                Return Me._releaseDate
            End Get
            Set
                Me._releaseDate = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TRegInfo))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TRegInfo object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRegInfo, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRegInfo)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRegInfo) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRegInfo
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TRegInfo)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TRegInfo
            Return CType(Serializer.Deserialize(s), TRegInfo)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TSeal

#Region "Private fields"
        Private _type As String

        Private _quantity As UInteger

        Private _sign As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property type() As String
            Get
                Return Me._type
            End Get
            Set
                Me._type = Value
            End Set
        End Property

        Public Property quantity() As UInteger
            Get
                Return Me._quantity
            End Get
            Set
                Me._quantity = Value
            End Set
        End Property

        Public Property sign() As String
            Get
                Return Me._sign
            End Get
            Set
                Me._sign = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TSeal))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TSeal object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TSeal, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TSeal)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TSeal) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TSeal
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TSeal)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TSeal
            Return CType(Serializer.Deserialize(s), TSeal)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TInvoice

#Region "Private fields"
        Private _invoiceHead As TInvoiceHead

        Private _invoiceLine As List(Of TInvoiceLine)

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._invoiceLine = New List(Of TInvoiceLine)()
            Me._invoiceHead = New TInvoiceHead()
        End Sub

        Public Property InvoiceHead() As TInvoiceHead
            Get
                Return Me._invoiceHead
            End Get
            Set
                Me._invoiceHead = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute("InvoiceLine")>
        Public Property InvoiceLine() As List(Of TInvoiceLine)
            Get
                Return Me._invoiceLine
            End Get
            Set
                Me._invoiceLine = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TInvoice))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TInvoice object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoice, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TInvoice)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TInvoice) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TInvoice
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TInvoice)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TInvoice
            Return CType(Serializer.Deserialize(s), TInvoice)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TPackageHead

#Region "Private fields"
        Private _packageNo As String

        Private _pType As String

        Private _unit As String

        Private _packageNoExt As String

        Private _gWeight As Decimal

        Private _nWeight As Decimal

        Private _tara As Decimal

        Private _unitWeight As String

        Private _volume As Decimal

        Private _grossVolume As Decimal

        Private _netVolume As Decimal

        Private _unitVolume As String

        Private _length As Decimal

        Private _width As Decimal

        Private _height As Decimal

        Private _unitlwh As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property packageNo() As String
            Get
                Return Me._packageNo
            End Get
            Set
                Me._packageNo = Value
            End Set
        End Property

        Public Property pType() As String
            Get
                Return Me._pType
            End Get
            Set
                Me._pType = Value
            End Set
        End Property

        Public Property unit() As String
            Get
                Return Me._unit
            End Get
            Set
                Me._unit = Value
            End Set
        End Property

        Public Property packageNoExt() As String
            Get
                Return Me._packageNoExt
            End Get
            Set
                Me._packageNoExt = Value
            End Set
        End Property

        Public Property gWeight() As Decimal
            Get
                Return Me._gWeight
            End Get
            Set
                Me._gWeight = Value
            End Set
        End Property

        Public Property nWeight() As Decimal
            Get
                Return Me._nWeight
            End Get
            Set
                Me._nWeight = Value
            End Set
        End Property

        Public Property tara() As Decimal
            Get
                Return Me._tara
            End Get
            Set
                Me._tara = Value
            End Set
        End Property

        Public Property unitWeight() As String
            Get
                Return Me._unitWeight
            End Get
            Set
                Me._unitWeight = Value
            End Set
        End Property

        Public Property volume() As Decimal
            Get
                Return Me._volume
            End Get
            Set
                Me._volume = Value
            End Set
        End Property

        Public Property grossVolume() As Decimal
            Get
                Return Me._grossVolume
            End Get
            Set
                Me._grossVolume = Value
            End Set
        End Property

        Public Property netVolume() As Decimal
            Get
                Return Me._netVolume
            End Get
            Set
                Me._netVolume = Value
            End Set
        End Property

        Public Property unitVolume() As String
            Get
                Return Me._unitVolume
            End Get
            Set
                Me._unitVolume = Value
            End Set
        End Property

        Public Property length() As Decimal
            Get
                Return Me._length
            End Get
            Set
                Me._length = Value
            End Set
        End Property

        Public Property width() As Decimal
            Get
                Return Me._width
            End Get
            Set
                Me._width = Value
            End Set
        End Property

        Public Property height() As Decimal
            Get
                Return Me._height
            End Get
            Set
                Me._height = Value
            End Set
        End Property

        Public Property unitlwh() As String
            Get
                Return Me._unitlwh
            End Get
            Set
                Me._unitlwh = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TPackageHead))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TPackageHead object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPackageHead, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TPackageHead)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPackageHead) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TPackageHead
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TPackageHead)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TPackageHead
            Return CType(Serializer.Deserialize(s), TPackageHead)
        End Function
#End Region

        ''' <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 Serializer 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 Class

    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0"),
     System.SerializableAttribute(),
     System.Diagnostics.DebuggerStepThroughAttribute(),
     System.ComponentModel.DesignerCategoryAttribute("code"),
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2"),
     System.Xml.Serialization.XmlRootAttribute([Namespace]:="urn:http://www.mic-cust.com/MicCustExportShipment/6.2", IsNullable:=True)>
    Partial Public Class TPackageLine

#Region "Private fields"
        Private _invNo As String

        Private _invPos As String

        Private _quantity As Decimal

        Private _unit As String

        Private _nWeight As Decimal

        Private _numberOfPackages As Long

        Private _itemQuantity As Long

        Private _itemUnit As String

        Private Shared sSerializer As XmlSerializer
#End Region

        Public Property invNo() As String
            Get
                Return Me._invNo
            End Get
            Set
                Me._invNo = Value
            End Set
        End Property

        <System.Xml.Serialization.XmlElementAttribute(DataType:="integer")>
        Public Property invPos() As String
            Get
                Return Me._invPos
            End Get
            Set
                Me._invPos = Value
            End Set
        End Property

        Public Property quantity() As Decimal
            Get
                Return Me._quantity
            End Get
            Set
                Me._quantity = Value
            End Set
        End Property

        Public Property unit() As String
            Get
                Return Me._unit
            End Get
            Set
                Me._unit = Value
            End Set
        End Property

        Public Property nWeight() As Decimal
            Get
                Return Me._nWeight
            End Get
            Set
                Me._nWeight = Value
            End Set
        End Property

        Public Property numberOfPackages() As Long
            Get
                Return Me._numberOfPackages
            End Get
            Set
                Me._numberOfPackages = Value
            End Set
        End Property

        Public Property itemQuantity() As Long
            Get
                Return Me._itemQuantity
            End Get
            Set
                Me._itemQuantity = Value
            End Set
        End Property

        Public Property itemUnit() As String
            Get
                Return Me._itemUnit
            End Get
            Set
                Me._itemUnit = Value
            End Set
        End Property

        Private Shared ReadOnly Property Serializer() As XmlSerializer
            Get
                If (sSerializer Is Nothing) Then
                    sSerializer = New XmlSerializerFactory().CreateSerializer(GetType(TPackageLine))
                End If
                Return sSerializer
            End Get
        End Property

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serializes current TPackageLine object into an XML string
        ''' </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()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                Serializer.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New System.IO.StreamReader(memoryStream)
                Return streamReader.ReadToEnd
            Finally
                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="input">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 Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPackageLine, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TPackageLine)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TPackageLine) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TPackageLine
            Dim stringReader As System.IO.StringReader = Nothing
            Try
                stringReader = New System.IO.StringReader(input)
                Return CType(Serializer.Deserialize(XmlReader.Create(stringReader)), TPackageLine)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As System.IO.Stream) As TPackageLine
            Return CType(Serializer.Deserialize(s), TPackageLine)
        End Function
#End Region

        ''' <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 Serializer 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 Class
End Namespace
